From 6a5a8970a0e034dc10738c0e6a11492611db21a1 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 13 Feb 2014 17:04:56 +0000 Subject: chore(indexPage.template): add back Google analytics and offline support --- docs/config/templates/indexPage.template.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs/config/templates') 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); + })(); -- cgit v1.2.3