History

Fix offline Q&A when running as firefox app

Fixes #173.

Thibaut committed 11 years ago

Commit f100f011 parent aa3de222 files · +3 −0Browse files

Unified · Split

2 files
  1. assets/javascripts/app/app.coffee +1 −0
  2. assets/javascripts/templates/pages/offline_tmpl.coffee +2 −0
assets/javascripts/app/app.coffee+1−0
@@ -87,6 +87,7 @@ · 86 unmodified lines
87 @hideLoading()87 @hideLoading()
88 @welcomeBack() unless @doc88 @welcomeBack() unless @doc
89 @removeEvent 'ready bootError'89 @removeEvent 'ready bootError'
90 navigator.mozApps?.getSelf().onsuccess = -> app.mozApp = true
90 return91 return
91 92
92 initDoc: (doc) ->93 initDoc: (doc) ->
assets/javascripts/templates/pages/offline_tmpl.coffee+2−0
@@ -43,6 +43,8 @@ canICloseTheTab = -> · 42 unmodified lines
43 if app.AppCache.isEnabled()43 if app.AppCache.isEnabled()
44 """ Yes! Even offline, you can open a new tab, go to <a href="http://devdocs.io">devdocs.io</a>, and everything will work as if you were online (provided you installed all the documentations you want to use beforehand).<br>44 """ Yes! Even offline, you can open a new tab, go to <a href="http://devdocs.io">devdocs.io</a>, and everything will work as if you were online (provided you installed all the documentations you want to use beforehand).<br>
45 Note that loading any page other than <a href="http://devdocs.io">devdocs.io</a> directly won't work (due to limitations in AppCache). """45 Note that loading any page other than <a href="http://devdocs.io">devdocs.io</a> directly won't work (due to limitations in AppCache). """
46 else if app.mozApp
47 """ Yes! Even offline, you can open the app and everything will work as if you were online (provided you installed all the documentations you want to use beforehand). """
46 else48 else
47 """ No. AppCache isn't available in your browser (or is disabled) so loading <a href="http://devdocs.io">devdocs.io</a> offline won't work.<br>49 """ No. AppCache isn't available in your browser (or is disabled) so loading <a href="http://devdocs.io">devdocs.io</a> offline won't work.<br>
48 The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """50 The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """