All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gwtplatform.mvp.FormFactor.gwt.xml Maven / Gradle / Ivy

There is a newer version: 1.6
Show newest version


    
    
        = 0) {
          var value = args.substring(start);
          var begin = value.indexOf("=") + 1;
          var end = value.indexOf("&");
          if (end == -1) {
            end = value.indexOf("#");
            if (end == -1) {
              end = value.length;
            }
          }
          return value.substring(begin, end);
        }
        // Detect form factor from user agent.
        var ua = navigator.userAgent.toLowerCase();     
        if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) {
          return "mobile";
        } else if (ua.indexOf("ipad") != -1) {
          return "tablet";
        } else if (ua.indexOf("android") != -1 ||
                   ua.indexOf("mobile") != -1) {
          var dpi = 160;
          var width = $wnd.screen.width / dpi;
          var height = $wnd.screen.height / dpi;
          var size = Math.sqrt(width*width + height*height);
          return (size < 6) ? "mobile" : "tablet";
        }
        return "desktop";
    ]]>
    

    
    
    
    
        
        
    

    
    
        
        
    





© 2015 - 2024 Weber Informatics LLC | Privacy Policy