1/*! 2 * jQuery UI 1.8rc3 3 * 4 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 5 * Dual licensed under the MIT (MIT-LICENSE.txt) 6 * and GPL (GPL-LICENSE.txt) licenses. 7 * 8 * http://docs.jquery.com/UI 9 */ 10;jQuery.ui || (function($) { 11 12var isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); 13 14//Helper functions and ui object 15$.ui = { 16 version: "1.8rc3", 17 18 // $.ui.plugin is deprecated. Use the proxy pattern instead. 19 plugin: { 20 add: function(module, option, set) { 21 var proto = $.ui[module].prototype; 22 for(var i in set) { 23 proto.plugins[i] = proto.plugins[i] || []; 24 proto.plugins[i].push([option, set[i]]); 25 } 26 }, 27 call: function(instance, name, args) { 28 var set = instance.plugins[name]; 29 if(!set || !instance.element[0].parentNode) { return; } 30 31 for (var i = 0; i < set.length; i++) { 32 if (instance.options[set[i][0]]) { 33 set[i][1].apply(instance.element, args); 34 } 35 } 36 } 37 }, 38 39 contains: function(a, b) { 40 return document.compareDocumentPosition 41 ? a.compareDocumentPosition(b) & 16 42 : a !== b && a.contains(b); 43 }, 44 45 hasScroll: function(el, a) { 46 47 //If overflow is hidden, the element might have extra content, but the user wants to hide it 48 if ($(el).css('overflow') == 'hidden') { return false; } 49 50 var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', 51 has = false; 52 53 if (el[scroll] > 0) { return true; } 54 55 // TODO: determine which cases actually cause this to happen 56 // if the element doesn't have the scroll set, see if it's possible to 57 // set the scroll 58 el[scroll] = 1; 59 has = (el[scroll] > 0); 60 el[scroll] = 0; 61 return has; 62 }, 63 64 isOverAxis: function(x, reference, size) { 65 //Determines when x coordinate is over "b" element axis 66 return (x > reference) && (x < (reference + size)); 67 }, 68 69 isOver: function(y, x, top, left, height, width) { 70 //Determines when x, y coordinates is over "b" element 71 return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); 72 }, 73 74 keyCode: { 75 BACKSPACE: 8, 76 CAPS_LOCK: 20, 77 COMMA: 188, 78 CONTROL: 17, 79 DELETE: 46, 80 DOWN: 40, 81 END: 35, 82 ENTER: 13, 83 ESCAPE: 27, 84 HOME: 36, 85 INSERT: 45, 86 LEFT: 37, 87 NUMPAD_ADD: 107, 88 NUMPAD_DECIMAL: 110, 89 NUMPAD_DIVIDE: 111, 90 NUMPAD_ENTER: 108, 91 NUMPAD_MULTIPLY: 106, 92 NUMPAD_SUBTRACT: 109, 93 PAGE_DOWN: 34, 94 PAGE_UP: 33, 95 PERIOD: 190, 96 RIGHT: 39, 97 SHIFT: 16, 98 SPACE: 32, 99 TAB: 9, 100 UP: 38 101 } 102}; 103 104//jQuery plugins 105$.fn.extend({ 106 _focus: $.fn.focus, 107 focus: function(delay, fn) { 108 return typeof delay === 'number' 109 ? this.each(function() { 110 var elem = this; 111 setTimeout(function() { 112 $(elem).focus(); 113 (fn && fn.call(elem)); 114 }, delay); 115 }) 116 : this._focus.apply(this, arguments); 117 }, 118 119 enableSelection: function() { 120 return this 121 .attr('unselectable', 'off') 122 .css('MozUserSelect', '') 123 .unbind('selectstart.ui'); 124 }, 125 126 disableSelection: function() { 127 return this 128 .attr('unselectable', 'on') 129 .css('MozUserSelect', 'none') 130 .bind('selectstart.ui', function() { return false; }); 131 }, 132 133 scrollParent: function() { 134 var scrollParent; 135 if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { 136 scrollParent = this.parents().filter(function() { 137 return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); 138 }).eq(0); 139 } else { 140 scrollParent = this.parents().filter(function() { 141 return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); 142 }).eq(0); 143 } 144 145 return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; 146 }, 147 148 zIndex: function(zIndex) { 149 if (zIndex !== undefined) { 150 return this.css('zIndex', zIndex); 151 } 152 153 if (this.length) { 154 var elem = $(this[0]), position, value; 155 while (elem.length && elem[0] !== document) { 156 // Ignore z-index if position is set to a value where z-index is ignored by the browser 157 // This makes behavior of this function consistent across browsers 158 // WebKit always returns auto if the element is positioned 159 position = elem.css('position'); 160 if (position == 'absolute' || position == 'relative' || position == 'fixed') 161 { 162 // IE returns 0 when zIndex is not specified 163 // other browsers return a string 164 // we ignore the case of nested elements with an explicit value of 0 165 // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> 166 value = parseInt(elem.css('zIndex')); 167 if (!isNaN(value) && value != 0) { 168 return value; 169 } 170 } 171 elem = elem.parent(); 172 } 173 } 174 175 return 0; 176 } 177}); 178 179 180//Additional selectors 181$.extend($.expr[':'], { 182 data: function(elem, i, match) { 183 return !!$.data(elem, match[3]); 184 }, 185 186 focusable: function(element) { 187 var nodeName = element.nodeName.toLowerCase(), 188 tabIndex = $.attr(element, 'tabindex'); 189 return (/input|select|textarea|button|object/.test(nodeName) 190 ? !element.disabled 191 : 'a' == nodeName || 'area' == nodeName 192 ? element.href || !isNaN(tabIndex) 193 : !isNaN(tabIndex)) 194 // the element and all of its ancestors must be visible 195 // the browser may report that the area is hidden 196 && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; 197 }, 198 199 tabbable: function(element) { 200 var tabIndex = $.attr(element, 'tabindex'); 201 return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); 202 } 203}); 204 205})(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.