web/static/res/js/incdetectmobile.js
author Edwin Razafimahatratra <edwin@robotalismsoft.com>
Fri, 25 Jan 2013 18:20:49 +0100
changeset 113 cfbe387e4284
parent 78 8c3f0b94d056
permissions -rw-r--r--
dernier commit niv1 avant recepage

function IsSmartphone() {
	return DetectUagent("android") ||
    	DetectUagent("iphone") ||
    	DetectUagent("ipod") ||
    	DetectUagent("symbian") ||
    	DetectUagent("series60") ||
    	DetectUagent("windows phone") ||    	
    	(DetectUagent("windows nt") && DetectUagent("arm")) || // Windows 8 on phone and surface!
    	DetectUagent("blackberry");    	
}

function IsIpad() {
    return DetectUagent("ipad");    		
}

function DetectUagent(name){
    return (navigator.userAgent.toLowerCase().search(name) > -1);
}