diff options
| author | Peter Bacon Darwin | 2014-02-13 17:04:56 +0000 |
|---|---|---|
| committer | Peter Bacon Darwin | 2014-02-16 19:03:42 +0000 |
| commit | 6a5a8970a0e034dc10738c0e6a11492611db21a1 (patch) | |
| tree | 9de3415edbe20adc5450f3003d759491c11c909a | |
| parent | 69a687e04e5983e7ebbd8169afa0f4f16251b3a9 (diff) | |
| download | angular.js-6a5a8970a0e034dc10738c0e6a11492611db21a1.tar.bz2 | |
chore(indexPage.template): add back Google analytics and offline support
| -rw-r--r-- | docs/config/templates/indexPage.template.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/config/templates/indexPage.template.html b/docs/config/templates/indexPage.template.html index fdfd8b4a..e156226a 100644 --- a/docs/config/templates/indexPage.template.html +++ b/docs/config/templates/indexPage.template.html @@ -54,6 +54,26 @@ })(node); } })(); + + + // 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); + + // GA asynchronous tracker + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-8594346-3']); + _gaq.push(['_setDomainName', '.angularjs.org']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + 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); + })(); </script> </head> <body> |
