File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 @document = new app.views.Document
2828 @mobile = new app.views.Mobile if @ isMobile ()
2929
30- if @DOC
30+ if document .body .hasAttribute (' data-doc' )
31+ @DOC = JSON .parse (document .body .getAttribute (' data-doc' ))
3132 @ bootOne ()
3233 else if @DOCS
3334 @ bootAll ()
Original file line number Diff line number Diff line change @@ -185,13 +185,13 @@ def app
185185 it "works when the doc exists" do
186186 get '/html~4-foo-bar_42/'
187187 assert last_response . ok?
188- assert_includes last_response . body , 'app.DOC = {" name":" HTML"," slug":" html~4" '
188+ assert_includes last_response . body , 'data-doc="{" name":" HTML"," slug":" html~4" '
189189 end
190190
191191 it "works when the doc has no version in the path and a version exists" do
192192 get '/html-foo-bar_42/'
193193 assert last_response . ok?
194- assert_includes last_response . body , 'app.DOC = {" name":" HTML"," slug":" html~5" '
194+ assert_includes last_response . body , 'data-doc="{" name":" HTML"," slug":" html~5" '
195195 end
196196
197197 it "returns 404 when the type is blank" do
Original file line number Diff line number Diff line change 1313 < link rel ="stylesheet " href ="<%= main_stylesheet_path %> " data-alt ="<%= alternate_stylesheet_path %> ">
1414 <%= javascript_tag 'application' , asset_host : false %> <% unless App . production? %>
1515 <%= javascript_tag 'debug' %> <% end %>
16- < script > app . DOC = <%= @doc . to_json %> ; </ script >
1716</ head >
18- < body class ="_booting _noscript ">
17+ < body class ="_booting _noscript " data-doc =" <%= CGI :: escape_html @doc . to_json %> " >
1918< noscript class ="_fail "> DevDocs requires JavaScript to run.</ noscript >
2019<%= erb :app %> </ body >
2120</ html >
You can’t perform that action at this time.
0 commit comments