From 39f5f9db2ed9114eb2b1843a85b0636a0aa132e7 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 29 Mar 2013 00:49:46 +0000 Subject: [PATCH] inject smartphone.css dynamically in code/smartphone.js - this makes it easy to switch between modes on a URL parameter fix #88 --- code/smartphone.js | 5 +++++ main.js | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/smartphone.js b/code/smartphone.js index 8cd4ad02..730db91f 100644 --- a/code/smartphone.js +++ b/code/smartphone.js @@ -20,6 +20,11 @@ window.runOnSmartphonesBeforeBoot = function() { if(!isSmartphone()) return; console.warn('running smartphone pre boot stuff'); + // add smartphone stylesheet + headHTML = document.getElementsByTagName('head')[0].innerHTML; + headHTML += ''; + document.getElementsByTagName('head')[0].innerHTML = headHTML; + // disable zoom buttons to see if they are really needed window.localStorage['iitc.zoom.buttons'] = 'false'; diff --git a/main.js b/main.js index d47c8acc..ded391fa 100644 --- a/main.js +++ b/main.js @@ -60,10 +60,7 @@ document.getElementsByTagName('head')[0].innerHTML = '' + 'Ingress Intel Map' + '' + '' - // this navigator check is also used in code/smartphone.js - + (navigator.userAgent.match(/Android.*Mobile/) - ? '' - : '') +//note: smartphone.css injection moved into code/smartphone.js + ''; document.getElementsByTagName('body')[0].innerHTML = ''