allow forcing of mobile/desktop site with vp=m or vp=f URL parameters

this will allow the IITC Mobile app to include an option to choose desktop/mobile versions of IITC
for regular desktop browsers, don't expect it to work well with vp=m
This commit is contained in:
Jon Atkins 2013-03-27 05:37:30 +00:00
parent 432974f6fa
commit 51804c80dd

View File

@ -2,6 +2,15 @@ window.isSmartphone = function() {
// this check is also used in main.js. Note it should not detect // this check is also used in main.js. Note it should not detect
// tablets because their display is large enough to use the desktop // tablets because their display is large enough to use the desktop
// version. // version.
// The stock intel site allows forcing mobile/full sites with a vp=m or vp=f
// parameter - let's support the same. (stock only allows this for some
// browsers - e.g. android phone/tablet. let's allow it for all, but
// no promises it'll work right)
var viewParam = getURLParam('vp');
if (viewParam == 'm') return true;
if (viewParam == 'f') return false;
return navigator.userAgent.match(/Android.*Mobile/); return navigator.userAgent.match(/Android.*Mobile/);
} }