Browse Source

Rename docs_host → docs_origin

Thibaut Courouble 9 years ago
parent
commit
7419d24453

+ 1 - 1
assets/javascripts/app/app.coffee

@@ -196,7 +196,7 @@
   indexHost: ->
     # Can't load the index files from the host/CDN when applicationCache is
     # enabled because it doesn't support caching URLs that use CORS.
-    @config[if @appCache and @settings.hasDocs() then 'index_path' else 'docs_host']
+    @config[if @appCache and @settings.hasDocs() then 'index_path' else 'docs_origin']
 
   onBootError: (args...) ->
     @trigger 'bootError'

+ 1 - 1
assets/javascripts/app/config.coffee.erb

@@ -1,7 +1,7 @@
 app.config =
   db_filename: 'db.json'
   default_docs: <%= App.default_docs.to_json %>
-  docs_host: '<%= App.docs_host %>'
+  docs_origin: '<%= App.docs_origin %>'
   env: '<%= App.environment %>'
   history_cache_size: 10
   index_filename: 'index.json'

+ 2 - 2
assets/javascripts/models/doc.coffee

@@ -30,10 +30,10 @@ class app.models.Doc extends app.Model
     "/#{@slug}#{path}"
 
   fileUrl: (path) ->
-    "#{app.config.docs_host}#{@fullPath(path)}?#{@mtime}"
+    "#{app.config.docs_origin}#{@fullPath(path)}?#{@mtime}"
 
   dbUrl: ->
-    "#{app.config.docs_host}/#{@slug}/#{app.config.db_filename}?#{@mtime}"
+    "#{app.config.docs_origin}/#{@slug}/#{app.config.db_filename}?#{@mtime}"
 
   indexUrl: ->
     "#{app.indexHost()}/#{@slug}/#{app.config.index_filename}?#{@mtime}"

+ 2 - 2
lib/app.rb

@@ -26,7 +26,7 @@ class App < Sinatra::Application
 
     require 'yajl/json_gem'
     set :docs_prefix, 'docs'
-    set :docs_host, -> { File.join('', docs_prefix) }
+    set :docs_origin, -> { File.join('', docs_prefix) }
     set :docs_path, -> { File.join(public_folder, docs_prefix) }
     set :docs_manifest_path, -> { File.join(docs_path, 'docs.json') }
     set :default_docs, %w(css dom dom_events html http javascript)
@@ -75,7 +75,7 @@ class App < Sinatra::Application
   configure :production do
     set :static, false
     set :cdn_origin, 'https://cdn.devdocs.io'
-    set :docs_host, '//docs.devdocs.io'
+    set :docs_origin, '//docs.devdocs.io'
     set :csp, "default-src 'self' *; script-src 'self' 'nonce-devdocs' http://cdn.devdocs.io https://cdn.devdocs.io https://www.google-analytics.com https://secure.gaug.es http://*.jquery.com https://*.jquery.com; font-src data:; style-src 'self' 'unsafe-inline' *; img-src 'self' * data:;"
 
     use Rack::ConditionalGet