| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /*! jQuery UI - v1.14.2 - 2026-07-15 2 * https://jqueryui.com 3 * Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js 4 * Copyright OpenJS Foundation and other contributors; Licensed MIT */ 5 6 ( function( factory ) { 7 "use strict"; 8 9 if ( typeof define === "function" && define.amd ) { 10 11 // AMD. Register as an anonymous module. 12 define( [ "jquery" ], factory ); 13 } else { 14 15 // Browser globals 16 factory( jQuery ); 17 } 18 } )( function( $ ) { 19 "use strict"; 20 21 $.ui = $.ui || {}; 22 23 var version = $.ui.version = "1.14.2"; 24 25 26 /*! 27 * jQuery UI Widget 1.14.2 28 * https://jqueryui.com 29 * 30 * Copyright OpenJS Foundation and other contributors 31 * Released under the MIT license. 32 * https://jquery.org/license 33 */ 34 35 //>>label: Widget 36 //>>group: Core 37 //>>description: Provides a factory for creating stateful widgets with a common API. 38 //>>docs: https://api.jqueryui.com/jQuery.widget/ 39 //>>demos: https://jqueryui.com/widget/ 40 41 42 var widgetUuid = 0; 43 var widgetHasOwnProperty = Array.prototype.hasOwnProperty; 44 var widgetSlice = Array.prototype.slice; 45 46 $.cleanData = ( function( orig ) { 47 return function( elems ) { 48 var events, elem, i; 49 for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { 50 51 // Only trigger remove when necessary to save time 52 events = $._data( elem, "events" ); 53 if ( events && events.remove ) { 54 $( elem ).triggerHandler( "remove" ); 55 } 56 } 57 orig( elems ); 58 }; 59 } )( $.cleanData ); 60 61 $.widget = function( name, base, prototype ) { 62 var existingConstructor, constructor, basePrototype; 63 64 // ProxiedPrototype allows the provided prototype to remain unmodified 65 // so that it can be used as a mixin for multiple widgets (#8876) 66 var proxiedPrototype = {}; 67 68 var namespace = name.split( "." )[ 0 ]; 69 name = name.split( "." )[ 1 ]; 70 if ( name === "__proto__" || name === "constructor" ) { 71 return $.error( "Invalid widget name: " + name ); 72 } 73 var fullName = namespace + "-" + name; 74 75 if ( !prototype ) { 76 prototype = base; 77 base = $.Widget; 78 } 79 80 if ( Array.isArray( prototype ) ) { 81 prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); 82 } 83 84 // Create selector for plugin 85 $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) { 86 return !!$.data( elem, fullName ); 87 }; 88 89 $[ namespace ] = $[ namespace ] || {}; 90 existingConstructor = $[ namespace ][ name ]; 91 constructor = $[ namespace ][ name ] = function( options, element ) { 92 93 // Allow instantiation without "new" keyword 94 if ( !this || !this._createWidget ) { 95 return new constructor( options, element ); 96 } 97 98 // Allow instantiation without initializing for simple inheritance 99 // must use "new" keyword (the code above always passes args) 100 if ( arguments.length ) { 101 this._createWidget( options, element ); 102 } 103 }; 104 105 // Extend with the existing constructor to carry over any static properties 106 $.extend( constructor, existingConstructor, { 107 version: prototype.version, 108 109 // Copy the object used to create the prototype in case we need to 110 // redefine the widget later 111 _proto: $.extend( {}, prototype ), 112 113 // Track widgets that inherit from this widget in case this widget is 114 // redefined after a widget inherits from it 115 _childConstructors: [] 116 } ); 117 118 basePrototype = new base(); 119 120 // We need to make the options hash a property directly on the new instance 121 // otherwise we'll modify the options hash on the prototype that we're 122 // inheriting from 123 basePrototype.options = $.widget.extend( {}, basePrototype.options ); 124 $.each( prototype, function( prop, value ) { 125 if ( typeof value !== "function" ) { 126 proxiedPrototype[ prop ] = value; 127 return; 128 } 129 proxiedPrototype[ prop ] = ( function() { 130 function _super() { 131 return base.prototype[ prop ].apply( this, arguments ); 132 } 133 134 function _superApply( args ) { 135 return base.prototype[ prop ].apply( this, args ); 136 } 137 138 return function() { 139 var __super = this._super; 140 var __superApply = this._superApply; 141 var returnValue; 142 143 this._super = _super; 144 this._superApply = _superApply; 145 146 returnValue = value.apply( this, arguments ); 147 148 this._super = __super; 149 this._superApply = __superApply; 150 151 return returnValue; 152 }; 153 } )(); 154 } ); 155 constructor.prototype = $.widget.extend( basePrototype, { 156 157 // TODO: remove support for widgetEventPrefix 158 // always use the name + a colon as the prefix, e.g., draggable:start 159 // don't prefix for widgets that aren't DOM-based 160 widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name 161 }, proxiedPrototype, { 162 constructor: constructor, 163 namespace: namespace, 164 widgetName: name, 165 widgetFullName: fullName 166 } ); 167 168 // If this widget is being redefined then we need to find all widgets that 169 // are inheriting from it and redefine all of them so that they inherit from 170 // the new version of this widget. We're essentially trying to replace one 171 // level in the prototype chain. 172 if ( existingConstructor ) { 173 $.each( existingConstructor._childConstructors, function( i, child ) { 174 var childPrototype = child.prototype; 175 176 // Redefine the child widget using the same prototype that was 177 // originally used, but inherit from the new version of the base 178 $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, 179 child._proto ); 180 } ); 181 182 // Remove the list of existing child constructors from the old constructor 183 // so the old child constructors can be garbage collected 184 delete existingConstructor._childConstructors; 185 } else { 186 base._childConstructors.push( constructor ); 187 } 188 189 $.widget.bridge( name, constructor ); 190 191 return constructor; 192 }; 193 194 $.widget.extend = function( target ) { 195 var input = widgetSlice.call( arguments, 1 ); 196 var inputIndex = 0; 197 var inputLength = input.length; 198 var key; 199 var value; 200 201 for ( ; inputIndex < inputLength; inputIndex++ ) { 202 for ( key in input[ inputIndex ] ) { 203 value = input[ inputIndex ][ key ]; 204 if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) { 205 206 // Clone objects 207 if ( $.isPlainObject( value ) ) { 208 target[ key ] = $.isPlainObject( target[ key ] ) ? 209 $.widget.extend( {}, target[ key ], value ) : 210 211 // Don't extend strings, arrays, etc. with objects 212 $.widget.extend( {}, value ); 213 214 // Copy everything else by reference 215 } else { 216 target[ key ] = value; 217 } 218 } 219 } 220 } 221 return target; 222 }; 223 224 $.widget.bridge = function( name, object ) { 225 var fullName = object.prototype.widgetFullName || name; 226 $.fn[ name ] = function( options ) { 227 var isMethodCall = typeof options === "string"; 228 var args = widgetSlice.call( arguments, 1 ); 229 var returnValue = this; 230 231 if ( isMethodCall ) { 232 233 // If this is an empty collection, we need to have the instance method 234 // return undefined instead of the jQuery instance 235 if ( !this.length && options === "instance" ) { 236 returnValue = undefined; 237 } else { 238 this.each( function() { 239 var methodValue; 240 var instance = $.data( this, fullName ); 241 242 if ( options === "instance" ) { 243 returnValue = instance; 244 return false; 245 } 246 247 if ( !instance ) { 248 return $.error( "cannot call methods on " + name + 249 " prior to initialization; " + 250 "attempted to call method '" + options + "'" ); 251 } 252 253 if ( typeof instance[ options ] !== "function" || 254 options.charAt( 0 ) === "_" ) { 255 return $.error( "no such method '" + options + "' for " + name + 256 " widget instance" ); 257 } 258 259 methodValue = instance[ options ].apply( instance, args ); 260 261 if ( methodValue !== instance && methodValue !== undefined ) { 262 returnValue = methodValue && methodValue.jquery ? 263 returnValue.pushStack( methodValue.get() ) : 264 methodValue; 265 return false; 266 } 267 } ); 268 } 269 } else { 270 271 // Allow multiple hashes to be passed on init 272 if ( args.length ) { 273 options = $.widget.extend.apply( null, [ options ].concat( args ) ); 274 } 275 276 this.each( function() { 277 var instance = $.data( this, fullName ); 278 if ( instance ) { 279 instance.option( options || {} ); 280 if ( instance._init ) { 281 instance._init(); 282 } 283 } else { 284 $.data( this, fullName, new object( options, this ) ); 285 } 286 } ); 287 } 288 289 return returnValue; 290 }; 291 }; 292 293 $.Widget = function( /* options, element */ ) {}; 294 $.Widget._childConstructors = []; 295 296 $.Widget.prototype = { 297 widgetName: "widget", 298 widgetEventPrefix: "", 299 defaultElement: "<div>", 300 301 options: { 302 classes: {}, 303 disabled: false, 304 305 // Callbacks 306 create: null 307 }, 308 309 _createWidget: function( options, element ) { 310 element = $( element || this.defaultElement || this )[ 0 ]; 311 this.element = $( element ); 312 this.uuid = widgetUuid++; 313 this.eventNamespace = "." + this.widgetName + this.uuid; 314 315 this.bindings = $(); 316 this.hoverable = $(); 317 this.focusable = $(); 318 this.classesElementLookup = {}; 319 320 if ( element !== this ) { 321 $.data( element, this.widgetFullName, this ); 322 this._on( true, this.element, { 323 remove: function( event ) { 324 if ( event.target === element ) { 325 this.destroy(); 326 } 327 } 328 } ); 329 this.document = $( element.style ? 330 331 // Element within the document 332 element.ownerDocument : 333 334 // Element is window or document 335 element.document || element ); 336 this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); 337 } 338 339 this.options = $.widget.extend( {}, 340 this.options, 341 this._getCreateOptions(), 342 options ); 343 344 this._create(); 345 346 if ( this.options.disabled ) { 347 this._setOptionDisabled( this.options.disabled ); 348 } 349 350 this._trigger( "create", null, this._getCreateEventData() ); 351 this._init(); 352 }, 353 354 _getCreateOptions: function() { 355 return {}; 356 }, 357 358 _getCreateEventData: $.noop, 359 360 _create: $.noop, 361 362 _init: $.noop, 363 364 destroy: function() { 365 var that = this; 366 367 this._destroy(); 368 $.each( this.classesElementLookup, function( key, value ) { 369 that._removeClass( value, key ); 370 } ); 371 372 // We can probably remove the unbind calls in 2.0 373 // all event bindings should go through this._on() 374 this.element 375 .off( this.eventNamespace ) 376 .removeData( this.widgetFullName ); 377 this.widget() 378 .off( this.eventNamespace ) 379 .removeAttr( "aria-disabled" ); 380 381 // Clean up events and states 382 this.bindings.off( this.eventNamespace ); 383 }, 384 385 _destroy: $.noop, 386 387 widget: function() { 388 return this.element; 389 }, 390 391 option: function( key, value ) { 392 var options = key; 393 var parts; 394 var curOption; 395 var i; 396 397 if ( arguments.length === 0 ) { 398 399 // Don't return a reference to the internal hash 400 return $.widget.extend( {}, this.options ); 401 } 402 403 if ( typeof key === "string" ) { 404 405 // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 406 options = {}; 407 parts = key.split( "." ); 408 key = parts.shift(); 409 if ( parts.length ) { 410 curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 411 for ( i = 0; i < parts.length - 1; i++ ) { 412 curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 413 curOption = curOption[ parts[ i ] ]; 414 } 415 key = parts.pop(); 416 if ( arguments.length === 1 ) { 417 return curOption[ key ] === undefined ? null : curOption[ key ]; 418 } 419 curOption[ key ] = value; 420 } else { 421 if ( arguments.length === 1 ) { 422 return this.options[ key ] === undefined ? null : this.options[ key ]; 423 } 424 options[ key ] = value; 425 } 426 } 427 428 this._setOptions( options ); 429 430 return this; 431 }, 432 433 _setOptions: function( options ) { 434 var key; 435 436 for ( key in options ) { 437 this._setOption( key, options[ key ] ); 438 } 439 440 return this; 441 }, 442 443 _setOption: function( key, value ) { 444 if ( key === "classes" ) { 445 this._setOptionClasses( value ); 446 } 447 448 this.options[ key ] = value; 449 450 if ( key === "disabled" ) { 451 this._setOptionDisabled( value ); 452 } 453 454 return this; 455 }, 456 457 _setOptionClasses: function( value ) { 458 var classKey, elements, currentElements; 459 460 for ( classKey in value ) { 461 currentElements = this.classesElementLookup[ classKey ]; 462 if ( value[ classKey ] === this.options.classes[ classKey ] || 463 !currentElements || 464 !currentElements.length ) { 465 continue; 466 } 467 468 // We are doing this to create a new jQuery object because the _removeClass() call 469 // on the next line is going to destroy the reference to the current elements being 470 // tracked. We need to save a copy of this collection so that we can add the new classes 471 // below. 472 elements = $( currentElements.get() ); 473 this._removeClass( currentElements, classKey ); 474 475 // We don't use _addClass() here, because that uses this.options.classes 476 // for generating the string of classes. We want to use the value passed in from 477 // _setOption(), this is the new value of the classes option which was passed to 478 // _setOption(). We pass this value directly to _classes(). 479 elements.addClass( this._classes( { 480 element: elements, 481 keys: classKey, 482 classes: value, 483 add: true 484 } ) ); 485 } 486 }, 487 488 _setOptionDisabled: function( value ) { 489 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); 490 491 // If the widget is becoming disabled, then nothing is interactive 492 if ( value ) { 493 this._removeClass( this.hoverable, null, "ui-state-hover" ); 494 this._removeClass( this.focusable, null, "ui-state-focus" ); 495 } 496 }, 497 498 enable: function() { 499 return this._setOptions( { disabled: false } ); 500 }, 501 502 disable: function() { 503 return this._setOptions( { disabled: true } ); 504 }, 505 506 _classes: function( options ) { 507 var full = []; 508 var that = this; 509 510 options = $.extend( { 511 element: this.element, 512 classes: this.options.classes || {} 513 }, options ); 514 515 function bindRemoveEvent() { 516 var nodesToBind = []; 517 518 options.element.each( function( _, element ) { 519 var isTracked = $.map( that.classesElementLookup, function( elements ) { 520 return elements; 521 } ) 522 .some( function( elements ) { 523 return elements.is( element ); 524 } ); 525 526 if ( !isTracked ) { 527 nodesToBind.push( element ); 528 } 529 } ); 530 531 that._on( $( nodesToBind ), { 532 remove: "_untrackClassesElement" 533 } ); 534 } 535 536 function processClassString( classes, checkOption ) { 537 var current, i; 538 for ( i = 0; i < classes.length; i++ ) { 539 current = that.classesElementLookup[ classes[ i ] ] || $(); 540 if ( options.add ) { 541 bindRemoveEvent(); 542 current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) ); 543 } else { 544 current = $( current.not( options.element ).get() ); 545 } 546 that.classesElementLookup[ classes[ i ] ] = current; 547 full.push( classes[ i ] ); 548 if ( checkOption && options.classes[ classes[ i ] ] ) { 549 full.push( options.classes[ classes[ i ] ] ); 550 } 551 } 552 } 553 554 if ( options.keys ) { 555 processClassString( options.keys.match( /\S+/g ) || [], true ); 556 } 557 if ( options.extra ) { 558 processClassString( options.extra.match( /\S+/g ) || [] ); 559 } 560 561 return full.join( " " ); 562 }, 563 564 _untrackClassesElement: function( event ) { 565 var that = this; 566 $.each( that.classesElementLookup, function( key, value ) { 567 if ( $.inArray( event.target, value ) !== -1 ) { 568 that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); 569 } 570 } ); 571 572 this._off( $( event.target ) ); 573 }, 574 575 _removeClass: function( element, keys, extra ) { 576 return this._toggleClass( element, keys, extra, false ); 577 }, 578 579 _addClass: function( element, keys, extra ) { 580 return this._toggleClass( element, keys, extra, true ); 581 }, 582 583 _toggleClass: function( element, keys, extra, add ) { 584 add = ( typeof add === "boolean" ) ? add : extra; 585 var shift = ( typeof element === "string" || element === null ), 586 options = { 587 extra: shift ? keys : extra, 588 keys: shift ? element : keys, 589 element: shift ? this.element : element, 590 add: add 591 }; 592 options.element.toggleClass( this._classes( options ), add ); 593 return this; 594 }, 595 596 _on: function( suppressDisabledCheck, element, handlers ) { 597 var delegateElement; 598 var instance = this; 599 600 // No suppressDisabledCheck flag, shuffle arguments 601 if ( typeof suppressDisabledCheck !== "boolean" ) { 602 handlers = element; 603 element = suppressDisabledCheck; 604 suppressDisabledCheck = false; 605 } 606 607 // No element argument, shuffle and use this.element 608 if ( !handlers ) { 609 handlers = element; 610 element = this.element; 611 delegateElement = this.widget(); 612 } else { 613 element = delegateElement = $( element ); 614 this.bindings = this.bindings.add( element ); 615 } 616 617 $.each( handlers, function( event, handler ) { 618 function handlerProxy() { 619 620 // Allow widgets to customize the disabled handling 621 // - disabled as an array instead of boolean 622 // - disabled class as method for disabling individual parts 623 if ( !suppressDisabledCheck && 624 ( instance.options.disabled === true || 625 $( this ).hasClass( "ui-state-disabled" ) ) ) { 626 return; 627 } 628 return ( typeof handler === "string" ? instance[ handler ] : handler ) 629 .apply( instance, arguments ); 630 } 631 632 // Copy the guid so direct unbinding works 633 if ( typeof handler !== "string" ) { 634 handlerProxy.guid = handler.guid = 635 handler.guid || handlerProxy.guid || $.guid++; 636 } 637 638 var match = event.match( /^([\w:-]*)\s*(.*)$/ ); 639 var eventName = match[ 1 ] + instance.eventNamespace; 640 var selector = match[ 2 ]; 641 642 if ( selector ) { 643 delegateElement.on( eventName, selector, handlerProxy ); 644 } else { 645 element.on( eventName, handlerProxy ); 646 } 647 } ); 648 }, 649 650 _off: function( element, eventName ) { 651 eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + 652 this.eventNamespace; 653 element.off( eventName ); 654 655 // Clear the stack to avoid memory leaks (#10056) 656 this.bindings = $( this.bindings.not( element ).get() ); 657 this.focusable = $( this.focusable.not( element ).get() ); 658 this.hoverable = $( this.hoverable.not( element ).get() ); 659 }, 660 661 _delay: function( handler, delay ) { 662 function handlerProxy() { 663 return ( typeof handler === "string" ? instance[ handler ] : handler ) 664 .apply( instance, arguments ); 665 } 666 var instance = this; 667 return setTimeout( handlerProxy, delay || 0 ); 668 }, 669 670 _hoverable: function( element ) { 671 this.hoverable = this.hoverable.add( element ); 672 this._on( element, { 673 mouseenter: function( event ) { 674 this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); 675 }, 676 mouseleave: function( event ) { 677 this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); 678 } 679 } ); 680 }, 681 682 _focusable: function( element ) { 683 this.focusable = this.focusable.add( element ); 684 this._on( element, { 685 focusin: function( event ) { 686 this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); 687 }, 688 focusout: function( event ) { 689 this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); 690 } 691 } ); 692 }, 693 694 _trigger: function( type, event, data ) { 695 var prop, orig; 696 var callback = this.options[ type ]; 697 698 data = data || {}; 699 event = $.Event( event ); 700 event.type = ( type === this.widgetEventPrefix ? 701 type : 702 this.widgetEventPrefix + type ).toLowerCase(); 703 704 // The original event may come from any element 705 // so we need to reset the target on the new event 706 event.target = this.element[ 0 ]; 707 708 // Copy original event properties over to the new event 709 orig = event.originalEvent; 710 if ( orig ) { 711 for ( prop in orig ) { 712 if ( !( prop in event ) ) { 713 event[ prop ] = orig[ prop ]; 714 } 715 } 716 } 717 718 this.element.trigger( event, data ); 719 return !( typeof callback === "function" && 720 callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || 721 event.isDefaultPrevented() ); 722 } 723 }; 724 725 $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 726 $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 727 if ( typeof options === "string" ) { 728 options = { effect: options }; 729 } 730 731 var hasOptions; 732 var effectName = !options ? 733 method : 734 options === true || typeof options === "number" ? 735 defaultEffect : 736 options.effect || defaultEffect; 737 738 options = options || {}; 739 if ( typeof options === "number" ) { 740 options = { duration: options }; 741 } else if ( options === true ) { 742 options = {}; 743 } 744 745 hasOptions = !$.isEmptyObject( options ); 746 options.complete = callback; 747 748 if ( options.delay ) { 749 element.delay( options.delay ); 750 } 751 752 if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 753 element[ method ]( options ); 754 } else if ( effectName !== method && element[ effectName ] ) { 755 element[ effectName ]( options.duration, options.easing, callback ); 756 } else { 757 element.queue( function( next ) { 758 $( this )[ method ](); 759 if ( callback ) { 760 callback.call( element[ 0 ] ); 761 } 762 next(); 763 } ); 764 } 765 }; 766 } ); 767 768 var widget = $.widget; 769 770 771 /*! 772 * jQuery UI Position 1.14.2 773 * https://jqueryui.com 774 * 775 * Copyright OpenJS Foundation and other contributors 776 * Released under the MIT license. 777 * https://jquery.org/license 778 * 779 * https://api.jqueryui.com/position/ 780 */ 781 782 //>>label: Position 783 //>>group: Core 784 //>>description: Positions elements relative to other elements. 785 //>>docs: https://api.jqueryui.com/position/ 786 //>>demos: https://jqueryui.com/position/ 787 788 789 ( function() { 790 var cachedScrollbarWidth, 791 max = Math.max, 792 abs = Math.abs, 793 rhorizontal = /left|center|right/, 794 rvertical = /top|center|bottom/, 795 roffset = /[\+\-]\d+(\.[\d]+)?%?/, 796 rposition = /^\w+/, 797 rpercent = /%$/, 798 _position = $.fn.position; 799 800 function getOffsets( offsets, width, height ) { 801 return [ 802 parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), 803 parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) 804 ]; 805 } 806 807 function parseCss( element, property ) { 808 return parseInt( $.css( element, property ), 10 ) || 0; 809 } 810 811 function isWindow( obj ) { 812 return obj != null && obj === obj.window; 813 } 814 815 function getDimensions( elem ) { 816 var raw = elem[ 0 ]; 817 if ( raw.nodeType === 9 ) { 818 return { 819 width: elem.width(), 820 height: elem.height(), 821 offset: { top: 0, left: 0 } 822 }; 823 } 824 if ( isWindow( raw ) ) { 825 return { 826 width: elem.width(), 827 height: elem.height(), 828 offset: { top: elem.scrollTop(), left: elem.scrollLeft() } 829 }; 830 } 831 if ( raw.preventDefault ) { 832 return { 833 width: 0, 834 height: 0, 835 offset: { top: raw.pageY, left: raw.pageX } 836 }; 837 } 838 return { 839 width: elem.outerWidth(), 840 height: elem.outerHeight(), 841 offset: elem.offset() 842 }; 843 } 844 845 $.position = { 846 scrollbarWidth: function() { 847 if ( cachedScrollbarWidth !== undefined ) { 848 return cachedScrollbarWidth; 849 } 850 var w1, w2, 851 div = $( "<div style=" + 852 "'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>" + 853 "<div style='height:300px;width:auto;'></div></div>" ), 854 innerDiv = div.children()[ 0 ]; 855 856 $( "body" ).append( div ); 857 w1 = innerDiv.offsetWidth; 858 div.css( "overflow", "scroll" ); 859 860 w2 = innerDiv.offsetWidth; 861 862 if ( w1 === w2 ) { 863 w2 = div[ 0 ].clientWidth; 864 } 865 866 div.remove(); 867 868 return ( cachedScrollbarWidth = w1 - w2 ); 869 }, 870 getScrollInfo: function( within ) { 871 var overflowX = within.isWindow || within.isDocument ? "" : 872 within.element.css( "overflow-x" ), 873 overflowY = within.isWindow || within.isDocument ? "" : 874 within.element.css( "overflow-y" ), 875 hasOverflowX = overflowX === "scroll" || 876 ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), 877 hasOverflowY = overflowY === "scroll" || 878 ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); 879 return { 880 width: hasOverflowY ? $.position.scrollbarWidth() : 0, 881 height: hasOverflowX ? $.position.scrollbarWidth() : 0 882 }; 883 }, 884 getWithinInfo: function( element ) { 885 var withinElement = $( element || window ), 886 isElemWindow = isWindow( withinElement[ 0 ] ), 887 isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, 888 hasOffset = !isElemWindow && !isDocument; 889 return { 890 element: withinElement, 891 isWindow: isElemWindow, 892 isDocument: isDocument, 893 offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, 894 scrollLeft: withinElement.scrollLeft(), 895 scrollTop: withinElement.scrollTop(), 896 width: withinElement.outerWidth(), 897 height: withinElement.outerHeight() 898 }; 899 } 900 }; 901 902 $.fn.position = function( options ) { 903 if ( !options || !options.of ) { 904 return _position.apply( this, arguments ); 905 } 906 907 // Make a copy, we don't want to modify arguments 908 options = $.extend( {}, options ); 909 910 var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, 911 912 // Make sure string options are treated as CSS selectors 913 target = typeof options.of === "string" ? 914 $( document ).find( options.of ) : 915 $( options.of ), 916 917 within = $.position.getWithinInfo( options.within ), 918 scrollInfo = $.position.getScrollInfo( within ), 919 collision = ( options.collision || "flip" ).split( " " ), 920 offsets = {}; 921 922 dimensions = getDimensions( target ); 923 if ( target[ 0 ].preventDefault ) { 924 925 // Force left top to allow flipping 926 options.at = "left top"; 927 } 928 targetWidth = dimensions.width; 929 targetHeight = dimensions.height; 930 targetOffset = dimensions.offset; 931 932 // Clone to reuse original targetOffset later 933 basePosition = $.extend( {}, targetOffset ); 934 935 // Force my and at to have valid horizontal and vertical positions 936 // if a value is missing or invalid, it will be converted to center 937 $.each( [ "my", "at" ], function() { 938 var pos = ( options[ this ] || "" ).split( " " ), 939 horizontalOffset, 940 verticalOffset; 941 942 if ( pos.length === 1 ) { 943 pos = rhorizontal.test( pos[ 0 ] ) ? 944 pos.concat( [ "center" ] ) : 945 rvertical.test( pos[ 0 ] ) ? 946 [ "center" ].concat( pos ) : 947 [ "center", "center" ]; 948 } 949 pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; 950 pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; 951 952 // Calculate offsets 953 horizontalOffset = roffset.exec( pos[ 0 ] ); 954 verticalOffset = roffset.exec( pos[ 1 ] ); 955 offsets[ this ] = [ 956 horizontalOffset ? horizontalOffset[ 0 ] : 0, 957 verticalOffset ? verticalOffset[ 0 ] : 0 958 ]; 959 960 // Reduce to just the positions without the offsets 961 options[ this ] = [ 962 rposition.exec( pos[ 0 ] )[ 0 ], 963 rposition.exec( pos[ 1 ] )[ 0 ] 964 ]; 965 } ); 966 967 // Normalize collision option 968 if ( collision.length === 1 ) { 969 collision[ 1 ] = collision[ 0 ]; 970 } 971 972 if ( options.at[ 0 ] === "right" ) { 973 basePosition.left += targetWidth; 974 } else if ( options.at[ 0 ] === "center" ) { 975 basePosition.left += targetWidth / 2; 976 } 977 978 if ( options.at[ 1 ] === "bottom" ) { 979 basePosition.top += targetHeight; 980 } else if ( options.at[ 1 ] === "center" ) { 981 basePosition.top += targetHeight / 2; 982 } 983 984 atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); 985 basePosition.left += atOffset[ 0 ]; 986 basePosition.top += atOffset[ 1 ]; 987 988 return this.each( function() { 989 var collisionPosition, using, 990 elem = $( this ), 991 elemWidth = elem.outerWidth(), 992 elemHeight = elem.outerHeight(), 993 marginLeft = parseCss( this, "marginLeft" ), 994 marginTop = parseCss( this, "marginTop" ), 995 collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + 996 scrollInfo.width, 997 collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + 998 scrollInfo.height, 999 position = $.extend( {}, basePosition ), 1000 myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); 1001 1002 if ( options.my[ 0 ] === "right" ) { 1003 position.left -= elemWidth; 1004 } else if ( options.my[ 0 ] === "center" ) { 1005 position.left -= elemWidth / 2; 1006 } 1007 1008 if ( options.my[ 1 ] === "bottom" ) { 1009 position.top -= elemHeight; 1010 } else if ( options.my[ 1 ] === "center" ) { 1011 position.top -= elemHeight / 2; 1012 } 1013 1014 position.left += myOffset[ 0 ]; 1015 position.top += myOffset[ 1 ]; 1016 1017 collisionPosition = { 1018 marginLeft: marginLeft, 1019 marginTop: marginTop 1020 }; 1021 1022 $.each( [ "left", "top" ], function( i, dir ) { 1023 if ( $.ui.position[ collision[ i ] ] ) { 1024 $.ui.position[ collision[ i ] ][ dir ]( position, { 1025 targetWidth: targetWidth, 1026 targetHeight: targetHeight, 1027 elemWidth: elemWidth, 1028 elemHeight: elemHeight, 1029 collisionPosition: collisionPosition, 1030 collisionWidth: collisionWidth, 1031 collisionHeight: collisionHeight, 1032 offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], 1033 my: options.my, 1034 at: options.at, 1035 within: within, 1036 elem: elem 1037 } ); 1038 } 1039 } ); 1040 1041 if ( options.using ) { 1042 1043 // Adds feedback as second argument to using callback, if present 1044 using = function( props ) { 1045 var left = targetOffset.left - position.left, 1046 right = left + targetWidth - elemWidth, 1047 top = targetOffset.top - position.top, 1048 bottom = top + targetHeight - elemHeight, 1049 feedback = { 1050 target: { 1051 element: target, 1052 left: targetOffset.left, 1053 top: targetOffset.top, 1054 width: targetWidth, 1055 height: targetHeight 1056 }, 1057 element: { 1058 element: elem, 1059 left: position.left, 1060 top: position.top, 1061 width: elemWidth, 1062 height: elemHeight 1063 }, 1064 horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", 1065 vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" 1066 }; 1067 if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { 1068 feedback.horizontal = "center"; 1069 } 1070 if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { 1071 feedback.vertical = "middle"; 1072 } 1073 if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { 1074 feedback.important = "horizontal"; 1075 } else { 1076 feedback.important = "vertical"; 1077 } 1078 options.using.call( this, props, feedback ); 1079 }; 1080 } 1081 1082 elem.offset( $.extend( position, { using: using } ) ); 1083 } ); 1084 }; 1085 1086 $.ui.position = { 1087 fit: { 1088 left: function( position, data ) { 1089 var within = data.within, 1090 withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, 1091 outerWidth = within.width, 1092 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1093 overLeft = withinOffset - collisionPosLeft, 1094 overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, 1095 newOverRight; 1096 1097 // Element is wider than within 1098 if ( data.collisionWidth > outerWidth ) { 1099 1100 // Element is initially over the left side of within 1101 if ( overLeft > 0 && overRight <= 0 ) { 1102 newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - 1103 withinOffset; 1104 position.left += overLeft - newOverRight; 1105 1106 // Element is initially over right side of within 1107 } else if ( overRight > 0 && overLeft <= 0 ) { 1108 position.left = withinOffset; 1109 1110 // Element is initially over both left and right sides of within 1111 } else { 1112 if ( overLeft > overRight ) { 1113 position.left = withinOffset + outerWidth - data.collisionWidth; 1114 } else { 1115 position.left = withinOffset; 1116 } 1117 } 1118 1119 // Too far left -> align with left edge 1120 } else if ( overLeft > 0 ) { 1121 position.left += overLeft; 1122 1123 // Too far right -> align with right edge 1124 } else if ( overRight > 0 ) { 1125 position.left -= overRight; 1126 1127 // Adjust based on position and margin 1128 } else { 1129 position.left = max( position.left - collisionPosLeft, position.left ); 1130 } 1131 }, 1132 top: function( position, data ) { 1133 var within = data.within, 1134 withinOffset = within.isWindow ? within.scrollTop : within.offset.top, 1135 outerHeight = data.within.height, 1136 collisionPosTop = position.top - data.collisionPosition.marginTop, 1137 overTop = withinOffset - collisionPosTop, 1138 overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, 1139 newOverBottom; 1140 1141 // Element is taller than within 1142 if ( data.collisionHeight > outerHeight ) { 1143 1144 // Element is initially over the top of within 1145 if ( overTop > 0 && overBottom <= 0 ) { 1146 newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - 1147 withinOffset; 1148 position.top += overTop - newOverBottom; 1149 1150 // Element is initially over bottom of within 1151 } else if ( overBottom > 0 && overTop <= 0 ) { 1152 position.top = withinOffset; 1153 1154 // Element is initially over both top and bottom of within 1155 } else { 1156 if ( overTop > overBottom ) { 1157 position.top = withinOffset + outerHeight - data.collisionHeight; 1158 } else { 1159 position.top = withinOffset; 1160 } 1161 } 1162 1163 // Too far up -> align with top 1164 } else if ( overTop > 0 ) { 1165 position.top += overTop; 1166 1167 // Too far down -> align with bottom edge 1168 } else if ( overBottom > 0 ) { 1169 position.top -= overBottom; 1170 1171 // Adjust based on position and margin 1172 } else { 1173 position.top = max( position.top - collisionPosTop, position.top ); 1174 } 1175 } 1176 }, 1177 flip: { 1178 left: function( position, data ) { 1179 var within = data.within, 1180 withinOffset = within.offset.left + within.scrollLeft, 1181 outerWidth = within.width, 1182 offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, 1183 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1184 overLeft = collisionPosLeft - offsetLeft, 1185 overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, 1186 myOffset = data.my[ 0 ] === "left" ? 1187 -data.elemWidth : 1188 data.my[ 0 ] === "right" ? 1189 data.elemWidth : 1190 0, 1191 atOffset = data.at[ 0 ] === "left" ? 1192 data.targetWidth : 1193 data.at[ 0 ] === "right" ? 1194 -data.targetWidth : 1195 0, 1196 offset = -2 * data.offset[ 0 ], 1197 newOverRight, 1198 newOverLeft; 1199 1200 if ( overLeft < 0 ) { 1201 newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - 1202 outerWidth - withinOffset; 1203 if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { 1204 position.left += myOffset + atOffset + offset; 1205 } 1206 } else if ( overRight > 0 ) { 1207 newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + 1208 atOffset + offset - offsetLeft; 1209 if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { 1210 position.left += myOffset + atOffset + offset; 1211 } 1212 } 1213 }, 1214 top: function( position, data ) { 1215 var within = data.within, 1216 withinOffset = within.offset.top + within.scrollTop, 1217 outerHeight = within.height, 1218 offsetTop = within.isWindow ? within.scrollTop : within.offset.top, 1219 collisionPosTop = position.top - data.collisionPosition.marginTop, 1220 overTop = collisionPosTop - offsetTop, 1221 overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, 1222 top = data.my[ 1 ] === "top", 1223 myOffset = top ? 1224 -data.elemHeight : 1225 data.my[ 1 ] === "bottom" ? 1226 data.elemHeight : 1227 0, 1228 atOffset = data.at[ 1 ] === "top" ? 1229 data.targetHeight : 1230 data.at[ 1 ] === "bottom" ? 1231 -data.targetHeight : 1232 0, 1233 offset = -2 * data.offset[ 1 ], 1234 newOverTop, 1235 newOverBottom; 1236 if ( overTop < 0 ) { 1237 newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - 1238 outerHeight - withinOffset; 1239 if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { 1240 position.top += myOffset + atOffset + offset; 1241 } 1242 } else if ( overBottom > 0 ) { 1243 newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + 1244 offset - offsetTop; 1245 if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { 1246 position.top += myOffset + atOffset + offset; 1247 } 1248 } 1249 } 1250 }, 1251 flipfit: { 1252 left: function() { 1253 $.ui.position.flip.left.apply( this, arguments ); 1254 $.ui.position.fit.left.apply( this, arguments ); 1255 }, 1256 top: function() { 1257 $.ui.position.flip.top.apply( this, arguments ); 1258 $.ui.position.fit.top.apply( this, arguments ); 1259 } 1260 } 1261 }; 1262 1263 } )(); 1264 1265 var position = $.ui.position; 1266 1267 1268 /*! 1269 * jQuery UI :data 1.14.2 1270 * https://jqueryui.com 1271 * 1272 * Copyright OpenJS Foundation and other contributors 1273 * Released under the MIT license. 1274 * https://jquery.org/license 1275 */ 1276 1277 //>>label: :data Selector 1278 //>>group: Core 1279 //>>description: Selects elements which have data stored under the specified key. 1280 //>>docs: https://api.jqueryui.com/data-selector/ 1281 1282 1283 var data = $.extend( $.expr.pseudos, { 1284 data: $.expr.createPseudo( function( dataName ) { 1285 return function( elem ) { 1286 return !!$.data( elem, dataName ); 1287 }; 1288 } ) 1289 } ); 1290 1291 /*! 1292 * jQuery UI Disable Selection 1.14.2 1293 * https://jqueryui.com 1294 * 1295 * Copyright OpenJS Foundation and other contributors 1296 * Released under the MIT license. 1297 * https://jquery.org/license 1298 */ 1299 1300 //>>label: disableSelection 1301 //>>group: Core 1302 //>>description: Disable selection of text content within the set of matched elements. 1303 //>>docs: https://api.jqueryui.com/disableSelection/ 1304 1305 // This file is deprecated 1306 1307 var disableSelection = $.fn.extend( { 1308 disableSelection: ( function() { 1309 var eventType = "onselectstart" in document.createElement( "div" ) ? 1310 "selectstart" : 1311 "mousedown"; 1312 1313 return function() { 1314 return this.on( eventType + ".ui-disableSelection", function( event ) { 1315 event.preventDefault(); 1316 } ); 1317 }; 1318 } )(), 1319 1320 enableSelection: function() { 1321 return this.off( ".ui-disableSelection" ); 1322 } 1323 } ); 1324 1325 1326 /*! 1327 * jQuery UI Focusable 1.14.2 1328 * https://jqueryui.com 1329 * 1330 * Copyright OpenJS Foundation and other contributors 1331 * Released under the MIT license. 1332 * https://jquery.org/license 1333 */ 1334 1335 //>>label: :focusable Selector 1336 //>>group: Core 1337 //>>description: Selects elements which can be focused. 1338 //>>docs: https://api.jqueryui.com/focusable-selector/ 1339 1340 1341 // Selectors 1342 $.ui.focusable = function( element, hasTabindex ) { 1343 var map, mapName, img, focusableIfVisible, fieldset, 1344 nodeName = element.nodeName.toLowerCase(); 1345 1346 if ( "area" === nodeName ) { 1347 map = element.parentNode; 1348 mapName = map.name; 1349 if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 1350 return false; 1351 } 1352 img = $( "img[usemap='#" + mapName + "']" ); 1353 return img.length > 0 && img.is( ":visible" ); 1354 } 1355 1356 if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) { 1357 focusableIfVisible = !element.disabled; 1358 1359 if ( focusableIfVisible ) { 1360 1361 // Form controls within a disabled fieldset are disabled. 1362 // However, controls within the fieldset's legend do not get disabled. 1363 // Since controls generally aren't placed inside legends, we skip 1364 // this portion of the check. 1365 fieldset = $( element ).closest( "fieldset" )[ 0 ]; 1366 if ( fieldset ) { 1367 focusableIfVisible = !fieldset.disabled; 1368 } 1369 } 1370 } else if ( "a" === nodeName ) { 1371 focusableIfVisible = element.href || hasTabindex; 1372 } else { 1373 focusableIfVisible = hasTabindex; 1374 } 1375 1376 return focusableIfVisible && $( element ).is( ":visible" ) && 1377 $( element ).css( "visibility" ) === "visible"; 1378 }; 1379 1380 $.extend( $.expr.pseudos, { 1381 focusable: function( element ) { 1382 return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); 1383 } 1384 } ); 1385 1386 var focusable = $.ui.focusable; 1387 1388 1389 /*! 1390 * jQuery UI Form Reset Mixin 1.14.2 1391 * https://jqueryui.com 1392 * 1393 * Copyright OpenJS Foundation and other contributors 1394 * Released under the MIT license. 1395 * https://jquery.org/license 1396 */ 1397 1398 //>>label: Form Reset Mixin 1399 //>>group: Core 1400 //>>description: Refresh input widgets when their form is reset 1401 //>>docs: https://api.jqueryui.com/form-reset-mixin/ 1402 1403 1404 var formResetMixin = $.ui.formResetMixin = { 1405 _formResetHandler: function() { 1406 var form = $( this ); 1407 1408 // Wait for the form reset to actually happen before refreshing 1409 setTimeout( function() { 1410 var instances = form.data( "ui-form-reset-instances" ); 1411 $.each( instances, function() { 1412 this.refresh(); 1413 } ); 1414 } ); 1415 }, 1416 1417 _bindFormResetHandler: function() { 1418 this.form = $( this.element.prop( "form" ) ); 1419 if ( !this.form.length ) { 1420 return; 1421 } 1422 1423 var instances = this.form.data( "ui-form-reset-instances" ) || []; 1424 if ( !instances.length ) { 1425 1426 // We don't use _on() here because we use a single event handler per form 1427 this.form.on( "reset.ui-form-reset", this._formResetHandler ); 1428 } 1429 instances.push( this ); 1430 this.form.data( "ui-form-reset-instances", instances ); 1431 }, 1432 1433 _unbindFormResetHandler: function() { 1434 if ( !this.form.length ) { 1435 return; 1436 } 1437 1438 var instances = this.form.data( "ui-form-reset-instances" ); 1439 instances.splice( $.inArray( this, instances ), 1 ); 1440 if ( instances.length ) { 1441 this.form.data( "ui-form-reset-instances", instances ); 1442 } else { 1443 this.form 1444 .removeData( "ui-form-reset-instances" ) 1445 .off( "reset.ui-form-reset" ); 1446 } 1447 } 1448 }; 1449 1450 1451 /*! 1452 * jQuery UI Legacy jQuery Core patches 1.14.2 1453 * https://jqueryui.com 1454 * 1455 * Copyright OpenJS Foundation and other contributors 1456 * Released under the MIT license. 1457 * https://jquery.org/license 1458 * 1459 */ 1460 1461 //>>label: Legacy jQuery Core patches 1462 //>>group: Core 1463 //>>description: Backport `.even()`, `.odd()` and `$.escapeSelector` to older jQuery Core versions (deprecated) 1464 1465 1466 // Support: jQuery 2.2.x or older. 1467 // This method has been defined in jQuery 3.0.0. 1468 // Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js 1469 if ( !$.escapeSelector ) { 1470 $.escapeSelector = function( id ) { 1471 return CSS.escape( id + "" ); 1472 }; 1473 } 1474 1475 // Support: jQuery 3.4.x or older 1476 // These methods have been defined in jQuery 3.5.0. 1477 if ( !$.fn.even || !$.fn.odd ) { 1478 $.fn.extend( { 1479 even: function() { 1480 return this.filter( function( i ) { 1481 return i % 2 === 0; 1482 } ); 1483 }, 1484 odd: function() { 1485 return this.filter( function( i ) { 1486 return i % 2 === 1; 1487 } ); 1488 } 1489 } ); 1490 } 1491 1492 ; 1493 /*! 1494 * jQuery UI Keycode 1.14.2 1495 * https://jqueryui.com 1496 * 1497 * Copyright OpenJS Foundation and other contributors 1498 * Released under the MIT license. 1499 * https://jquery.org/license 1500 */ 1501 1502 //>>label: Keycode 1503 //>>group: Core 1504 //>>description: Provide keycodes as keynames 1505 //>>docs: https://api.jqueryui.com/jQuery.ui.keyCode/ 1506 1507 1508 var keycode = $.ui.keyCode = { 1509 BACKSPACE: 8, 1510 COMMA: 188, 1511 DELETE: 46, 1512 DOWN: 40, 1513 END: 35, 1514 ENTER: 13, 1515 ESCAPE: 27, 1516 HOME: 36, 1517 LEFT: 37, 1518 PAGE_DOWN: 34, 1519 PAGE_UP: 33, 1520 PERIOD: 190, 1521 RIGHT: 39, 1522 SPACE: 32, 1523 TAB: 9, 1524 UP: 38 1525 }; 1526 1527 1528 /*! 1529 * jQuery UI Labels 1.14.2 1530 * https://jqueryui.com 1531 * 1532 * Copyright OpenJS Foundation and other contributors 1533 * Released under the MIT license. 1534 * https://jquery.org/license 1535 */ 1536 1537 //>>label: labels 1538 //>>group: Core 1539 //>>description: Find all the labels associated with a given input 1540 //>>docs: https://api.jqueryui.com/labels/ 1541 1542 1543 var labels = $.fn.labels = function() { 1544 var ancestor, selector, id, labels, ancestors; 1545 1546 if ( !this.length ) { 1547 return this.pushStack( [] ); 1548 } 1549 1550 // Check control.labels first 1551 if ( this[ 0 ].labels && this[ 0 ].labels.length ) { 1552 return this.pushStack( this[ 0 ].labels ); 1553 } 1554 1555 // If `control.labels` is empty - e.g. inside of document fragments - find 1556 // the labels manually 1557 labels = this.eq( 0 ).parents( "label" ); 1558 1559 // Look for the label based on the id 1560 id = this.attr( "id" ); 1561 if ( id ) { 1562 1563 // We don't search against the document in case the element 1564 // is disconnected from the DOM 1565 ancestor = this.eq( 0 ).parents().last(); 1566 1567 // Get a full set of top level ancestors 1568 ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); 1569 1570 // Create a selector for the label based on the id 1571 selector = "label[for='" + CSS.escape( id ) + "']"; 1572 1573 labels = labels.add( ancestors.find( selector ).addBack( selector ) ); 1574 1575 } 1576 1577 // Return whatever we have found for labels 1578 return this.pushStack( labels ); 1579 }; 1580 1581 1582 /*! 1583 * jQuery UI Scroll Parent 1.14.2 1584 * https://jqueryui.com 1585 * 1586 * Copyright OpenJS Foundation and other contributors 1587 * Released under the MIT license. 1588 * https://jquery.org/license 1589 */ 1590 1591 //>>label: scrollParent 1592 //>>group: Core 1593 //>>description: Get the closest ancestor element that is scrollable. 1594 //>>docs: https://api.jqueryui.com/scrollParent/ 1595 1596 1597 var scrollParent = $.fn.scrollParent = function( includeHidden ) { 1598 var position = this.css( "position" ), 1599 excludeStaticParent = position === "absolute", 1600 overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, 1601 scrollParent = this.parents().filter( function() { 1602 var parent = $( this ); 1603 if ( excludeStaticParent && parent.css( "position" ) === "static" ) { 1604 return false; 1605 } 1606 return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + 1607 parent.css( "overflow-x" ) ); 1608 } ).eq( 0 ); 1609 1610 return position === "fixed" || !scrollParent.length ? 1611 $( this[ 0 ].ownerDocument || document ) : 1612 scrollParent; 1613 }; 1614 1615 1616 /*! 1617 * jQuery UI Tabbable 1.14.2 1618 * https://jqueryui.com 1619 * 1620 * Copyright OpenJS Foundation and other contributors 1621 * Released under the MIT license. 1622 * https://jquery.org/license 1623 */ 1624 1625 //>>label: :tabbable Selector 1626 //>>group: Core 1627 //>>description: Selects elements which can be tabbed to. 1628 //>>docs: https://api.jqueryui.com/tabbable-selector/ 1629 1630 1631 var tabbable = $.extend( $.expr.pseudos, { 1632 tabbable: function( element ) { 1633 var tabIndex = $.attr( element, "tabindex" ), 1634 hasTabindex = tabIndex != null; 1635 return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex ); 1636 } 1637 } ); 1638 1639 1640 /*! 1641 * jQuery UI Unique ID 1.14.2 1642 * https://jqueryui.com 1643 * 1644 * Copyright OpenJS Foundation and other contributors 1645 * Released under the MIT license. 1646 * https://jquery.org/license 1647 */ 1648 1649 //>>label: uniqueId 1650 //>>group: Core 1651 //>>description: Functions to generate and remove uniqueId's 1652 //>>docs: https://api.jqueryui.com/uniqueId/ 1653 1654 1655 var uniqueId = $.fn.extend( { 1656 uniqueId: ( function() { 1657 var uuid = 0; 1658 1659 return function() { 1660 return this.each( function() { 1661 if ( !this.id ) { 1662 this.id = "ui-id-" + ( ++uuid ); 1663 } 1664 } ); 1665 }; 1666 } )(), 1667 1668 removeUniqueId: function() { 1669 return this.each( function() { 1670 if ( /^ui-id-\d+$/.test( this.id ) ) { 1671 $( this ).removeAttr( "id" ); 1672 } 1673 } ); 1674 } 1675 } ); 1676 1677 // This is copied from https://github.com/jquery/jquery-ui/blob/1.14.2/ui/plugin.js 1678 // $.ui.plugin is deprecated. Use $.widget() extensions instead. 1679 $.ui.plugin = { 1680 add: function( module, option, set ) { 1681 var i, 1682 proto = $.ui[ module ].prototype; 1683 for ( i in set ) { 1684 proto.plugins[ i ] = proto.plugins[ i ] || []; 1685 proto.plugins[ i ].push( [ option, set[ i ] ] ); 1686 } 1687 }, 1688 call: function( instance, name, args, allowDisconnected ) { 1689 var i, 1690 set = instance.plugins[ name ]; 1691 1692 if ( !set ) { 1693 return; 1694 } 1695 1696 if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || 1697 instance.element[ 0 ].parentNode.nodeType === 11 ) ) { 1698 return; 1699 } 1700 1701 for ( i = 0; i < set.length; i++ ) { 1702 if ( instance.options[ set[ i ][ 0 ] ] ) { 1703 set[ i ][ 1 ].apply( instance.element, args ); 1704 } 1705 } 1706 } 1707 }; 1708 1709 } );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Fri Jul 24 08:20:19 2026 | Cross-referenced by PHPXref |