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
8787 @hideLoading()
8888 @welcomeBack() unless @doc
8989 @removeEvent 'ready bootError'
90+ navigator.mozApps?.getSelf().onsuccess = -> app.mozApp = true
9091 return
9192
9293 initDoc: (doc) ->
assets/javascripts/templates/pages/offline_tmpl.coffee+2−0
@@ -43,6 +43,8 @@ canICloseTheTab = -> · 42 unmodified lines
4343 if app.AppCache.isEnabled()
4444 """ 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>
4545 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). """
4648 else
4749 """ 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>
4850 The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """