1/** 2 * 3 * CSS Browser Selector v0.4.0 (Nov 02, 2010) 4 * Rafael Lima (http://rafael.adm.br) 5 * http://rafael.adm.br/css_browser_selector 6 * License: http://creativecommons.org/licenses/by/2.5/ 7 * Contributors: http://rafael.adm.br/css_browser_selector#contributors 8 */ 9(function ($) { 10 Drupal.behaviors.browserSelectors = { 11 attach: function(context, settings) { 12 var ua = navigator.userAgent.toLowerCase(), 13 is = function (t) { 14 return ua.indexOf(t) > -1; 15 }, 16 g = 'gecko', 17 w = 'webkit', 18 s = 'safari', 19 o = 'opera', 20 m = 'mobile', 21 h = document.documentElement, 22 b = [ 23 (!(/opera|webtv/i.test(ua)) && /msie\s(\d+)/.test(ua)) ? ('ie ie' + RegExp.$1) : 24 is('firefox/') ? g + (/firefox\/(\d+)(\.?(\d*))/.test(ua) ? ' ff' + RegExp.$1 + (RegExp.$3 != 0 ? ' ff' + RegExp.$1 + '_' + RegExp.$3 : '') : '') : 25 is('gecko/') ? g : 26 is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : 27 is('konqueror') ? 'konqueror' : 28 is('blackberry') ? m + ' blackberry' : 29 is('android') ? m + ' android' : 30 is('chrome') ? w + ' chrome' : 31 is('iron') ? w + ' iron' : 32 is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : 33 is('mozilla/') ? g : '', 34 is('j2me') ? m + ' j2me' : 35 is('iphone') ? m + ' iphone' : 36 is('ipod') ? m + ' ipod' : 37 is('ipad') ? m + ' ipad' : 38 is('mac') ? 'mac' : 39 is('darwin') ? 'mac' : 40 is('webtv') ? 'webtv' : 41 is('win') ? 'win' + (is('windows nt 6.0') ? ' vista' : (is('windows nt 6.1') ? ' win7' : (is('windows nt 6.2') ? ' win8' : ''))) : 42 is('freebsd') ? 'freebsd' : 43 is('x11') ? 'linux' : 44 is('linux') ? 'linux' : '' 45 ]; 46 c = b.join(' '); 47 h.className += ' ' + c; 48 return c; 49 } 50 }; 51})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.