diff --git a/assets/javascripts/templates/error_tmpl.coffee b/assets/javascripts/templates/error_tmpl.coffee
index e0f15847..f5a33413 100644
--- a/assets/javascripts/templates/error_tmpl.coffee
+++ b/assets/javascripts/templates/error_tmpl.coffee
@@ -3,7 +3,7 @@ error = (title, text = '', links = '') ->
links = """
#{links}
""" if links
"""#{title}
#{text}#{links}"""
-back = 'Go back'
+back = 'Go back'
app.templates.notFoundPage = ->
error """ Page not found. """,
@@ -19,7 +19,7 @@ app.templates.pageLoadError = ->
app.templates.bootError = ->
error """ The app failed to load. """,
- """ Check your Internet connection and try reloading.
+ """ Check your Internet connection and try reloading.
If you keep seeing this, you're likely behind a proxy or firewall that blocks cross-domain requests. """
app.templates.offlineError = (reason) ->
diff --git a/assets/javascripts/templates/notif_tmpl.coffee b/assets/javascripts/templates/notif_tmpl.coffee
index c307100b..899070ea 100644
--- a/assets/javascripts/templates/notif_tmpl.coffee
+++ b/assets/javascripts/templates/notif_tmpl.coffee
@@ -7,12 +7,12 @@ textNotif = (title, message) ->
app.templates.notifUpdateReady = ->
textNotif """ DevDocs has been updated. """,
- """ Reload the page to use the new version. """
+ """ Reload the page to use the new version. """
app.templates.notifError = ->
textNotif """ Oops, an error occured. """,
- """ Try reloading, and if the problem persists,
- resetting the app.
+ """ Try reloading, and if the problem persists,
+ resetting the app.
You can also report this issue on GitHub. """
app.templates.notifQuotaExceeded = ->
diff --git a/assets/javascripts/templates/pages/offline_tmpl.coffee b/assets/javascripts/templates/pages/offline_tmpl.coffee
index 57e780d6..e5bf670f 100644
--- a/assets/javascripts/templates/pages/offline_tmpl.coffee
+++ b/assets/javascripts/templates/pages/offline_tmpl.coffee
@@ -33,7 +33,7 @@ app.templates.offlinePage = (docs) -> """
I found a bug, where do I report it?
In the issue tracker. Thanks!
How do I uninstall/reset the app?
- Click here.
+ Click here.
Why aren't all documentations listed above?
You have to enable them first.
diff --git a/assets/javascripts/views/layout/document.coffee b/assets/javascripts/views/layout/document.coffee
index 95020e47..69b513a1 100644
--- a/assets/javascripts/views/layout/document.coffee
+++ b/assets/javascripts/views/layout/document.coffee
@@ -24,6 +24,8 @@ class app.views.Document extends app.View
.on 'searching', @onSearching
.on 'clear', @onSearchClear
+ $.on document.body, 'click', @onClick
+
@activate()
return
@@ -99,3 +101,14 @@ class app.views.Document extends app.View
onForward: ->
history.forward()
+
+ onClick: (event) ->
+ return unless event.target.hasAttribute('data-behavior')
+ $.stopEvent(event)
+ switch event.target.getAttribute('data-behavior')
+ when 'back' then history.back()
+ when 'reload' then window.location.reload()
+ when 'reboot' then window.location = '/'
+ when 'hard-reload' then app.reload()
+ when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?')
+ return