Unified · Split
| @@ -209,18 +209,6 @@ class App < Sinatra::Application · 208 unmodified lines | |||
| 209 | @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px" | 209 | @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px" |
| 210 | end | 210 | end |
| 211 | 211 | ||
| 212 | def app_layout | ||
| 213 | memoized_cookies['layout'] | ||
| 214 | end | ||
| 215 | |||
| 216 | def app_theme | ||
| 217 | @app_theme ||= memoized_cookies['dark'].nil? ? 'default' : 'dark' | ||
| 218 | end | ||
| 219 | |||
| 220 | def dark_theme? | ||
| 221 | app_theme == 'dark' | ||
| 222 | end | ||
| 223 | |||
| 224 | def bypass_cache? | 212 | def bypass_cache? |
| 225 | !memoized_cookies['bypassCache'].nil? | 213 | !memoized_cookies['bypassCache'].nil? |
| 226 | end | 214 | end |
| @@ -1,5 +1,5 @@ | |||
| 1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
| 2 | <html prefix="og: http://ogp.me/ns#" lang="en" class="_booting _theme-<%= app_theme %>"> | 2 | <html prefix="og: http://ogp.me/ns#" lang="en" class="_booting"> |
| 3 | <head> | 3 | <head> |
| 4 | <meta charset="utf-8"> | 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no"> | 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no"> |
| @@ -32,7 +32,7 @@ · 26 unmodified lines | |||
| 32 | <link rel="mask-icon" href="<%= App.cdn_origin %>/images/webkit-mask-icon.svg" color="#398df0"> | 32 | <link rel="mask-icon" href="<%= App.cdn_origin %>/images/webkit-mask-icon.svg" color="#398df0"> |
| 33 | <%= stylesheet_tag 'application' %> | 33 | <%= stylesheet_tag 'application' %> |
| 34 | </head> | 34 | </head> |
| 35 | <body<%= %( class="#{app_layout}") if app_layout %>> | 35 | <body> |
| 36 | <noscript class="_fail">DevDocs requires JavaScript to run.</noscript> | 36 | <noscript class="_fail">DevDocs requires JavaScript to run.</noscript> |
| 37 | <%= erb :app -%> | 37 | <%= erb :app -%> |
| 38 | <%= javascript_tag 'application', asset_host: false %> | 38 | <%= javascript_tag 'application', asset_host: false %> |
| @@ -1,5 +1,5 @@ | |||
| 1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
| 2 | <html lang="en" class="_booting _theme-<%= app_theme %>"> | 2 | <html lang="en" class="_booting"> |
| 3 | <head> | 3 | <head> |
| 4 | <meta charset="utf-8"> | 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> | 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> |
| @@ -13,7 +13,7 @@ · 7 unmodified lines | |||
| 13 | <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Search DevDocs"> | 13 | <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Search DevDocs"> |
| 14 | <%= stylesheet_tag 'application' %> | 14 | <%= stylesheet_tag 'application' %> |
| 15 | </head> | 15 | </head> |
| 16 | <body<%= %( class="#{app_layout}") if app_layout %> data-doc="<%= CGI::escape_html @doc.to_json %>"> | 16 | <body data-doc="<%= CGI::escape_html @doc.to_json %>"> |
| 17 | <noscript class="_fail">DevDocs requires JavaScript to run.</noscript> | 17 | <noscript class="_fail">DevDocs requires JavaScript to run.</noscript> |
| 18 | <%= erb :app -%> | 18 | <%= erb :app -%> |
| 19 | <%= javascript_tag 'application', asset_host: false %><% unless App.production? %> | 19 | <%= javascript_tag 'application', asset_host: false %><% unless App.production? %> |