diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-11-11 00:20:13 +0100 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-11-11 00:20:13 +0100 |
commit | bcdd458a348bb889878e56d6bdb82b1a67c4bcd4 (patch) | |
tree | 6f2a1554bef7b26d074fef200ffc372b23dff9ef /_includes/footer.html | |
parent | 99df8c72065e042ba383538cc21808d80df7f2bc (diff) |
JavaScript/CSS updates
Remove useless font import from CSS
Embed scale.fix.js into footer
Replace GA code in footer with tracking code from GA
Diffstat (limited to '_includes/footer.html')
-rw-r--r-- | _includes/footer.html | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/_includes/footer.html b/_includes/footer.html index 6eb8358..ecffab0 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -4,16 +4,34 @@ <p><small>Hosted on GitHub — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p> </footer> </div> - <script src="/javascripts/scale.fix.js"></script> <script type="text/javascript"> - 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")); + // scale.fix.js + var metas = document.getElementsByTagName('meta'); + var i; + if (navigator.userAgent.match(/iPhone/i)) { + for (i=0; i<metas.length; i++) { + if (metas[i].name == "viewport") { + metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; + } + } + document.addEventListener("gesturestart", gestureStart, false); + } + function gestureStart() { + for (i=0; i<metas.length; i++) { + if (metas[i].name == "viewport") { + metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6"; + } + } + } </script> <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-954596-3"); - pageTracker._trackPageview(); - } catch(err) {} + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-954596-3', 'auto'); + ga('send', 'pageview'); </script> </body> </html> |