Diffstat (limited to 'frontend/gamma/js/Zepto/detect.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Zepto/detect.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/frontend/gamma/js/Zepto/detect.js b/frontend/gamma/js/Zepto/detect.js deleted file mode 100644 index 22c0386..0000000 --- a/frontend/gamma/js/Zepto/detect.js +++ b/dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | // Zepto.js | ||
2 | // (c) 2010-2012 Thomas Fuchs | ||
3 | // Zepto.js may be freely distributed under the MIT license. | ||
4 | |||
5 | ;(function($){ | ||
6 | function detect(ua){ | ||
7 | var os = this.os = {}, browser = this.browser = {}, | ||
8 | webkit = ua.match(/WebKit\/([\d.]+)/), | ||
9 | android = ua.match(/(Android)\s+([\d.]+)/), | ||
10 | ipad = ua.match(/(iPad).*OS\s([\d_]+)/), | ||
11 | iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/), | ||
12 | webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/), | ||
13 | touchpad = webos && ua.match(/TouchPad/), | ||
14 | kindle = ua.match(/Kindle\/([\d.]+)/), | ||
15 | silk = ua.match(/Silk\/([\d._]+)/), | ||
16 | blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/), | ||
17 | chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/) | ||
18 | |||
19 | // todo clean this up with a better OS/browser | ||
20 | // separation. we need to discern between multiple | ||
21 | // browsers on android, and decide if kindle fire in | ||
22 | // silk mode is android or not | ||
23 | |||
24 | if (browser.webkit = !!webkit) browser.version = webkit[1] | ||
25 | |||
26 | if (android) os.android = true, os.version = android[2] | ||
27 | if (iphone) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.') | ||
28 | if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.') | ||
29 | if (webos) os.webos = true, os.version = webos[2] | ||
30 | if (touchpad) os.touchpad = true | ||
31 | if (blackberry) os.blackberry = true, os.version = blackberry[2] | ||
32 | if (kindle) os.kindle = true, os.version = kindle[1] | ||
33 | if (silk) browser.silk = true, browser.version = silk[1] | ||
34 | if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true | ||
35 | if (chrome) browser.chrome = true, browser.version = chrome[1] | ||
36 | } | ||
37 | |||
38 | detect.call($, navigator.userAgent) | ||
39 | // make available to unit tests | ||
40 | $.__detect = detect | ||
41 | |||
42 | })(Zepto) | ||