aboutsummaryrefslogtreecommitdiffstats
path: root/dev-random
diff options
context:
space:
mode:
authorm-r-r <raybaudroigm@gmail.com>2012-05-28 13:15:44 +0200
committerm-r-r <raybaudroigm@gmail.com>2012-05-28 13:15:44 +0200
commitfe2acd8e538413a43ae1bc59b21be15a0d092853 (patch)
treec5784107613031b4175da3cbef37811d4284e83e /dev-random
parent528658da899139d05945818b09db177df2b4a9b5 (diff)
downloadpelican-themes-fe2acd8e538413a43ae1bc59b21be15a0d092853.zip
pelican-themes-fe2acd8e538413a43ae1bc59b21be15a0d092853.tar.gz
pelican-themes-fe2acd8e538413a43ae1bc59b21be15a0d092853.tar.bz2
Code cleanup
Diffstat (limited to 'dev-random')
-rw-r--r--dev-random/static/js/hex2ascii.js20
-rw-r--r--dev-random/templates/base.html30
2 files changed, 10 insertions, 40 deletions
diff --git a/dev-random/static/js/hex2ascii.js b/dev-random/static/js/hex2ascii.js
deleted file mode 100644
index 3dde36f..0000000
--- a/dev-random/static/js/hex2ascii.js
+++ /dev/null
@@ -1,20 +0,0 @@
-
-window.hex2ascii = {};
-window.hex2ascii.init = function() {
- var els = document.getElementsByClassName('hex'),
- hex, text,
- i, j, e;
-
- for(i=0; i < els.length; i++) {
- e = els[i];
- hex = e.innerHTML.split(' ');
- text = "";
-
- for(j=0; j < hex.length; j++) {
- text += String.fromCharCode(parseInt(hex[j], 16));
- }
-
- e.innerHTML = text;
- e.className = e.className.replace('hex','');
- }
-};
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 %}