diff options
| author | Igor Minar | 2011-06-07 12:53:40 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-06-07 14:56:01 -0700 | 
| commit | 25b3438fd78184cbbc420e2e051888f4f192a68a (patch) | |
| tree | 8b63995fe08546348661f3704ded38305fd7ab9c /docs/src/templates | |
| parent | f21b9214e657d41e20fb761948b05fc2c7c7f5a3 (diff) | |
| download | angular.js-25b3438fd78184cbbc420e2e051888f4f192a68a.tar.bz2 | |
add appcache for docs site - caches only css/js/img resources
Diffstat (limited to 'docs/src/templates')
| -rw-r--r-- | docs/src/templates/index.html | 11 | ||||
| -rw-r--r-- | docs/src/templates/offline.html | 4 | 
2 files changed, 14 insertions, 1 deletions
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 @@  <!doctype html>  <html xmlns:ng="http://angularjs.org/"        xmlns:doc="http://docs.angularjs.org/" -      ng:controller="DocsController"> +      ng:controller="DocsController" +      manifest="app-cache.manifest">  <head>    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />    <title ng:bind-template="<angular/>: {{partialTitle}}"><angular/></title> @@ -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);    </script>  </head> 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 @@ +<h2>OFFLINE</h2> + +<p>This page if unavailable because your are offline.</p> +<p>Please connect to the Internet and reload the page.</p>  | 
