web/static/res/js/incdetectmobile.js
changeset 78 8c3f0b94d056
equal deleted inserted replaced
77:0055b4bee4e3 78:8c3f0b94d056
       
     1 function IsSmartphone() {
       
     2 	return DetectUagent("android") ||
       
     3     	DetectUagent("iphone") ||
       
     4     	DetectUagent("ipod") ||
       
     5     	DetectUagent("symbian") ||
       
     6     	DetectUagent("series60") ||
       
     7     	DetectUagent("windows phone") ||    	
       
     8     	(DetectUagent("windows nt") && DetectUagent("arm")) || // Windows 8 on phone and surface!
       
     9     	DetectUagent("blackberry");    	
       
    10 }
       
    11 
       
    12 function IsIpad() {
       
    13     return DetectUagent("ipad");    		
       
    14 }
       
    15 
       
    16 function DetectUagent(name){
       
    17     return (navigator.userAgent.toLowerCase().search(name) > -1);
       
    18 }