From 25b3438fd78184cbbc420e2e051888f4f192a68a Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 7 Jun 2011 12:53:40 -0700 Subject: add appcache for docs site - caches only css/js/img resources --- docs/src/templates/index.html | 11 ++++++++++- docs/src/templates/offline.html | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 docs/src/templates/offline.html (limited to 'docs/src/templates') diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 9e0c64ba..cdd04e1d 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -1,7 +1,8 @@ + ng:controller="DocsController" + manifest="app-cache.manifest"> <angular/> @@ -20,6 +21,14 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); + + // force page reload when new update is available + window.applicationCache && window.applicationCache.addEventListener('updateready', function(e) { + if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { + window.applicationCache.swapCache(); + window.location.reload(); + } + }, false); diff --git a/docs/src/templates/offline.html b/docs/src/templates/offline.html new file mode 100644 index 00000000..9996eb1c --- /dev/null +++ b/docs/src/templates/offline.html @@ -0,0 +1,4 @@ +

OFFLINE

+ +

This page if unavailable because your are offline.

+

Please connect to the Internet and reload the page.

-- cgit v1.2.3