Skip to content

Commit a379b62

Browse files
committed
Ask all HTTP users to switch to HTTPS
1 parent f94dbb0 commit a379b62

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

‎assets/javascripts/templates/pages/root_tmpl.coffee.erb‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,14 @@ app.templates.androidWarning = """
7272
<p>To install DevDocs on your phone, visit <a href="https://devdocs.io" target="_blank" rel="noopener">devdocs.io</a> in Chrome and select "Add to home screen" in the menu.
7373
</div>
7474
"""
75+
76+
app.templates.httpWarning = """
77+
<div class="_intro"><div class="_intro-message">
78+
<h2 class="_intro-title">Hi there!</h2>
79+
<p>DevDocs is migrating to HTTPS.
80+
<p>Please update your bookmarks to point to <a href="https://devdocs.io">https://devdocs.io</a>.
81+
<p>When using the HTTPS version, your preferences will carry over automatically, but your offline data will be reset. Simply re-download documentation in the <a href="https://devdocs.io/offline">Offline area</a>, and you'll be all set to use DevDocs securely offline.
82+
<p>Sorry for the inconvenience. This migration is needed because browsers are removing support for certain DOM APIs that power DevDocs's offline mode over non-secure origins.
83+
<p>Thanks for using DevDocs, and happy coding!
84+
</div></div>
85+
"""

‎assets/javascripts/views/content/root_page.coffee‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,21 @@ class app.views.RootPage extends app.View
99

1010
render: ->
1111
@empty()
12-
if app.isAndroidWebview()
13-
@append @tmpl('androidWarning')
12+
13+
tmpl = if app.isAndroidWebview()
14+
'androidWarning'
15+
else if @isHidden()
16+
'splash'
17+
else if app.isMobile()
18+
'mobileIntro'
1419
else
15-
@append @tmpl if @isHidden() then 'splash' else if app.isMobile() then 'mobileIntro' else 'intro'
20+
'intro'
21+
22+
# temporary
23+
if location.host is 'devdocs.io' and location.protocol is 'http:'
24+
tmpl = 'httpWarning'
25+
26+
@append @tmpl(tmpl)
1627
return
1728

1829
hideIntro: ->

0 commit comments

Comments
 (0)