Changeset 1048:a23c948b7ab2 for admin/js/jquery/jquery-ui.custom.js
- Timestamp:
- 11/30/12 06:53:40 (13 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/jquery/jquery-ui.custom.js
r906 r1048 1 /*! jQuery UI - v1.9. 0 - 2012-10-251 /*! jQuery UI - v1.9.2 - 2012-11-29 2 2 * http://jqueryui.com 3 3 * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.sortable.js, jquery.ui.accordion.js … … 18 18 19 19 $.extend( $.ui, { 20 version: "1.9. 0",20 version: "1.9.2", 21 21 22 22 keyCode: { … … 65 65 scrollParent: function() { 66 66 var scrollParent; 67 if (($. browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {67 if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { 68 68 scrollParent = this.parents().filter(function() { 69 69 return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); … … 124 124 }); 125 125 126 // selectors 127 function focusable( element, isTabIndexNotNaN ) { 128 var map, mapName, img, 129 nodeName = element.nodeName.toLowerCase(); 130 if ( "area" === nodeName ) { 131 map = element.parentNode; 132 mapName = map.name; 133 if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 134 return false; 135 } 136 img = $( "img[usemap=#" + mapName + "]" )[0]; 137 return !!img && visible( img ); 138 } 139 return ( /input|select|textarea|button|object/.test( nodeName ) ? 140 !element.disabled : 141 "a" === nodeName ? 142 element.href || isTabIndexNotNaN : 143 isTabIndexNotNaN) && 144 // the element and all of its ancestors must be visible 145 visible( element ); 146 } 147 148 function visible( element ) { 149 return $.expr.filters.visible( element ) && 150 !$( element ).parents().andSelf().filter(function() { 151 return $.css( this, "visibility" ) === "hidden"; 152 }).length; 153 } 154 155 $.extend( $.expr[ ":" ], { 156 data: $.expr.createPseudo ? 157 $.expr.createPseudo(function( dataName ) { 158 return function( elem ) { 159 return !!$.data( elem, dataName ); 160 }; 161 }) : 162 // support: jQuery <1.8 163 function( elem, i, match ) { 164 return !!$.data( elem, match[ 3 ] ); 165 }, 166 167 focusable: function( element ) { 168 return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); 169 }, 170 171 tabbable: function( element ) { 172 var tabIndex = $.attr( element, "tabindex" ), 173 isTabIndexNaN = isNaN( tabIndex ); 174 return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); 175 } 176 }); 177 178 // support 179 $(function() { 180 var body = document.body, 181 div = body.appendChild( div = document.createElement( "div" ) ); 182 183 // access offsetHeight before setting the style to prevent a layout bug 184 // in IE 9 which causes the element to continue to take up space even 185 // after it is removed from the DOM (#8026) 186 div.offsetHeight; 187 188 $.extend( div.style, { 189 minHeight: "100px", 190 height: "auto", 191 padding: 0, 192 borderWidth: 0 193 }); 194 195 $.support.minHeight = div.offsetHeight === 100; 196 $.support.selectstart = "onselectstart" in div; 197 198 // set display to none to avoid a layout bug in IE 199 // http://dev.jquery.com/ticket/4014 200 body.removeChild( div ).style.display = "none"; 201 }); 202 126 203 // support: jQuery <1.8 127 204 if ( !$( "<a>" ).outerWidth( 1 ).jquery ) { … … 171 248 } 172 249 173 // selectors 174 function focusable( element, isTabIndexNotNaN ) { 175 var map, mapName, img, 176 nodeName = element.nodeName.toLowerCase(); 177 if ( "area" === nodeName ) { 178 map = element.parentNode; 179 mapName = map.name; 180 if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 181 return false; 182 } 183 img = $( "img[usemap=#" + mapName + "]" )[0]; 184 return !!img && visible( img ); 185 } 186 return ( /input|select|textarea|button|object/.test( nodeName ) ? 187 !element.disabled : 188 "a" === nodeName ? 189 element.href || isTabIndexNotNaN : 190 isTabIndexNotNaN) && 191 // the element and all of its ancestors must be visible 192 visible( element ); 250 // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) 251 if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { 252 $.fn.removeData = (function( removeData ) { 253 return function( key ) { 254 if ( arguments.length ) { 255 return removeData.call( this, $.camelCase( key ) ); 256 } else { 257 return removeData.call( this ); 258 } 259 }; 260 })( $.fn.removeData ); 193 261 } 194 262 195 function visible( element ) {196 return !$( element ).parents().andSelf().filter(function() {197 return $.css( this, "visibility" ) === "hidden" ||198 $.expr.filters.hidden( this );199 }).length;200 }201 202 $.extend( $.expr[ ":" ], {203 data: $.expr.createPseudo ?204 $.expr.createPseudo(function( dataName ) {205 return function( elem ) {206 return !!$.data( elem, dataName );207 };208 }) :209 // support: jQuery <1.8210 function( elem, i, match ) {211 return !!$.data( elem, match[ 3 ] );212 },213 214 focusable: function( element ) {215 return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );216 },217 218 tabbable: function( element ) {219 var tabIndex = $.attr( element, "tabindex" ),220 isTabIndexNaN = isNaN( tabIndex );221 return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );222 }223 });224 225 // support226 $(function() {227 var body = document.body,228 div = body.appendChild( div = document.createElement( "div" ) );229 230 // access offsetHeight before setting the style to prevent a layout bug231 // in IE 9 which causes the element to continue to take up space even232 // after it is removed from the DOM (#8026)233 div.offsetHeight;234 235 $.extend( div.style, {236 minHeight: "100px",237 height: "auto",238 padding: 0,239 borderWidth: 0240 });241 242 $.support.minHeight = div.offsetHeight === 100;243 $.support.selectstart = "onselectstart" in div;244 245 // set display to none to avoid a layout bug in IE246 // http://dev.jquery.com/ticket/4014247 body.removeChild( div ).style.display = "none";248 });249 250 263 251 264 … … 253 266 254 267 // deprecated 268 269 (function() { 270 var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; 271 $.ui.ie = uaMatch.length ? true : false; 272 $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6; 273 })(); 255 274 256 275 $.fn.extend({ … … 424 443 // always use the name + a colon as the prefix, e.g., draggable:start 425 444 // don't prefix for widgets that aren't DOM-based 426 widgetEventPrefix: name445 widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name 427 446 }, prototype, { 428 447 constructor: constructor, … … 465 484 for ( key in input[ inputIndex ] ) { 466 485 value = input[ inputIndex ][ key ]; 467 if (input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 468 target[ key ] = $.isPlainObject( value ) ? $.widget.extend( {}, target[ key ], value ) : value; 486 if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 487 // Clone objects 488 if ( $.isPlainObject( value ) ) { 489 target[ key ] = $.isPlainObject( target[ key ] ) ? 490 $.widget.extend( {}, target[ key ], value ) : 491 // Don't extend strings, arrays, etc. with objects 492 $.widget.extend( {}, value ); 493 // Copy everything else by reference 494 } else { 495 target[ key ] = value; 496 } 469 497 } 470 498 } … … 474 502 475 503 $.widget.bridge = function( name, object ) { 476 var fullName = object.prototype.widgetFullName ;504 var fullName = object.prototype.widgetFullName || name; 477 505 $.fn[ name ] = function( options ) { 478 506 var isMethodCall = typeof options === "string", … … 510 538 instance.option( options || {} )._init(); 511 539 } else { 512 new object( options, this);540 $.data( this, fullName, new object( options, this ) ); 513 541 } 514 542 }); … … 519 547 }; 520 548 521 $.Widget = function( options, element) {};549 $.Widget = function( /* options, element */ ) {}; 522 550 $.Widget._childConstructors = []; 523 551 … … 551 579 $.data( element, this.widgetName, this ); 552 580 $.data( element, this.widgetFullName, this ); 553 this._on({ remove: "destroy" }); 581 this._on( true, this.element, { 582 remove: function( event ) { 583 if ( event.target === element ) { 584 this.destroy(); 585 } 586 } 587 }); 554 588 this.document = $( element.style ? 555 589 // element within the document … … 669 703 }, 670 704 671 _on: function( element, handlers ) { 705 _on: function( suppressDisabledCheck, element, handlers ) { 706 var delegateElement, 707 instance = this; 708 709 // no suppressDisabledCheck flag, shuffle arguments 710 if ( typeof suppressDisabledCheck !== "boolean" ) { 711 handlers = element; 712 element = suppressDisabledCheck; 713 suppressDisabledCheck = false; 714 } 715 672 716 // no element argument, shuffle and use this.element 673 717 if ( !handlers ) { 674 718 handlers = element; 675 719 element = this.element; 720 delegateElement = this.widget(); 676 721 } else { 677 722 // accept selectors, DOM elements 678 element = $( element );723 element = delegateElement = $( element ); 679 724 this.bindings = this.bindings.add( element ); 680 725 } 681 726 682 var instance = this;683 727 $.each( handlers, function( event, handler ) { 684 728 function handlerProxy() { … … 686 730 // - disabled as an array instead of boolean 687 731 // - disabled class as method for disabling individual parts 688 if ( instance.options.disabled === true || 689 $( this ).hasClass( "ui-state-disabled" ) ) { 732 if ( !suppressDisabledCheck && 733 ( instance.options.disabled === true || 734 $( this ).hasClass( "ui-state-disabled" ) ) ) { 690 735 return; 691 736 } … … 704 749 selector = match[2]; 705 750 if ( selector ) { 706 instance.widget().delegate( selector, eventName, handlerProxy );751 delegateElement.delegate( selector, eventName, handlerProxy ); 707 752 } else { 708 753 element.bind( eventName, handlerProxy ); … … 831 876 832 877 $.widget("ui.mouse", { 833 version: "1.9. 0",878 version: "1.9.2", 834 879 options: { 835 880 cancel: 'input,textarea,button,select,option', … … 916 961 917 962 event.preventDefault(); 918 963 919 964 mouseHandled = true; 920 965 return true; … … 923 968 _mouseMove: function(event) { 924 969 // IE mouseup check - mouseup happened when mouse was out of window 925 if ($. browser.msie && !(document.documentMode >= 9) && !event.button) {970 if ($.ui.ie && !(document.documentMode >= 9) && !event.button) { 926 971 return this._mouseUp(event); 927 972 } … … 982 1027 983 1028 $.widget("ui.sortable", $.ui.mouse, { 984 version: "1.9. 0",1029 version: "1.9.2", 985 1030 widgetEventPrefix: "sort", 986 1031 ready: false, … … 1528 1573 var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); 1529 1574 1530 for (var i=0; i < this.items.length; i++) { 1531 1575 this.items = $.grep(this.items, function (item) { 1532 1576 for (var j=0; j < list.length; j++) { 1533 if(list[j] == this.items[i].item[0])1534 this.items.splice(i,1);1577 if(list[j] == item.item[0]) 1578 return false; 1535 1579 }; 1536 1537 } ;1580 return true; 1581 }); 1538 1582 1539 1583 }, … … 1701 1745 this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); 1702 1746 this.containers[innermostIndex].containerCache.over = 1; 1703 } else if(this.currentContainer != this.containers[innermostIndex]){1747 } else { 1704 1748 1705 1749 //When entering a new container, we will find the item with the least distance and append our item near it 1706 var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; 1750 var dist = 10000; var itemWithLeastDistance = null; 1751 var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top'; 1752 var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height'; 1753 var base = this.positionAbs[posProperty] + this.offset.click[posProperty]; 1707 1754 for (var j = this.items.length - 1; j >= 0; j--) { 1708 1755 if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; 1709 var cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top; 1756 if(this.items[j].item[0] == this.currentItem[0]) continue; 1757 var cur = this.items[j].item.offset()[posProperty]; 1758 var nearBottom = false; 1759 if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ 1760 nearBottom = true; 1761 cur += this.items[j][sizeProperty]; 1762 } 1763 1710 1764 if(Math.abs(cur - base) < dist) { 1711 1765 dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; 1712 this.direction = (cur - base > 0) ? 'down' : 'up';1766 this.direction = nearBottom ? "up": "down"; 1713 1767 } 1714 1768 } … … 1788 1842 1789 1843 if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information 1790 || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $. browser.msie)) //Ugly IE fix1844 || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix 1791 1845 po = { top: 0, left: 0 }; 1792 1846 … … 2063 2117 2064 2118 $.widget( "ui.accordion", { 2065 version: "1.9. 0",2119 version: "1.9.2", 2066 2120 options: { 2067 2121 active: 0, … … 2098 2152 .hide(); 2099 2153 2100 // don't allow collapsible: false and active: false 2101 if ( !options.collapsible && options.active === false) {2154 // don't allow collapsible: false and active: false / null 2155 if ( !options.collapsible && (options.active === false || options.active == null) ) { 2102 2156 options.active = 0; 2103 2157 } … … 2114 2168 2115 2169 this._createIcons(); 2116 this.originalHeight = this.element[0].style.height;2117 2170 this.refresh(); 2118 2171 … … 2237 2290 }); 2238 2291 if ( this.options.heightStyle !== "content" ) { 2239 this.element.css( "height", this.originalHeight );2240 2292 contents.css( "height", "" ); 2241 2293 } … … 2328 2380 parent = this.element.parent(); 2329 2381 2330 this.element.css( "height", this.originalHeight );2331 2382 2332 2383 if ( heightStyle === "fill" ) { … … 2367 2418 this.headers.next() 2368 2419 .each(function() { 2369 maxHeight = Math.max( maxHeight, $( this ). height("" ).height() );2420 maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); 2370 2421 }) 2371 2422 .height( maxHeight ); 2372 }2373 2374 if ( heightStyle !== "content" ) {2375 this.element.height( this.element.height() );2376 2423 } 2377 2424 }, … … 2642 2689 }, 2643 2690 2644 _setOption: function( key , value) {2691 _setOption: function( key ) { 2645 2692 if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) { 2646 2693 this.options.heightStyle = this._mergeHeightStyle();
Note: See TracChangeset
for help on using the changeset viewer.