diff options
author | m-r-r <raybaudroigm@gmail.com> | 2012-05-28 13:15:44 +0200 |
---|---|---|
committer | m-r-r <raybaudroigm@gmail.com> | 2012-05-28 13:15:44 +0200 |
commit | fe2acd8e538413a43ae1bc59b21be15a0d092853 (patch) | |
tree | c5784107613031b4175da3cbef37811d4284e83e /dev-random/templates | |
parent | 528658da899139d05945818b09db177df2b4a9b5 (diff) | |
download | pelican-themes-fe2acd8e538413a43ae1bc59b21be15a0d092853.tar.gz |
Code cleanup
Diffstat (limited to 'dev-random/templates')
-rw-r--r-- | dev-random/templates/base.html | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/dev-random/templates/base.html b/dev-random/templates/base.html index d9dd46a..0df9663 100644 --- a/dev-random/templates/base.html +++ b/dev-random/templates/base.html @@ -15,29 +15,19 @@ title="{{ SITENAME }} — Flux RSS" href="{{ SITEURL }}/{{ FEED_RSS }}" /> {% endif %} - <script src="{{ SITEURL }}/theme/js/hex2ascii.js"></script> <!--[if lte IE 8]><script src="{{ SITEURL }}/theme/js/html5shiv.js"></script><![endif]--> + <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no" /> {% if GOOGLE_ANALYTICS %} <script type="text/javascript"> - // Google analytics: - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - function enableGA() { - try { - var pageTracker = _gat._getTracker("{{ GOOGLE_ANALYTICS }}"); - pageTracker._trackPageview(); - _gaq.push(['_setCustomVar', - 1, // This custom var is set to slot #1. Required parameter. - 'User-Agent', - navigator.userAgent - ]); - console.log('GA loaded'); - } catch(err) { - setTimeout(500,'enableGA()'); - console.log('Waiting GA ...'); - } - } - setTimeout('enableGA()', 200); + var _gaq = _gaq || []; + _gaq.push(['_setAccount', '{{ GOOGLE_ANALYTICS }}']); + _gaq.push(['_trackPageview']); + (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> {% endif %} {% endblock headers %} |