1 goog.provide('lime.userAgent'); 2 3 goog.require('goog.userAgent'); 4 5 6 (function() { 7 8 9 var ua = goog.userAgent.getUserAgentString(); 10 11 /** 12 * Whether the user agent is running on iOS device 13 * @type boolean 14 */ 15 lime.userAgent.IOS = goog.userAgent.WEBKIT && goog.userAgent.MOBILE && 16 (/(ipod|iphone|ipad)/i).test(ua); 17 18 19 /** 20 * Whether the user agent is running on Android device 21 * @type boolean 22 */ 23 lime.userAgent.ANDROID = goog.userAgent.WEBKIT && goog.userAgent.MOBILE && 24 (/(android)/i).test(ua); 25 26 27 /** 28 * Whether the user agent is running on iPad 29 * @type boolean 30 */ 31 lime.userAgent.IPAD = lime.userAgent.IOS && (/(ipad)/i).test(ua); 32 33 34 /** 35 * Whether the user agent is running on iPhone 4 36 * @type boolean 37 */ 38 lime.userAgent.IPHONE4 = lime.userAgent.IOS && 39 goog.global['devicePixelRatio'] >= 2; 40 41 42 /** 43 * Whether the user agent is running on touch based device 44 * @type boolean 45 */ 46 lime.userAgent.SUPPORTS_TOUCH = goog.isDef(document['ontouchmove']); 47 48 49 })(); 50