From b38d94890d687f7853b0f185468c8028fff5e1f6 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Fri, 2 Jan 2015 17:56:50 -0500 Subject: [PATCH] Add offline Q&A --- .../templates/pages/offline_tmpl.coffee | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/templates/pages/offline_tmpl.coffee b/assets/javascripts/templates/pages/offline_tmpl.coffee index 6cba2d48..500190fb 100644 --- a/assets/javascripts/templates/pages/offline_tmpl.coffee +++ b/assets/javascripts/templates/pages/offline_tmpl.coffee @@ -1,6 +1,32 @@ -app.templates.offlinePage = (docs) -> - """

Offline

- #{docs}
""" +app.templates.offlinePage = (docs) -> """ +

Offline Documentation

+ #{docs}
+

Questions & Answers

+
+
How does this work? +
Each page is cached as a key-value pair in IndexedDB (downloaded from a single JSON file).
+ The app also uses AppCache and localStorage to cache the assets and index files. +
Can I close the tab/browser? +
#{canICloseTheTab()} +
What if I don't update a documentation? +
You'll see outdated content and some pages will be missing or broken, since the rest of the app (including data for the search and sidebar) uses a different caching mechanism and is updated automatically.
+ Documentation versioning is planned for the future but not yet supported, sorry. +
I found a bug, where do I report it? +
In the issue tracker. Thanks! +
How do I uninstall/reset the app? +
Click here. +
Why aren't all documentations listed above? +
You have to enable them first. +
+""" + +canICloseTheTab = -> + if app.AppCache.isEnabled() + """ Yes! Even offline, you can open a new tab, go to devdocs.io, and everything will work as if you were online (provided you downloaded all the documentations you want to use beforehand).
+ Note that loading any page other than devdocs.io directly won't work (due to limitations in AppCache). """ + else + """ No. Because AppCache is unavailable in your browser (or has been disabled), loading devdocs.io offline won't work.
+ The current tab will continue to work, though (provided you downloaded all the documentations you want to use beforehand). """ app.templates.offlineDoc = (doc, status) -> html = """"""