1/*! jQuery UI - v1.11.4 - 2016-01-06 2* http://jqueryui.com 3* Includes: core.js, widget.js, mouse.js, position.js, tabs.js, effect.js, effect-fade.js, effect-slide.js 4* Copyright
vendor: 44,288 bytes, lines 4-1553
4 jQuery Foundation and other contributors; Licensed MIT */ 5 6(function( factory ) { 7 if ( typeof define === "function" && define.amd ) { 8 9 // AMD. Register as an anonymous module. 10 define([ "jquery" ], factory ); 11 } else { 12 13 // Browser globals 14 factory( jQuery ); 15 } 16}(function( $ ) { 17/*! 18 * jQuery UI Core 1.11.4 19 * http://jqueryui.com 20 * 21 * Copyright jQuery Foundation and other contributors 22 * Released under the MIT license. 23 * http://jquery.org/license 24 * 25 * http://api.jqueryui.com/category/ui-core/ 26 */ 27 28 29// $.ui might exist from components with no dependencies, e.g., $.ui.position 30$.ui = $.ui || {}; 31 32$.extend( $.ui, { 33 version: "1.11.4", 34 35 keyCode: { 36 BACKSPACE: 8, 37 COMMA: 188, 38 DELETE: 46, 39 DOWN: 40, 40 END: 35, 41 ENTER: 13, 42 ESCAPE: 27, 43 HOME: 36, 44 LEFT: 37, 45 PAGE_DOWN: 34, 46 PAGE_UP: 33, 47 PERIOD: 190, 48 RIGHT: 39, 49 SPACE: 32, 50 TAB: 9, 51 UP: 38 52 } 53}); 54 55// plugins 56$.fn.extend({ 57 scrollParent: function( includeHidden ) { 58 var position = this.css( "position" ), 59 excludeStaticParent = position === "absolute", 60 overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, 61 scrollParent = this.parents().filter( function() { 62 var parent = $( this ); 63 if ( excludeStaticParent && parent.css( "position" ) === "static" ) { 64 return false; 65 } 66 return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); 67 }).eq( 0 ); 68 69 return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; 70 }, 71 72 uniqueId: (function() { 73 var uuid = 0; 74 75 return function() { 76 return this.each(function() { 77 if ( !this.id ) { 78 this.id = "ui-id-" + ( ++uuid ); 79 } 80 }); 81 }; 82 })(), 83 84 removeUniqueId: function() { 85 return this.each(function() { 86 if ( /^ui-id-\d+$/.test( this.id ) ) { 87 $( this ).removeAttr( "id" ); 88 } 89 }); 90 } 91}); 92 93// selectors 94function focusable( element, isTabIndexNotNaN ) { 95 var map, mapName, img, 96 nodeName = element.nodeName.toLowerCase(); 97 if ( "area" === nodeName ) { 98 map = element.parentNode; 99 mapName = map.name; 100 if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 101 return false; 102 } 103 img = $( "img[usemap='#" + mapName + "']" )[ 0 ]; 104 return !!img && visible( img ); 105 } 106 return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ? 107 !element.disabled : 108 "a" === nodeName ? 109 element.href || isTabIndexNotNaN : 110 isTabIndexNotNaN) && 111 // the element and all of its ancestors must be visible 112 visible( element ); 113} 114 115function visible( element ) { 116 return $.expr.filters.visible( element ) && 117 !$( element ).parents().addBack().filter(function() { 118 return $.css( this, "visibility" ) === "hidden"; 119 }).length; 120} 121 122$.extend( $.expr[ ":" ], { 123 data: $.expr.createPseudo ? 124 $.expr.createPseudo(function( dataName ) { 125 return function( elem ) { 126 return !!$.data( elem, dataName ); 127 }; 128 }) : 129 // support: jQuery <1.8 130 function( elem, i, match ) { 131 return !!$.data( elem, match[ 3 ] ); 132 }, 133 134 focusable: function( element ) { 135 return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); 136 }, 137 138 tabbable: function( element ) { 139 var tabIndex = $.attr( element, "tabindex" ), 140 isTabIndexNaN = isNaN( tabIndex ); 141 return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); 142 } 143}); 144 145// support: jQuery <1.8 146if ( !$( "<a>" ).outerWidth( 1 ).jquery ) { 147 $.each( [ "Width", "Height" ], function( i, name ) { 148 var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], 149 type = name.toLowerCase(), 150 orig = { 151 innerWidth: $.fn.innerWidth, 152 innerHeight: $.fn.innerHeight, 153 outerWidth: $.fn.outerWidth, 154 outerHeight: $.fn.outerHeight 155 }; 156 157 function reduce( elem, size, border, margin ) { 158 $.each( side, function() { 159 size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; 160 if ( border ) { 161 size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; 162 } 163 if ( margin ) { 164 size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; 165 } 166 }); 167 return size; 168 } 169 170 $.fn[ "inner" + name ] = function( size ) { 171 if ( size === undefined ) { 172 return orig[ "inner" + name ].call( this ); 173 } 174 175 return this.each(function() { 176 $( this ).css( type, reduce( this, size ) + "px" ); 177 }); 178 }; 179 180 $.fn[ "outer" + name] = function( size, margin ) { 181 if ( typeof size !== "number" ) { 182 return orig[ "outer" + name ].call( this, size ); 183 } 184 185 return this.each(function() { 186 $( this).css( type, reduce( this, size, true, margin ) + "px" ); 187 }); 188 }; 189 }); 190} 191 192// support: jQuery <1.8 193if ( !$.fn.addBack ) { 194 $.fn.addBack = function( selector ) { 195 return this.add( selector == null ? 196 this.prevObject : this.prevObject.filter( selector ) 197 ); 198 }; 199} 200 201// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) 202if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { 203 $.fn.removeData = (function( removeData ) { 204 return function( key ) { 205 if ( arguments.length ) { 206 return removeData.call( this, $.camelCase( key ) ); 207 } else { 208 return removeData.call( this ); 209 } 210 }; 211 })( $.fn.removeData ); 212} 213 214// deprecated 215$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); 216 217$.fn.extend({ 218 focus: (function( orig ) { 219 return function( delay, fn ) { 220 return typeof delay === "number" ? 221 this.each(function() { 222 var elem = this; 223 setTimeout(function() { 224 $( elem ).focus(); 225 if ( fn ) { 226 fn.call( elem ); 227 } 228 }, delay ); 229 }) : 230 orig.apply( this, arguments ); 231 }; 232 })( $.fn.focus ), 233 234 disableSelection: (function() { 235 var eventType = "onselectstart" in document.createElement( "div" ) ? 236 "selectstart" : 237 "mousedown"; 238 239 return function() { 240 return this.bind( eventType + ".ui-disableSelection", function( event ) { 241 event.preventDefault(); 242 }); 243 }; 244 })(), 245 246 enableSelection: function() { 247 return this.unbind( ".ui-disableSelection" ); 248 }, 249 250 zIndex: function( zIndex ) { 251 if ( zIndex !== undefined ) { 252 return this.css( "zIndex", zIndex ); 253 } 254 255 if ( this.length ) { 256 var elem = $( this[ 0 ] ), position, value; 257 while ( elem.length && elem[ 0 ] !== document ) { 258 // Ignore z-index if position is set to a value where z-index is ignored by the browser 259 // This makes behavior of this function consistent across browsers 260 // WebKit always returns auto if the element is positioned 261 position = elem.css( "position" ); 262 if ( position === "absolute" || position === "relative" || position === "fixed" ) { 263 // IE returns 0 when zIndex is not specified 264 // other browsers return a string 265 // we ignore the case of nested elements with an explicit value of 0 266 // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> 267 value = parseInt( elem.css( "zIndex" ), 10 ); 268 if ( !isNaN( value ) && value !== 0 ) { 269 return value; 270 } 271 } 272 elem = elem.parent(); 273 } 274 } 275 276 return 0; 277 } 278}); 279 280// $.ui.plugin is deprecated. Use $.widget() extensions instead. 281$.ui.plugin = { 282 add: function( module, option, set ) { 283 var i, 284 proto = $.ui[ module ].prototype; 285 for ( i in set ) { 286 proto.plugins[ i ] = proto.plugins[ i ] || []; 287 proto.plugins[ i ].push( [ option, set[ i ] ] ); 288 } 289 }, 290 call: function( instance, name, args, allowDisconnected ) { 291 var i, 292 set = instance.plugins[ name ]; 293 294 if ( !set ) { 295 return; 296 } 297 298 if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { 299 return; 300 } 301 302 for ( i = 0; i < set.length; i++ ) { 303 if ( instance.options[ set[ i ][ 0 ] ] ) { 304 set[ i ][ 1 ].apply( instance.element, args ); 305 } 306 } 307 } 308}; 309 310 311/*! 312 * jQuery UI Widget 1.11.4 313 * http://jqueryui.com 314 * 315 * Copyright jQuery Foundation and other contributors 316 * Released under the MIT license. 317 * http://jquery.org/license 318 * 319 * http://api.jqueryui.com/jQuery.widget/ 320 */ 321 322 323var widget_uuid = 0, 324 widget_slice = Array.prototype.slice; 325 326$.cleanData = (function( orig ) { 327 return function( elems ) { 328 var events, elem, i; 329 for ( i = 0; (elem = elems[i]) != null; i++ ) { 330 try { 331 332 // Only trigger remove when necessary to save time 333 events = $._data( elem, "events" ); 334 if ( events && events.remove ) { 335 $( elem ).triggerHandler( "remove" ); 336 } 337 338 // http://bugs.jquery.com/ticket/8235 339 } catch ( e ) {} 340 } 341 orig( elems ); 342 }; 343})( $.cleanData ); 344 345$.widget = function( name, base, prototype ) { 346 var fullName, existingConstructor, constructor, basePrototype, 347 // proxiedPrototype allows the provided prototype to remain unmodified 348 // so that it can be used as a mixin for multiple widgets (#8876) 349 proxiedPrototype = {}, 350 namespace = name.split( "." )[ 0 ]; 351 352 name = name.split( "." )[ 1 ]; 353 fullName = namespace + "-" + name; 354 355 if ( !prototype ) { 356 prototype = base; 357 base = $.Widget; 358 } 359 360 // create selector for plugin 361 $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { 362 return !!$.data( elem, fullName ); 363 }; 364 365 $[ namespace ] = $[ namespace ] || {}; 366 existingConstructor = $[ namespace ][ name ]; 367 constructor = $[ namespace ][ name ] = function( options, element ) { 368 // allow instantiation without "new" keyword 369 if ( !this._createWidget ) { 370 return new constructor( options, element ); 371 } 372 373 // allow instantiation without initializing for simple inheritance 374 // must use "new" keyword (the code above always passes args) 375 if ( arguments.length ) { 376 this._createWidget( options, element ); 377 } 378 }; 379 // extend with the existing constructor to carry over any static properties 380 $.extend( constructor, existingConstructor, { 381 version: prototype.version, 382 // copy the object used to create the prototype in case we need to 383 // redefine the widget later 384 _proto: $.extend( {}, prototype ), 385 // track widgets that inherit from this widget in case this widget is 386 // redefined after a widget inherits from it 387 _childConstructors: [] 388 }); 389 390 basePrototype = new base(); 391 // we need to make the options hash a property directly on the new instance 392 // otherwise we'll modify the options hash on the prototype that we're 393 // inheriting from 394 basePrototype.options = $.widget.extend( {}, basePrototype.options ); 395 $.each( prototype, function( prop, value ) { 396 if ( !$.isFunction( value ) ) { 397 proxiedPrototype[ prop ] = value; 398 return; 399 } 400 proxiedPrototype[ prop ] = (function() { 401 var _super = function() { 402 return base.prototype[ prop ].apply( this, arguments ); 403 }, 404 _superApply = function( args ) { 405 return base.prototype[ prop ].apply( this, args ); 406 }; 407 return function() { 408 var __super = this._super, 409 __superApply = this._superApply, 410 returnValue; 411 412 this._super = _super; 413 this._superApply = _superApply; 414 415 returnValue = value.apply( this, arguments ); 416 417 this._super = __super; 418 this._superApply = __superApply; 419 420 return returnValue; 421 }; 422 })(); 423 }); 424 constructor.prototype = $.widget.extend( basePrototype, { 425 // TODO: remove support for widgetEventPrefix 426 // always use the name + a colon as the prefix, e.g., draggable:start 427 // don't prefix for widgets that aren't DOM-based 428 widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name 429 }, proxiedPrototype, { 430 constructor: constructor, 431 namespace: namespace, 432 widgetName: name, 433 widgetFullName: fullName 434 }); 435 436 // If this widget is being redefined then we need to find all widgets that 437 // are inheriting from it and redefine all of them so that they inherit from 438 // the new version of this widget. We're essentially trying to replace one 439 // level in the prototype chain. 440 if ( existingConstructor ) { 441 $.each( existingConstructor._childConstructors, function( i, child ) { 442 var childPrototype = child.prototype; 443 444 // redefine the child widget using the same prototype that was 445 // originally used, but inherit from the new version of the base 446 $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); 447 }); 448 // remove the list of existing child constructors from the old constructor 449 // so the old child constructors can be garbage collected 450 delete existingConstructor._childConstructors; 451 } else { 452 base._childConstructors.push( constructor ); 453 } 454 455 $.widget.bridge( name, constructor ); 456 457 return constructor; 458}; 459 460$.widget.extend = function( target ) { 461 var input = widget_slice.call( arguments, 1 ), 462 inputIndex = 0, 463 inputLength = input.length, 464 key, 465 value; 466 for ( ; inputIndex < inputLength; inputIndex++ ) { 467 for ( key in input[ inputIndex ] ) { 468 value = input[ inputIndex ][ key ]; 469 if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 470 // Clone objects 471 if ( $.isPlainObject( value ) ) { 472 target[ key ] = $.isPlainObject( target[ key ] ) ? 473 $.widget.extend( {}, target[ key ], value ) : 474 // Don't extend strings, arrays, etc. with objects 475 $.widget.extend( {}, value ); 476 // Copy everything else by reference 477 } else { 478 target[ key ] = value; 479 } 480 } 481 } 482 } 483 return target; 484}; 485 486$.widget.bridge = function( name, object ) { 487 var fullName = object.prototype.widgetFullName || name; 488 $.fn[ name ] = function( options ) { 489 var isMethodCall = typeof options === "string", 490 args = widget_slice.call( arguments, 1 ), 491 returnValue = this; 492 493 if ( isMethodCall ) { 494 this.each(function() { 495 var methodValue, 496 instance = $.data( this, fullName ); 497 if ( options === "instance" ) { 498 returnValue = instance; 499 return false; 500 } 501 if ( !instance ) { 502 return $.error( "cannot call methods on " + name + " prior to initialization; " + 503 "attempted to call method '" + options + "'" ); 504 } 505 if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { 506 return $.error( "no such method '" + options + "' for " + name + " widget instance" ); 507 } 508 methodValue = instance[ options ].apply( instance, args ); 509 if ( methodValue !== instance && methodValue !== undefined ) { 510 returnValue = methodValue && methodValue.jquery ? 511 returnValue.pushStack( methodValue.get() ) : 512 methodValue; 513 return false; 514 } 515 }); 516 } else { 517 518 // Allow multiple hashes to be passed on init 519 if ( args.length ) { 520 options = $.widget.extend.apply( null, [ options ].concat(args) ); 521 } 522 523 this.each(function() { 524 var instance = $.data( this, fullName ); 525 if ( instance ) { 526 instance.option( options || {} ); 527 if ( instance._init ) { 528 instance._init(); 529 } 530 } else { 531 $.data( this, fullName, new object( options, this ) ); 532 } 533 }); 534 } 535 536 return returnValue; 537 }; 538}; 539 540$.Widget = function( /* options, element */ ) {}; 541$.Widget._childConstructors = []; 542 543$.Widget.prototype = { 544 widgetName: "widget", 545 widgetEventPrefix: "", 546 defaultElement: "<div>", 547 options: { 548 disabled: false, 549 550 // callbacks 551 create: null 552 }, 553 _createWidget: function( options, element ) { 554 element = $( element || this.defaultElement || this )[ 0 ]; 555 this.element = $( element ); 556 this.uuid = widget_uuid++; 557 this.eventNamespace = "." + this.widgetName + this.uuid; 558 559 this.bindings = $(); 560 this.hoverable = $(); 561 this.focusable = $(); 562 563 if ( element !== this ) { 564 $.data( element, this.widgetFullName, this ); 565 this._on( true, this.element, { 566 remove: function( event ) { 567 if ( event.target === element ) { 568 this.destroy(); 569 } 570 } 571 }); 572 this.document = $( element.style ? 573 // element within the document 574 element.ownerDocument : 575 // element is window or document 576 element.document || element ); 577 this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); 578 } 579 580 this.options = $.widget.extend( {}, 581 this.options, 582 this._getCreateOptions(), 583 options ); 584 585 this._create(); 586 this._trigger( "create", null, this._getCreateEventData() ); 587 this._init(); 588 }, 589 _getCreateOptions: $.noop, 590 _getCreateEventData: $.noop, 591 _create: $.noop, 592 _init: $.noop, 593 594 destroy: function() { 595 this._destroy(); 596 // we can probably remove the unbind calls in 2.0 597 // all event bindings should go through this._on() 598 this.element 599 .unbind( this.eventNamespace ) 600 .removeData( this.widgetFullName ) 601 // support: jquery <1.6.3 602 // http://bugs.jquery.com/ticket/9413 603 .removeData( $.camelCase( this.widgetFullName ) ); 604 this.widget() 605 .unbind( this.eventNamespace ) 606 .removeAttr( "aria-disabled" ) 607 .removeClass( 608 this.widgetFullName + "-disabled " + 609 "ui-state-disabled" ); 610 611 // clean up events and states 612 this.bindings.unbind( this.eventNamespace ); 613 this.hoverable.removeClass( "ui-state-hover" ); 614 this.focusable.removeClass( "ui-state-focus" ); 615 }, 616 _destroy: $.noop, 617 618 widget: function() { 619 return this.element; 620 }, 621 622 option: function( key, value ) { 623 var options = key, 624 parts, 625 curOption, 626 i; 627 628 if ( arguments.length === 0 ) { 629 // don't return a reference to the internal hash 630 return $.widget.extend( {}, this.options ); 631 } 632 633 if ( typeof key === "string" ) { 634 // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 635 options = {}; 636 parts = key.split( "." ); 637 key = parts.shift(); 638 if ( parts.length ) { 639 curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 640 for ( i = 0; i < parts.length - 1; i++ ) { 641 curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 642 curOption = curOption[ parts[ i ] ]; 643 } 644 key = parts.pop(); 645 if ( arguments.length === 1 ) { 646 return curOption[ key ] === undefined ? null : curOption[ key ]; 647 } 648 curOption[ key ] = value; 649 } else { 650 if ( arguments.length === 1 ) { 651 return this.options[ key ] === undefined ? null : this.options[ key ]; 652 } 653 options[ key ] = value; 654 } 655 } 656 657 this._setOptions( options ); 658 659 return this; 660 }, 661 _setOptions: function( options ) { 662 var key; 663 664 for ( key in options ) { 665 this._setOption( key, options[ key ] ); 666 } 667 668 return this; 669 }, 670 _setOption: function( key, value ) { 671 this.options[ key ] = value; 672 673 if ( key === "disabled" ) { 674 this.widget() 675 .toggleClass( this.widgetFullName + "-disabled", !!value ); 676 677 // If the widget is becoming disabled, then nothing is interactive 678 if ( value ) { 679 this.hoverable.removeClass( "ui-state-hover" ); 680 this.focusable.removeClass( "ui-state-focus" ); 681 } 682 } 683 684 return this; 685 }, 686 687 enable: function() { 688 return this._setOptions({ disabled: false }); 689 }, 690 disable: function() { 691 return this._setOptions({ disabled: true }); 692 }, 693 694 _on: function( suppressDisabledCheck, element, handlers ) { 695 var delegateElement, 696 instance = this; 697 698 // no suppressDisabledCheck flag, shuffle arguments 699 if ( typeof suppressDisabledCheck !== "boolean" ) { 700 handlers = element; 701 element = suppressDisabledCheck; 702 suppressDisabledCheck = false; 703 } 704 705 // no element argument, shuffle and use this.element 706 if ( !handlers ) { 707 handlers = element; 708 element = this.element; 709 delegateElement = this.widget(); 710 } else { 711 element = delegateElement = $( element ); 712 this.bindings = this.bindings.add( element ); 713 } 714 715 $.each( handlers, function( event, handler ) { 716 function handlerProxy() { 717 // allow widgets to customize the disabled handling 718 // - disabled as an array instead of boolean 719 // - disabled class as method for disabling individual parts 720 if ( !suppressDisabledCheck && 721 ( instance.options.disabled === true || 722 $( this ).hasClass( "ui-state-disabled" ) ) ) { 723 return; 724 } 725 return ( typeof handler === "string" ? instance[ handler ] : handler ) 726 .apply( instance, arguments ); 727 } 728 729 // copy the guid so direct unbinding works 730 if ( typeof handler !== "string" ) { 731 handlerProxy.guid = handler.guid = 732 handler.guid || handlerProxy.guid || $.guid++; 733 } 734 735 var match = event.match( /^([\w:-]*)\s*(.*)$/ ), 736 eventName = match[1] + instance.eventNamespace, 737 selector = match[2]; 738 if ( selector ) { 739 delegateElement.delegate( selector, eventName, handlerProxy ); 740 } else { 741 element.bind( eventName, handlerProxy ); 742 } 743 }); 744 }, 745 746 _off: function( element, eventName ) { 747 eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + 748 this.eventNamespace; 749 element.unbind( eventName ).undelegate( eventName ); 750 751 // Clear the stack to avoid memory leaks (#10056) 752 this.bindings = $( this.bindings.not( element ).get() ); 753 this.focusable = $( this.focusable.not( element ).get() ); 754 this.hoverable = $( this.hoverable.not( element ).get() ); 755 }, 756 757 _delay: function( handler, delay ) { 758 function handlerProxy() { 759 return ( typeof handler === "string" ? instance[ handler ] : handler ) 760 .apply( instance, arguments ); 761 } 762 var instance = this; 763 return setTimeout( handlerProxy, delay || 0 ); 764 }, 765 766 _hoverable: function( element ) { 767 this.hoverable = this.hoverable.add( element ); 768 this._on( element, { 769 mouseenter: function( event ) { 770 $( event.currentTarget ).addClass( "ui-state-hover" ); 771 }, 772 mouseleave: function( event ) { 773 $( event.currentTarget ).removeClass( "ui-state-hover" ); 774 } 775 }); 776 }, 777 778 _focusable: function( element ) { 779 this.focusable = this.focusable.add( element ); 780 this._on( element, { 781 focusin: function( event ) { 782 $( event.currentTarget ).addClass( "ui-state-focus" ); 783 }, 784 focusout: function( event ) { 785 $( event.currentTarget ).removeClass( "ui-state-focus" ); 786 } 787 }); 788 }, 789 790 _trigger: function( type, event, data ) { 791 var prop, orig, 792 callback = this.options[ type ]; 793 794 data = data || {}; 795 event = $.Event( event ); 796 event.type = ( type === this.widgetEventPrefix ? 797 type : 798 this.widgetEventPrefix + type ).toLowerCase(); 799 // the original event may come from any element 800 // so we need to reset the target on the new event 801 event.target = this.element[ 0 ]; 802 803 // copy original event properties over to the new event 804 orig = event.originalEvent; 805 if ( orig ) { 806 for ( prop in orig ) { 807 if ( !( prop in event ) ) { 808 event[ prop ] = orig[ prop ]; 809 } 810 } 811 } 812 813 this.element.trigger( event, data ); 814 return !( $.isFunction( callback ) && 815 callback.apply( this.element[0], [ event ].concat( data ) ) === false || 816 event.isDefaultPrevented() ); 817 } 818}; 819 820$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 821 $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 822 if ( typeof options === "string" ) { 823 options = { effect: options }; 824 } 825 var hasOptions, 826 effectName = !options ? 827 method : 828 options === true || typeof options === "number" ? 829 defaultEffect : 830 options.effect || defaultEffect; 831 options = options || {}; 832 if ( typeof options === "number" ) { 833 options = { duration: options }; 834 } 835 hasOptions = !$.isEmptyObject( options ); 836 options.complete = callback; 837 if ( options.delay ) { 838 element.delay( options.delay ); 839 } 840 if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 841 element[ method ]( options ); 842 } else if ( effectName !== method && element[ effectName ] ) { 843 element[ effectName ]( options.duration, options.easing, callback ); 844 } else { 845 element.queue(function( next ) { 846 $( this )[ method ](); 847 if ( callback ) { 848 callback.call( element[ 0 ] ); 849 } 850 next(); 851 }); 852 } 853 }; 854}); 855 856var widget = $.widget; 857 858 859/*! 860 * jQuery UI Mouse 1.11.4 861 * http://jqueryui.com 862 * 863 * Copyright jQuery Foundation and other contributors 864 * Released under the MIT license. 865 * http://jquery.org/license 866 * 867 * http://api.jqueryui.com/mouse/ 868 */ 869 870 871var mouseHandled = false; 872$( document ).mouseup( function() { 873 mouseHandled = false; 874}); 875 876var mouse = $.widget("ui.mouse", { 877 version: "1.11.4", 878 options: { 879 cancel: "input,textarea,button,select,option", 880 distance: 1, 881 delay: 0 882 }, 883 _mouseInit: function() { 884 var that = this; 885 886 this.element 887 .bind("mousedown." + this.widgetName, function(event) { 888 return that._mouseDown(event); 889 }) 890 .bind("click." + this.widgetName, function(event) { 891 if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) { 892 $.removeData(event.target, that.widgetName + ".preventClickEvent"); 893 event.stopImmediatePropagation(); 894 return false; 895 } 896 }); 897 898 this.started = false; 899 }, 900 901 // TODO: make sure destroying one instance of mouse doesn't mess with 902 // other instances of mouse 903 _mouseDestroy: function() { 904 this.element.unbind("." + this.widgetName); 905 if ( this._mouseMoveDelegate ) { 906 this.document 907 .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) 908 .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); 909 } 910 }, 911 912 _mouseDown: function(event) { 913 // don't let more than one widget handle mouseStart 914 if ( mouseHandled ) { 915 return; 916 } 917 918 this._mouseMoved = false; 919 920 // we may have missed mouseup (out of window) 921 (this._mouseStarted && this._mouseUp(event)); 922 923 this._mouseDownEvent = event; 924 925 var that = this, 926 btnIsLeft = (event.which === 1), 927 // event.target.nodeName works around a bug in IE 8 with 928 // disabled inputs (#7620) 929 elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); 930 if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { 931 return true; 932 } 933 934 this.mouseDelayMet = !this.options.delay; 935 if (!this.mouseDelayMet) { 936 this._mouseDelayTimer = setTimeout(function() { 937 that.mouseDelayMet = true; 938 }, this.options.delay); 939 } 940 941 if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { 942 this._mouseStarted = (this._mouseStart(event) !== false); 943 if (!this._mouseStarted) { 944 event.preventDefault(); 945 return true; 946 } 947 } 948 949 // Click event may never have fired (Gecko & Opera) 950 if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) { 951 $.removeData(event.target, this.widgetName + ".preventClickEvent"); 952 } 953 954 // these delegates are required to keep context 955 this._mouseMoveDelegate = function(event) { 956 return that._mouseMove(event); 957 }; 958 this._mouseUpDelegate = function(event) { 959 return that._mouseUp(event); 960 }; 961 962 this.document 963 .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 964 .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); 965 966 event.preventDefault(); 967 968 mouseHandled = true; 969 return true; 970 }, 971 972 _mouseMove: function(event) { 973 // Only check for mouseups outside the document if you've moved inside the document 974 // at least once. This prevents the firing of mouseup in the case of IE<9, which will 975 // fire a mousemove event if content is placed under the cursor. See #7778 976 // Support: IE <9 977 if ( this._mouseMoved ) { 978 // IE mouseup check - mouseup happened when mouse was out of window 979 if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) { 980 return this._mouseUp(event); 981 982 // Iframe mouseup check - mouseup occurred in another document 983 } else if ( !event.which ) { 984 return this._mouseUp( event ); 985 } 986 } 987 988 if ( event.which || event.button ) { 989 this._mouseMoved = true; 990 } 991 992 if (this._mouseStarted) { 993 this._mouseDrag(event); 994 return event.preventDefault(); 995 } 996 997 if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { 998 this._mouseStarted = 999 (this._mouseStart(this._mouseDownEvent, event) !== false); 1000 (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); 1001 } 1002 1003 return !this._mouseStarted; 1004 }, 1005 1006 _mouseUp: function(event) { 1007 this.document 1008 .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 1009 .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); 1010 1011 if (this._mouseStarted) { 1012 this._mouseStarted = false; 1013 1014 if (event.target === this._mouseDownEvent.target) { 1015 $.data(event.target, this.widgetName + ".preventClickEvent", true); 1016 } 1017 1018 this._mouseStop(event); 1019 } 1020 1021 mouseHandled = false; 1022 return false; 1023 }, 1024 1025 _mouseDistanceMet: function(event) { 1026 return (Math.max( 1027 Math.abs(this._mouseDownEvent.pageX - event.pageX), 1028 Math.abs(this._mouseDownEvent.pageY - event.pageY) 1029 ) >= this.options.distance 1030 ); 1031 }, 1032 1033 _mouseDelayMet: function(/* event */) { 1034 return this.mouseDelayMet; 1035 }, 1036 1037 // These are placeholder methods, to be overriden by extending plugin 1038 _mouseStart: function(/* event */) {}, 1039 _mouseDrag: function(/* event */) {}, 1040 _mouseStop: function(/* event */) {}, 1041 _mouseCapture: function(/* event */) { return true; } 1042}); 1043 1044 1045/*! 1046 * jQuery UI Position 1.11.4 1047 * http://jqueryui.com 1048 * 1049 * Copyright jQuery Foundation and other contributors 1050 * Released under the MIT license. 1051 * http://jquery.org/license 1052 * 1053 * http://api.jqueryui.com/position/ 1054 */ 1055 1056(function() { 1057 1058$.ui = $.ui || {}; 1059 1060var cachedScrollbarWidth, supportsOffsetFractions, 1061 max = Math.max, 1062 abs = Math.abs, 1063 round = Math.round, 1064 rhorizontal = /left|center|right/, 1065 rvertical = /top|center|bottom/, 1066 roffset = /[\+\-]\d+(\.[\d]+)?%?/, 1067 rposition = /^\w+/, 1068 rpercent = /%$/, 1069 _position = $.fn.position; 1070 1071function getOffsets( offsets, width, height ) { 1072 return [ 1073 parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), 1074 parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) 1075 ]; 1076} 1077 1078function parseCss( element, property ) { 1079 return parseInt( $.css( element, property ), 10 ) || 0; 1080} 1081 1082function getDimensions( elem ) { 1083 var raw = elem[0]; 1084 if ( raw.nodeType === 9 ) { 1085 return { 1086 width: elem.width(), 1087 height: elem.height(), 1088 offset: { top: 0, left: 0 } 1089 }; 1090 } 1091 if ( $.isWindow( raw ) ) { 1092 return { 1093 width: elem.width(), 1094 height: elem.height(), 1095 offset: { top: elem.scrollTop(), left: elem.scrollLeft() } 1096 }; 1097 } 1098 if ( raw.preventDefault ) { 1099 return { 1100 width: 0, 1101 height: 0, 1102 offset: { top: raw.pageY, left: raw.pageX } 1103 }; 1104 } 1105 return { 1106 width: elem.outerWidth(), 1107 height: elem.outerHeight(), 1108 offset: elem.offset() 1109 }; 1110} 1111 1112$.position = { 1113 scrollbarWidth: function() { 1114 if ( cachedScrollbarWidth !== undefined ) { 1115 return cachedScrollbarWidth; 1116 } 1117 var w1, w2, 1118 div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ), 1119 innerDiv = div.children()[0]; 1120 1121 $( "body" ).append( div ); 1122 w1 = innerDiv.offsetWidth; 1123 div.css( "overflow", "scroll" ); 1124 1125 w2 = innerDiv.offsetWidth; 1126 1127 if ( w1 === w2 ) { 1128 w2 = div[0].clientWidth; 1129 } 1130 1131 div.remove(); 1132 1133 return (cachedScrollbarWidth = w1 - w2); 1134 }, 1135 getScrollInfo: function( within ) { 1136 var overflowX = within.isWindow || within.isDocument ? "" : 1137 within.element.css( "overflow-x" ), 1138 overflowY = within.isWindow || within.isDocument ? "" : 1139 within.element.css( "overflow-y" ), 1140 hasOverflowX = overflowX === "scroll" || 1141 ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), 1142 hasOverflowY = overflowY === "scroll" || 1143 ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); 1144 return { 1145 width: hasOverflowY ? $.position.scrollbarWidth() : 0, 1146 height: hasOverflowX ? $.position.scrollbarWidth() : 0 1147 }; 1148 }, 1149 getWithinInfo: function( element ) { 1150 var withinElement = $( element || window ), 1151 isWindow = $.isWindow( withinElement[0] ), 1152 isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9; 1153 return { 1154 element: withinElement, 1155 isWindow: isWindow, 1156 isDocument: isDocument, 1157 offset: withinElement.offset() || { left: 0, top: 0 }, 1158 scrollLeft: withinElement.scrollLeft(), 1159 scrollTop: withinElement.scrollTop(), 1160 1161 // support: jQuery 1.6.x 1162 // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows 1163 width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(), 1164 height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight() 1165 }; 1166 } 1167}; 1168 1169$.fn.position = function( options ) { 1170 if ( !options || !options.of ) { 1171 return _position.apply( this, arguments ); 1172 } 1173 1174 // make a copy, we don't want to modify arguments 1175 options = $.extend( {}, options ); 1176 1177 var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, 1178 target = $( options.of ), 1179 within = $.position.getWithinInfo( options.within ), 1180 scrollInfo = $.position.getScrollInfo( within ), 1181 collision = ( options.collision || "flip" ).split( " " ), 1182 offsets = {}; 1183 1184 dimensions = getDimensions( target ); 1185 if ( target[0].preventDefault ) { 1186 // force left top to allow flipping 1187 options.at = "left top"; 1188 } 1189 targetWidth = dimensions.width; 1190 targetHeight = dimensions.height; 1191 targetOffset = dimensions.offset; 1192 // clone to reuse original targetOffset later 1193 basePosition = $.extend( {}, targetOffset ); 1194 1195 // force my and at to have valid horizontal and vertical positions 1196 // if a value is missing or invalid, it will be converted to center 1197 $.each( [ "my", "at" ], function() { 1198 var pos = ( options[ this ] || "" ).split( " " ), 1199 horizontalOffset, 1200 verticalOffset; 1201 1202 if ( pos.length === 1) { 1203 pos = rhorizontal.test( pos[ 0 ] ) ? 1204 pos.concat( [ "center" ] ) : 1205 rvertical.test( pos[ 0 ] ) ? 1206 [ "center" ].concat( pos ) : 1207 [ "center", "center" ]; 1208 } 1209 pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; 1210 pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; 1211 1212 // calculate offsets 1213 horizontalOffset = roffset.exec( pos[ 0 ] ); 1214 verticalOffset = roffset.exec( pos[ 1 ] ); 1215 offsets[ this ] = [ 1216 horizontalOffset ? horizontalOffset[ 0 ] : 0, 1217 verticalOffset ? verticalOffset[ 0 ] : 0 1218 ]; 1219 1220 // reduce to just the positions without the offsets 1221 options[ this ] = [ 1222 rposition.exec( pos[ 0 ] )[ 0 ], 1223 rposition.exec( pos[ 1 ] )[ 0 ] 1224 ]; 1225 }); 1226 1227 // normalize collision option 1228 if ( collision.length === 1 ) { 1229 collision[ 1 ] = collision[ 0 ]; 1230 } 1231 1232 if ( options.at[ 0 ] === "right" ) { 1233 basePosition.left += targetWidth; 1234 } else if ( options.at[ 0 ] === "center" ) { 1235 basePosition.left += targetWidth / 2; 1236 } 1237 1238 if ( options.at[ 1 ] === "bottom" ) { 1239 basePosition.top += targetHeight; 1240 } else if ( options.at[ 1 ] === "center" ) { 1241 basePosition.top += targetHeight / 2; 1242 } 1243 1244 atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); 1245 basePosition.left += atOffset[ 0 ]; 1246 basePosition.top += atOffset[ 1 ]; 1247 1248 return this.each(function() { 1249 var collisionPosition, using, 1250 elem = $( this ), 1251 elemWidth = elem.outerWidth(), 1252 elemHeight = elem.outerHeight(), 1253 marginLeft = parseCss( this, "marginLeft" ), 1254 marginTop = parseCss( this, "marginTop" ), 1255 collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, 1256 collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, 1257 position = $.extend( {}, basePosition ), 1258 myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); 1259 1260 if ( options.my[ 0 ] === "right" ) { 1261 position.left -= elemWidth; 1262 } else if ( options.my[ 0 ] === "center" ) { 1263 position.left -= elemWidth / 2; 1264 } 1265 1266 if ( options.my[ 1 ] === "bottom" ) { 1267 position.top -= elemHeight; 1268 } else if ( options.my[ 1 ] === "center" ) { 1269 position.top -= elemHeight / 2; 1270 } 1271 1272 position.left += myOffset[ 0 ]; 1273 position.top += myOffset[ 1 ]; 1274 1275 // if the browser doesn't support fractions, then round for consistent results 1276 if ( !supportsOffsetFractions ) { 1277 position.left = round( position.left ); 1278 position.top = round( position.top ); 1279 } 1280 1281 collisionPosition = { 1282 marginLeft: marginLeft, 1283 marginTop: marginTop 1284 }; 1285 1286 $.each( [ "left", "top" ], function( i, dir ) { 1287 if ( $.ui.position[ collision[ i ] ] ) { 1288 $.ui.position[ collision[ i ] ][ dir ]( position, { 1289 targetWidth: targetWidth, 1290 targetHeight: targetHeight, 1291 elemWidth: elemWidth, 1292 elemHeight: elemHeight, 1293 collisionPosition: collisionPosition, 1294 collisionWidth: collisionWidth, 1295 collisionHeight: collisionHeight, 1296 offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], 1297 my: options.my, 1298 at: options.at, 1299 within: within, 1300 elem: elem 1301 }); 1302 } 1303 }); 1304 1305 if ( options.using ) { 1306 // adds feedback as second argument to using callback, if present 1307 using = function( props ) { 1308 var left = targetOffset.left - position.left, 1309 right = left + targetWidth - elemWidth, 1310 top = targetOffset.top - position.top, 1311 bottom = top + targetHeight - elemHeight, 1312 feedback = { 1313 target: { 1314 element: target, 1315 left: targetOffset.left, 1316 top: targetOffset.top, 1317 width: targetWidth, 1318 height: targetHeight 1319 }, 1320 element: { 1321 element: elem, 1322 left: position.left, 1323 top: position.top, 1324 width: elemWidth, 1325 height: elemHeight 1326 }, 1327 horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", 1328 vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" 1329 }; 1330 if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { 1331 feedback.horizontal = "center"; 1332 } 1333 if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { 1334 feedback.vertical = "middle"; 1335 } 1336 if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { 1337 feedback.important = "horizontal"; 1338 } else { 1339 feedback.important = "vertical"; 1340 } 1341 options.using.call( this, props, feedback ); 1342 }; 1343 } 1344 1345 elem.offset( $.extend( position, { using: using } ) ); 1346 }); 1347}; 1348 1349$.ui.position = { 1350 fit: { 1351 left: function( position, data ) { 1352 var within = data.within, 1353 withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, 1354 outerWidth = within.width, 1355 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1356 overLeft = withinOffset - collisionPosLeft, 1357 overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, 1358 newOverRight; 1359 1360 // element is wider than within 1361 if ( data.collisionWidth > outerWidth ) { 1362 // element is initially over the left side of within 1363 if ( overLeft > 0 && overRight <= 0 ) { 1364 newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; 1365 position.left += overLeft - newOverRight; 1366 // element is initially over right side of within 1367 } else if ( overRight > 0 && overLeft <= 0 ) { 1368 position.left = withinOffset; 1369 // element is initially over both left and right sides of within 1370 } else { 1371 if ( overLeft > overRight ) { 1372 position.left = withinOffset + outerWidth - data.collisionWidth; 1373 } else { 1374 position.left = withinOffset; 1375 } 1376 } 1377 // too far left -> align with left edge 1378 } else if ( overLeft > 0 ) { 1379 position.left += overLeft; 1380 // too far right -> align with right edge 1381 } else if ( overRight > 0 ) { 1382 position.left -= overRight; 1383 // adjust based on position and margin 1384 } else { 1385 position.left = max( position.left - collisionPosLeft, position.left ); 1386 } 1387 }, 1388 top: function( position, data ) { 1389 var within = data.within, 1390 withinOffset = within.isWindow ? within.scrollTop : within.offset.top, 1391 outerHeight = data.within.height, 1392 collisionPosTop = position.top - data.collisionPosition.marginTop, 1393 overTop = withinOffset - collisionPosTop, 1394 overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, 1395 newOverBottom; 1396 1397 // element is taller than within 1398 if ( data.collisionHeight > outerHeight ) { 1399 // element is initially over the top of within 1400 if ( overTop > 0 && overBottom <= 0 ) { 1401 newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; 1402 position.top += overTop - newOverBottom; 1403 // element is initially over bottom of within 1404 } else if ( overBottom > 0 && overTop <= 0 ) { 1405 position.top = withinOffset; 1406 // element is initially over both top and bottom of within 1407 } else { 1408 if ( overTop > overBottom ) { 1409 position.top = withinOffset + outerHeight - data.collisionHeight; 1410 } else { 1411 position.top = withinOffset; 1412 } 1413 } 1414 // too far up -> align with top 1415 } else if ( overTop > 0 ) { 1416 position.top += overTop; 1417 // too far down -> align with bottom edge 1418 } else if ( overBottom > 0 ) { 1419 position.top -= overBottom; 1420 // adjust based on position and margin 1421 } else { 1422 position.top = max( position.top - collisionPosTop, position.top ); 1423 } 1424 } 1425 }, 1426 flip: { 1427 left: function( position, data ) { 1428 var within = data.within, 1429 withinOffset = within.offset.left + within.scrollLeft, 1430 outerWidth = within.width, 1431 offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, 1432 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1433 overLeft = collisionPosLeft - offsetLeft, 1434 overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, 1435 myOffset = data.my[ 0 ] === "left" ? 1436 -data.elemWidth : 1437 data.my[ 0 ] === "right" ? 1438 data.elemWidth : 1439 0, 1440 atOffset = data.at[ 0 ] === "left" ? 1441 data.targetWidth : 1442 data.at[ 0 ] === "right" ? 1443 -data.targetWidth : 1444 0, 1445 offset = -2 * data.offset[ 0 ], 1446 newOverRight, 1447 newOverLeft; 1448 1449 if ( overLeft < 0 ) { 1450 newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; 1451 if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { 1452 position.left += myOffset + atOffset + offset; 1453 } 1454 } else if ( overRight > 0 ) { 1455 newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; 1456 if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { 1457 position.left += myOffset + atOffset + offset; 1458 } 1459 } 1460 }, 1461 top: function( position, data ) { 1462 var within = data.within, 1463 withinOffset = within.offset.top + within.scrollTop, 1464 outerHeight = within.height, 1465 offsetTop = within.isWindow ? within.scrollTop : within.offset.top, 1466 collisionPosTop = position.top - data.collisionPosition.marginTop, 1467 overTop = collisionPosTop - offsetTop, 1468 overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, 1469 top = data.my[ 1 ] === "top", 1470 myOffset = top ? 1471 -data.elemHeight : 1472 data.my[ 1 ] === "bottom" ? 1473 data.elemHeight : 1474 0, 1475 atOffset = data.at[ 1 ] === "top" ? 1476 data.targetHeight : 1477 data.at[ 1 ] === "bottom" ? 1478 -data.targetHeight : 1479 0, 1480 offset = -2 * data.offset[ 1 ], 1481 newOverTop, 1482 newOverBottom; 1483 if ( overTop < 0 ) { 1484 newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; 1485 if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { 1486 position.top += myOffset + atOffset + offset; 1487 } 1488 } else if ( overBottom > 0 ) { 1489 newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; 1490 if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { 1491 position.top += myOffset + atOffset + offset; 1492 } 1493 } 1494 } 1495 }, 1496 flipfit: { 1497 left: function() { 1498 $.ui.position.flip.left.apply( this, arguments ); 1499 $.ui.position.fit.left.apply( this, arguments ); 1500 }, 1501 top: function() { 1502 $.ui.position.flip.top.apply( this, arguments ); 1503 $.ui.position.fit.top.apply( this, arguments ); 1504 } 1505 } 1506}; 1507 1508// fraction support test 1509(function() { 1510 var testElement, testElementParent, testElementStyle, offsetLeft, i, 1511 body = document.getElementsByTagName( "body" )[ 0 ], 1512 div = document.createElement( "div" ); 1513 1514 //Create a "fake body" for testing based on method used in jQuery.support 1515 testElement = document.createElement( body ? "div" : "body" ); 1516 testElementStyle = { 1517 visibility: "hidden", 1518 width: 0, 1519 height: 0, 1520 border: 0, 1521 margin: 0, 1522 background: "none" 1523 }; 1524 if ( body ) { 1525 $.extend( testElementStyle, { 1526 position: "absolute", 1527 left: "-1000px", 1528 top: "-1000px" 1529 }); 1530 } 1531 for ( i in testElementStyle ) { 1532 testElement.style[ i ] = testElementStyle[ i ]; 1533 } 1534 testElement.appendChild( div ); 1535 testElementParent = body || document.documentElement; 1536 testElementParent.insertBefore( testElement, testElementParent.firstChild ); 1537 1538 div.style.cssText = "position: absolute; left: 10.7432222px;"; 1539 1540 offsetLeft = $( div ).offset().left; 1541 supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11; 1542 1543 testElement.innerHTML = ""; 1544 testElementParent.removeChild( testElement ); 1545})(); 1546 1547})(); 1548 1549var position = $.ui.position; 1550 1551 1552/*! 1553 * jQuery UI
1553Tabs 1.11.4 1554 * http://jqueryui.com 1555 * 1556 * Copyright jQuery Foundation and other contributors 1557 * Released under the MIT license. 1558 * http://jquery.org/license 1559 * 1560 * http://api.jqueryui.com/tabs/ 1561 */ 1562 1563 1564var tabs = $.widget( "ui.tabs", { 1565 version: "1.11.4", 1566 delay: 300, 1567 options: { 1568 active: null, 1569 collapsible: false, 1570 event: "click", 1571 heightStyle: "content", 1572 hide: null, 1573 show: null, 1574 1575 // callbacks 1576 activate: null, 1577 beforeActivate: null, 1578 beforeLoad: null, 1579 load: null 1580 }, 1581 1582 _isLocal: (function() { 1583 var rhash = /\?.*|
vendor: 69,174 bytes, lines 1583-4290
1583#.*$/; 1584 1585 return function( anchor ) { 1586 var anchorUrl, locationUrl; 1587 1588 // support: IE7 1589 // IE7 doesn't normalize the href property when set via script (#9317) 1590 anchor = anchor.cloneNode( false ); 1591 1592 anchorUrl = anchor.href.replace( rhash, "" ); 1593 locationUrl = location.href.replace( rhash, "" ); 1594 1595 // decoding may throw an error if the URL isn't UTF-8 (#9518) 1596 try { 1597 anchorUrl = decodeURIComponent( anchorUrl ); 1598 } catch ( error ) {} 1599 try { 1600 locationUrl = decodeURIComponent( locationUrl ); 1601 } catch ( error ) {} 1602 1603 return anchor.hash.length > 1 && anchorUrl === locationUrl; 1604 }; 1605 })(), 1606 1607 _create: function() { 1608 var that = this, 1609 options = this.options; 1610 1611 this.running = false; 1612 1613 this.element 1614 .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" ) 1615 .toggleClass( "ui-tabs-collapsible", options.collapsible ); 1616 1617 this._processTabs(); 1618 options.active = this._initialActive(); 1619 1620 // Take disabling tabs via class attribute from HTML 1621 // into account and update option properly. 1622 if ( $.isArray( options.disabled ) ) { 1623 options.disabled = $.unique( options.disabled.concat( 1624 $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { 1625 return that.tabs.index( li ); 1626 }) 1627 ) ).sort(); 1628 } 1629 1630 // check for length avoids error when initializing empty list 1631 if ( this.options.active !== false && this.anchors.length ) { 1632 this.active = this._findActive( options.active ); 1633 } else { 1634 this.active = $(); 1635 } 1636 1637 this._refresh(); 1638 1639 if ( this.active.length ) { 1640 this.load( options.active ); 1641 } 1642 }, 1643 1644 _initialActive: function() { 1645 var active = this.options.active, 1646 collapsible = this.options.collapsible, 1647 locationHash = location.hash.substring( 1 ); 1648 1649 if ( active === null ) { 1650 // check the fragment identifier in the URL 1651 if ( locationHash ) { 1652 this.tabs.each(function( i, tab ) { 1653 if ( $( tab ).attr( "aria-controls" ) === locationHash ) { 1654 active = i; 1655 return false; 1656 } 1657 }); 1658 } 1659 1660 // check for a tab marked active via a class 1661 if ( active === null ) { 1662 active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); 1663 } 1664 1665 // no active tab, set to false 1666 if ( active === null || active === -1 ) { 1667 active = this.tabs.length ? 0 : false; 1668 } 1669 } 1670 1671 // handle numbers: negative, out of range 1672 if ( active !== false ) { 1673 active = this.tabs.index( this.tabs.eq( active ) ); 1674 if ( active === -1 ) { 1675 active = collapsible ? false : 0; 1676 } 1677 } 1678 1679 // don't allow collapsible: false and active: false 1680 if ( !collapsible && active === false && this.anchors.length ) { 1681 active = 0; 1682 } 1683 1684 return active; 1685 }, 1686 1687 _getCreateEventData: function() { 1688 return { 1689 tab: this.active, 1690 panel: !this.active.length ? $() : this._getPanelForTab( this.active ) 1691 }; 1692 }, 1693 1694 _tabKeydown: function( event ) { 1695 var focusedTab = $( this.document[0].activeElement ).closest( "li" ), 1696 selectedIndex = this.tabs.index( focusedTab ), 1697 goingForward = true; 1698 1699 if ( this._handlePageNav( event ) ) { 1700 return; 1701 } 1702 1703 switch ( event.keyCode ) { 1704 case $.ui.keyCode.RIGHT: 1705 case $.ui.keyCode.DOWN: 1706 selectedIndex++; 1707 break; 1708 case $.ui.keyCode.UP: 1709 case $.ui.keyCode.LEFT: 1710 goingForward = false; 1711 selectedIndex--; 1712 break; 1713 case $.ui.keyCode.END: 1714 selectedIndex = this.anchors.length - 1; 1715 break; 1716 case $.ui.keyCode.HOME: 1717 selectedIndex = 0; 1718 break; 1719 case $.ui.keyCode.SPACE: 1720 // Activate only, no collapsing 1721 event.preventDefault(); 1722 clearTimeout( this.activating ); 1723 this._activate( selectedIndex ); 1724 return; 1725 case $.ui.keyCode.ENTER: 1726 // Toggle (cancel delayed activation, allow collapsing) 1727 event.preventDefault(); 1728 clearTimeout( this.activating ); 1729 // Determine if we should collapse or activate 1730 this._activate( selectedIndex === this.options.active ? false : selectedIndex ); 1731 return; 1732 default: 1733 return; 1734 } 1735 1736 // Focus the appropriate tab, based on which key was pressed 1737 event.preventDefault(); 1738 clearTimeout( this.activating ); 1739 selectedIndex = this._focusNextTab( selectedIndex, goingForward ); 1740 1741 // Navigating with control/command key will prevent automatic activation 1742 if ( !event.ctrlKey && !event.metaKey ) { 1743 1744 // Update aria-selected immediately so that AT think the tab is already selected. 1745 // Otherwise AT may confuse the user by stating that they need to activate the tab, 1746 // but the tab will already be activated by the time the announcement finishes. 1747 focusedTab.attr( "aria-selected", "false" ); 1748 this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); 1749 1750 this.activating = this._delay(function() { 1751 this.option( "active", selectedIndex ); 1752 }, this.delay ); 1753 } 1754 }, 1755 1756 _panelKeydown: function( event ) { 1757 if ( this._handlePageNav( event ) ) { 1758 return; 1759 } 1760 1761 // Ctrl+up moves focus to the current tab 1762 if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { 1763 event.preventDefault(); 1764 this.active.focus(); 1765 } 1766 }, 1767 1768 // Alt+page up/down moves focus to the previous/next tab (and activates) 1769 _handlePageNav: function( event ) { 1770 if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { 1771 this._activate( this._focusNextTab( this.options.active - 1, false ) ); 1772 return true; 1773 } 1774 if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { 1775 this._activate( this._focusNextTab( this.options.active + 1, true ) ); 1776 return true; 1777 } 1778 }, 1779 1780 _findNextTab: function( index, goingForward ) { 1781 var lastTabIndex = this.tabs.length - 1; 1782 1783 function constrain() { 1784 if ( index > lastTabIndex ) { 1785 index = 0; 1786 } 1787 if ( index < 0 ) { 1788 index = lastTabIndex; 1789 } 1790 return index; 1791 } 1792 1793 while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { 1794 index = goingForward ? index + 1 : index - 1; 1795 } 1796 1797 return index; 1798 }, 1799 1800 _focusNextTab: function( index, goingForward ) { 1801 index = this._findNextTab( index, goingForward ); 1802 this.tabs.eq( index ).focus(); 1803 return index; 1804 }, 1805 1806 _setOption: function( key, value ) { 1807 if ( key === "active" ) { 1808 // _activate() will handle invalid values and update this.options 1809 this._activate( value ); 1810 return; 1811 } 1812 1813 if ( key === "disabled" ) { 1814 // don't use the widget factory's disabled handling 1815 this._setupDisabled( value ); 1816 return; 1817 } 1818 1819 this._super( key, value); 1820 1821 if ( key === "collapsible" ) { 1822 this.element.toggleClass( "ui-tabs-collapsible", value ); 1823 // Setting collapsible: false while collapsed; open first panel 1824 if ( !value && this.options.active === false ) { 1825 this._activate( 0 ); 1826 } 1827 } 1828 1829 if ( key === "event" ) { 1830 this._setupEvents( value ); 1831 } 1832 1833 if ( key === "heightStyle" ) { 1834 this._setupHeightStyle( value ); 1835 } 1836 }, 1837 1838 _sanitizeSelector: function( hash ) { 1839 return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; 1840 }, 1841 1842 refresh: function() { 1843 var options = this.options, 1844 lis = this.tablist.children( ":has(a[href])" ); 1845 1846 // get disabled tabs from class attribute from HTML 1847 // this will get converted to a boolean if needed in _refresh() 1848 options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { 1849 return lis.index( tab ); 1850 }); 1851 1852 this._processTabs(); 1853 1854 // was collapsed or no tabs 1855 if ( options.active === false || !this.anchors.length ) { 1856 options.active = false; 1857 this.active = $(); 1858 // was active, but active tab is gone 1859 } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { 1860 // all remaining tabs are disabled 1861 if ( this.tabs.length === options.disabled.length ) { 1862 options.active = false; 1863 this.active = $(); 1864 // activate previous tab 1865 } else { 1866 this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); 1867 } 1868 // was active, active tab still exists 1869 } else { 1870 // make sure active index is correct 1871 options.active = this.tabs.index( this.active ); 1872 } 1873 1874 this._refresh(); 1875 }, 1876 1877 _refresh: function() { 1878 this._setupDisabled( this.options.disabled ); 1879 this._setupEvents( this.options.event ); 1880 this._setupHeightStyle( this.options.heightStyle ); 1881 1882 this.tabs.not( this.active ).attr({ 1883 "aria-selected": "false", 1884 "aria-expanded": "false", 1885 tabIndex: -1 1886 }); 1887 this.panels.not( this._getPanelForTab( this.active ) ) 1888 .hide() 1889 .attr({ 1890 "aria-hidden": "true" 1891 }); 1892 1893 // Make sure one tab is in the tab order 1894 if ( !this.active.length ) { 1895 this.tabs.eq( 0 ).attr( "tabIndex", 0 ); 1896 } else { 1897 this.active 1898 .addClass( "ui-tabs-active ui-state-active" ) 1899 .attr({ 1900 "aria-selected": "true", 1901 "aria-expanded": "true", 1902 tabIndex: 0 1903 }); 1904 this._getPanelForTab( this.active ) 1905 .show() 1906 .attr({ 1907 "aria-hidden": "false" 1908 }); 1909 } 1910 }, 1911 1912 _processTabs: function() { 1913 var that = this, 1914 prevTabs = this.tabs, 1915 prevAnchors = this.anchors, 1916 prevPanels = this.panels; 1917 1918 this.tablist = this._getList() 1919 .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) 1920 .attr( "role", "tablist" ) 1921 1922 // Prevent users from focusing disabled tabs via click 1923 .delegate( "> li", "mousedown" + this.eventNamespace, function( event ) { 1924 if ( $( this ).is( ".ui-state-disabled" ) ) { 1925 event.preventDefault(); 1926 } 1927 }) 1928 1929 // support: IE <9 1930 // Preventing the default action in mousedown doesn't prevent IE 1931 // from focusing the element, so if the anchor gets focused, blur. 1932 // We don't have to worry about focusing the previously focused 1933 // element since clicking on a non-focusable element should focus 1934 // the body anyway. 1935 .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() { 1936 if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { 1937 this.blur(); 1938 } 1939 }); 1940 1941 this.tabs = this.tablist.find( "> li:has(a[href])" ) 1942 .addClass( "ui-state-default ui-corner-top" ) 1943 .attr({ 1944 role: "tab", 1945 tabIndex: -1 1946 }); 1947 1948 this.anchors = this.tabs.map(function() { 1949 return $( "a", this )[ 0 ]; 1950 }) 1951 .addClass( "ui-tabs-anchor" ) 1952 .attr({ 1953 role: "presentation", 1954 tabIndex: -1 1955 }); 1956 1957 this.panels = $(); 1958 1959 this.anchors.each(function( i, anchor ) { 1960 var selector, panel, panelId, 1961 anchorId = $( anchor ).uniqueId().attr( "id" ), 1962 tab = $( anchor ).closest( "li" ), 1963 originalAriaControls = tab.attr( "aria-controls" ); 1964 1965 // inline tab 1966 if ( that._isLocal( anchor ) ) { 1967 selector = anchor.hash; 1968 panelId = selector.substring( 1 ); 1969 panel = that.element.find( that._sanitizeSelector( selector ) ); 1970 // remote tab 1971 } else { 1972 // If the tab doesn't already have aria-controls, 1973 // generate an id by using a throw-away element 1974 panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id; 1975 selector = "#" + panelId; 1976 panel = that.element.find( selector ); 1977 if ( !panel.length ) { 1978 panel = that._createPanel( panelId ); 1979 panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); 1980 } 1981 panel.attr( "aria-live", "polite" ); 1982 } 1983 1984 if ( panel.length) { 1985 that.panels = that.panels.add( panel ); 1986 } 1987 if ( originalAriaControls ) { 1988 tab.data( "ui-tabs-aria-controls", originalAriaControls ); 1989 } 1990 tab.attr({ 1991 "aria-controls": panelId, 1992 "aria-labelledby": anchorId 1993 }); 1994 panel.attr( "aria-labelledby", anchorId ); 1995 }); 1996 1997 this.panels 1998 .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) 1999 .attr( "role", "tabpanel" ); 2000 2001 // Avoid memory leaks (#10056) 2002 if ( prevTabs ) { 2003 this._off( prevTabs.not( this.tabs ) ); 2004 this._off( prevAnchors.not( this.anchors ) ); 2005 this._off( prevPanels.not( this.panels ) ); 2006 } 2007 }, 2008 2009 // allow overriding how to find the list for rare usage scenarios (#7715) 2010 _getList: function() { 2011 return this.tablist || this.element.find( "ol,ul" ).eq( 0 ); 2012 }, 2013 2014 _createPanel: function( id ) { 2015 return $( "<div>" ) 2016 .attr( "id", id ) 2017 .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) 2018 .data( "ui-tabs-destroy", true ); 2019 }, 2020 2021 _setupDisabled: function( disabled ) { 2022 if ( $.isArray( disabled ) ) { 2023 if ( !disabled.length ) { 2024 disabled = false; 2025 } else if ( disabled.length === this.anchors.length ) { 2026 disabled = true; 2027 } 2028 } 2029 2030 // disable tabs 2031 for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) { 2032 if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { 2033 $( li ) 2034 .addClass( "ui-state-disabled" ) 2035 .attr( "aria-disabled", "true" ); 2036 } else { 2037 $( li ) 2038 .removeClass( "ui-state-disabled" ) 2039 .removeAttr( "aria-disabled" ); 2040 } 2041 } 2042 2043 this.options.disabled = disabled; 2044 }, 2045 2046 _setupEvents: function( event ) { 2047 var events = {}; 2048 if ( event ) { 2049 $.each( event.split(" "), function( index, eventName ) { 2050 events[ eventName ] = "_eventHandler"; 2051 }); 2052 } 2053 2054 this._off( this.anchors.add( this.tabs ).add( this.panels ) ); 2055 // Always prevent the default action, even when disabled 2056 this._on( true, this.anchors, { 2057 click: function( event ) { 2058 event.preventDefault(); 2059 } 2060 }); 2061 this._on( this.anchors, events ); 2062 this._on( this.tabs, { keydown: "_tabKeydown" } ); 2063 this._on( this.panels, { keydown: "_panelKeydown" } ); 2064 2065 this._focusable( this.tabs ); 2066 this._hoverable( this.tabs ); 2067 }, 2068 2069 _setupHeightStyle: function( heightStyle ) { 2070 var maxHeight, 2071 parent = this.element.parent(); 2072 2073 if ( heightStyle === "fill" ) { 2074 maxHeight = parent.height(); 2075 maxHeight -= this.element.outerHeight() - this.element.height(); 2076 2077 this.element.siblings( ":visible" ).each(function() { 2078 var elem = $( this ), 2079 position = elem.css( "position" ); 2080 2081 if ( position === "absolute" || position === "fixed" ) { 2082 return; 2083 } 2084 maxHeight -= elem.outerHeight( true ); 2085 }); 2086 2087 this.element.children().not( this.panels ).each(function() { 2088 maxHeight -= $( this ).outerHeight( true ); 2089 }); 2090 2091 this.panels.each(function() { 2092 $( this ).height( Math.max( 0, maxHeight - 2093 $( this ).innerHeight() + $( this ).height() ) ); 2094 }) 2095 .css( "overflow", "auto" ); 2096 } else if ( heightStyle === "auto" ) { 2097 maxHeight = 0; 2098 this.panels.each(function() { 2099 maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); 2100 }).height( maxHeight ); 2101 } 2102 }, 2103 2104 _eventHandler: function( event ) { 2105 var options = this.options, 2106 active = this.active, 2107 anchor = $( event.currentTarget ), 2108 tab = anchor.closest( "li" ), 2109 clickedIsActive = tab[ 0 ] === active[ 0 ], 2110 collapsing = clickedIsActive && options.collapsible, 2111 toShow = collapsing ? $() : this._getPanelForTab( tab ), 2112 toHide = !active.length ? $() : this._getPanelForTab( active ), 2113 eventData = { 2114 oldTab: active, 2115 oldPanel: toHide, 2116 newTab: collapsing ? $() : tab, 2117 newPanel: toShow 2118 }; 2119 2120 event.preventDefault(); 2121 2122 if ( tab.hasClass( "ui-state-disabled" ) || 2123 // tab is already loading 2124 tab.hasClass( "ui-tabs-loading" ) || 2125 // can't switch durning an animation 2126 this.running || 2127 // click on active header, but not collapsible 2128 ( clickedIsActive && !options.collapsible ) || 2129 // allow canceling activation 2130 ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { 2131 return; 2132 } 2133 2134 options.active = collapsing ? false : this.tabs.index( tab ); 2135 2136 this.active = clickedIsActive ? $() : tab; 2137 if ( this.xhr ) { 2138 this.xhr.abort(); 2139 } 2140 2141 if ( !toHide.length && !toShow.length ) { 2142 $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); 2143 } 2144 2145 if ( toShow.length ) { 2146 this.load( this.tabs.index( tab ), event ); 2147 } 2148 this._toggle( event, eventData ); 2149 }, 2150 2151 // handles show/hide for selecting tabs 2152 _toggle: function( event, eventData ) { 2153 var that = this, 2154 toShow = eventData.newPanel, 2155 toHide = eventData.oldPanel; 2156 2157 this.running = true; 2158 2159 function complete() { 2160 that.running = false; 2161 that._trigger( "activate", event, eventData ); 2162 } 2163 2164 function show() { 2165 eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); 2166 2167 if ( toShow.length && that.options.show ) { 2168 that._show( toShow, that.options.show, complete ); 2169 } else { 2170 toShow.show(); 2171 complete(); 2172 } 2173 } 2174 2175 // start out by hiding, then showing, then completing 2176 if ( toHide.length && this.options.hide ) { 2177 this._hide( toHide, this.options.hide, function() { 2178 eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); 2179 show(); 2180 }); 2181 } else { 2182 eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); 2183 toHide.hide(); 2184 show(); 2185 } 2186 2187 toHide.attr( "aria-hidden", "true" ); 2188 eventData.oldTab.attr({ 2189 "aria-selected": "false", 2190 "aria-expanded": "false" 2191 }); 2192 // If we're switching tabs, remove the old tab from the tab order. 2193 // If we're opening from collapsed state, remove the previous tab from the tab order. 2194 // If we're collapsing, then keep the collapsing tab in the tab order. 2195 if ( toShow.length && toHide.length ) { 2196 eventData.oldTab.attr( "tabIndex", -1 ); 2197 } else if ( toShow.length ) { 2198 this.tabs.filter(function() { 2199 return $( this ).attr( "tabIndex" ) === 0; 2200 }) 2201 .attr( "tabIndex", -1 ); 2202 } 2203 2204 toShow.attr( "aria-hidden", "false" ); 2205 eventData.newTab.attr({ 2206 "aria-selected": "true", 2207 "aria-expanded": "true", 2208 tabIndex: 0 2209 }); 2210 }, 2211 2212 _activate: function( index ) { 2213 var anchor, 2214 active = this._findActive( index ); 2215 2216 // trying to activate the already active panel 2217 if ( active[ 0 ] === this.active[ 0 ] ) { 2218 return; 2219 } 2220 2221 // trying to collapse, simulate a click on the current active header 2222 if ( !active.length ) { 2223 active = this.active; 2224 } 2225 2226 anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; 2227 this._eventHandler({ 2228 target: anchor, 2229 currentTarget: anchor, 2230 preventDefault: $.noop 2231 }); 2232 }, 2233 2234 _findActive: function( index ) { 2235 return index === false ? $() : this.tabs.eq( index ); 2236 }, 2237 2238 _getIndex: function( index ) { 2239 // meta-function to give users option to provide a href string instead of a numerical index. 2240 if ( typeof index === "string" ) { 2241 index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); 2242 } 2243 2244 return index; 2245 }, 2246 2247 _destroy: function() { 2248 if ( this.xhr ) { 2249 this.xhr.abort(); 2250 } 2251 2252 this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ); 2253 2254 this.tablist 2255 .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) 2256 .removeAttr( "role" ); 2257 2258 this.anchors 2259 .removeClass( "ui-tabs-anchor" ) 2260 .removeAttr( "role" ) 2261 .removeAttr( "tabIndex" ) 2262 .removeUniqueId(); 2263 2264 this.tablist.unbind( this.eventNamespace ); 2265 2266 this.tabs.add( this.panels ).each(function() { 2267 if ( $.data( this, "ui-tabs-destroy" ) ) { 2268 $( this ).remove(); 2269 } else { 2270 $( this ) 2271 .removeClass( "ui-state-default ui-state-active ui-state-disabled " + 2272 "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" ) 2273 .removeAttr( "tabIndex" ) 2274 .removeAttr( "aria-live" ) 2275 .removeAttr( "aria-busy" ) 2276 .removeAttr( "aria-selected" ) 2277 .removeAttr( "aria-labelledby" ) 2278 .removeAttr( "aria-hidden" ) 2279 .removeAttr( "aria-expanded" ) 2280 .removeAttr( "role" ); 2281 } 2282 }); 2283 2284 this.tabs.each(function() { 2285 var li = $( this ), 2286 prev = li.data( "ui-tabs-aria-controls" ); 2287 if ( prev ) { 2288 li 2289 .attr( "aria-controls", prev ) 2290 .removeData( "ui-tabs-aria-controls" ); 2291 } else { 2292 li.removeAttr( "aria-controls" ); 2293 } 2294 }); 2295 2296 this.panels.show(); 2297 2298 if ( this.options.heightStyle !== "content" ) { 2299 this.panels.css( "height", "" ); 2300 } 2301 }, 2302 2303 enable: function( index ) { 2304 var disabled = this.options.disabled; 2305 if ( disabled === false ) { 2306 return; 2307 } 2308 2309 if ( index === undefined ) { 2310 disabled = false; 2311 } else { 2312 index = this._getIndex( index ); 2313 if ( $.isArray( disabled ) ) { 2314 disabled = $.map( disabled, function( num ) { 2315 return num !== index ? num : null; 2316 }); 2317 } else { 2318 disabled = $.map( this.tabs, function( li, num ) { 2319 return num !== index ? num : null; 2320 }); 2321 } 2322 } 2323 this._setupDisabled( disabled ); 2324 }, 2325 2326 disable: function( index ) { 2327 var disabled = this.options.disabled; 2328 if ( disabled === true ) { 2329 return; 2330 } 2331 2332 if ( index === undefined ) { 2333 disabled = true; 2334 } else { 2335 index = this._getIndex( index ); 2336 if ( $.inArray( index, disabled ) !== -1 ) { 2337 return; 2338 } 2339 if ( $.isArray( disabled ) ) { 2340 disabled = $.merge( [ index ], disabled ).sort(); 2341 } else { 2342 disabled = [ index ]; 2343 } 2344 } 2345 this._setupDisabled( disabled ); 2346 }, 2347 2348 load: function( index, event ) { 2349 index = this._getIndex( index ); 2350 var that = this, 2351 tab = this.tabs.eq( index ), 2352 anchor = tab.find( ".ui-tabs-anchor" ), 2353 panel = this._getPanelForTab( tab ), 2354 eventData = { 2355 tab: tab, 2356 panel: panel 2357 }, 2358 complete = function( jqXHR, status ) { 2359 if ( status === "abort" ) { 2360 that.panels.stop( false, true ); 2361 } 2362 2363 tab.removeClass( "ui-tabs-loading" ); 2364 panel.removeAttr( "aria-busy" ); 2365 2366 if ( jqXHR === that.xhr ) { 2367 delete that.xhr; 2368 } 2369 }; 2370 2371 // not remote 2372 if ( this._isLocal( anchor[ 0 ] ) ) { 2373 return; 2374 } 2375 2376 this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); 2377 2378 // support: jQuery <1.8 2379 // jQuery <1.8 returns false if the request is canceled in beforeSend, 2380 // but as of 1.8, $.ajax() always returns a jqXHR object. 2381 if ( this.xhr && this.xhr.statusText !== "canceled" ) { 2382 tab.addClass( "ui-tabs-loading" ); 2383 panel.attr( "aria-busy", "true" ); 2384 2385 this.xhr 2386 .done(function( response, status, jqXHR ) { 2387 // support: jQuery <1.8 2388 // http://bugs.jquery.com/ticket/11778 2389 setTimeout(function() { 2390 panel.html( response ); 2391 that._trigger( "load", event, eventData ); 2392 2393 complete( jqXHR, status ); 2394 }, 1 ); 2395 }) 2396 .fail(function( jqXHR, status ) { 2397 // support: jQuery <1.8 2398 // http://bugs.jquery.com/ticket/11778 2399 setTimeout(function() { 2400 complete( jqXHR, status ); 2401 }, 1 ); 2402 }); 2403 } 2404 }, 2405 2406 _ajaxSettings: function( anchor, event, eventData ) { 2407 var that = this; 2408 return { 2409 url: anchor.attr( "href" ), 2410 beforeSend: function( jqXHR, settings ) { 2411 return that._trigger( "beforeLoad", event, 2412 $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) ); 2413 } 2414 }; 2415 }, 2416 2417 _getPanelForTab: function( tab ) { 2418 var id = $( tab ).attr( "aria-controls" ); 2419 return this.element.find( this._sanitizeSelector( "#" + id ) ); 2420 } 2421}); 2422 2423/*! 2424 * jQuery UI Accordion 1.11.4 2425 * http://jqueryui.com 2426 * 2427 * Copyright jQuery Foundation and other contributors 2428 * Released under the MIT license. 2429 * http://jquery.org/license 2430 * 2431 * http://api.jqueryui.com/accordion/ 2432 */ 2433 2434 2435var accordion = $.widget( "ui.accordion", { 2436 version: "1.11.4", 2437 options: { 2438 active: 0, 2439 animate: {}, 2440 collapsible: false, 2441 event: "click", 2442 header: "> li > :first-child,> :not(li):even", 2443 heightStyle: "auto", 2444 icons: { 2445 activeHeader: "ui-icon-triangle-1-s", 2446 header: "ui-icon-triangle-1-e" 2447 }, 2448 2449 // callbacks 2450 activate: null, 2451 beforeActivate: null 2452 }, 2453 2454 hideProps: { 2455 borderTopWidth: "hide", 2456 borderBottomWidth: "hide", 2457 paddingTop: "hide", 2458 paddingBottom: "hide", 2459 height: "hide" 2460 }, 2461 2462 showProps: { 2463 borderTopWidth: "show", 2464 borderBottomWidth: "show", 2465 paddingTop: "show", 2466 paddingBottom: "show", 2467 height: "show" 2468 }, 2469 2470 _create: function() { 2471 var options = this.options; 2472 this.prevShow = this.prevHide = $(); 2473 this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ) 2474 // ARIA 2475 .attr( "role", "tablist" ); 2476 2477 // don't allow collapsible: false and active: false / null 2478 if ( !options.collapsible && (options.active === false || options.active == null) ) { 2479 options.active = 0; 2480 } 2481 2482 this._processPanels(); 2483 // handle negative values 2484 if ( options.active < 0 ) { 2485 options.active += this.headers.length; 2486 } 2487 this._refresh(); 2488 }, 2489 2490 _getCreateEventData: function() { 2491 return { 2492 header: this.active, 2493 panel: !this.active.length ? $() : this.active.next() 2494 }; 2495 }, 2496 2497 _createIcons: function() { 2498 var icons = this.options.icons; 2499 if ( icons ) { 2500 $( "<span>" ) 2501 .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) 2502 .prependTo( this.headers ); 2503 this.active.children( ".ui-accordion-header-icon" ) 2504 .removeClass( icons.header ) 2505 .addClass( icons.activeHeader ); 2506 this.headers.addClass( "ui-accordion-icons" ); 2507 } 2508 }, 2509 2510 _destroyIcons: function() { 2511 this.headers 2512 .removeClass( "ui-accordion-icons" ) 2513 .children( ".ui-accordion-header-icon" ) 2514 .remove(); 2515 }, 2516 2517 _destroy: function() { 2518 var contents; 2519 2520 // clean up main element 2521 this.element 2522 .removeClass( "ui-accordion ui-widget ui-helper-reset" ) 2523 .removeAttr( "role" ); 2524 2525 // clean up headers 2526 this.headers 2527 .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " + 2528 "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) 2529 .removeAttr( "role" ) 2530 .removeAttr( "aria-expanded" ) 2531 .removeAttr( "aria-selected" ) 2532 .removeAttr( "aria-controls" ) 2533 .removeAttr( "tabIndex" ) 2534 .removeUniqueId(); 2535 2536 this._destroyIcons(); 2537 2538 // clean up content panels 2539 contents = this.headers.next() 2540 .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " + 2541 "ui-accordion-content ui-accordion-content-active ui-state-disabled" ) 2542 .css( "display", "" ) 2543 .removeAttr( "role" ) 2544 .removeAttr( "aria-hidden" ) 2545 .removeAttr( "aria-labelledby" ) 2546 .removeUniqueId(); 2547 2548 if ( this.options.heightStyle !== "content" ) { 2549 contents.css( "height", "" ); 2550 } 2551 }, 2552 2553 _setOption: function( key, value ) { 2554 if ( key === "active" ) { 2555 // _activate() will handle invalid values and update this.options 2556 this._activate( value ); 2557 return; 2558 } 2559 2560 if ( key === "event" ) { 2561 if ( this.options.event ) { 2562 this._off( this.headers, this.options.event ); 2563 } 2564 this._setupEvents( value ); 2565 } 2566 2567 this._super( key, value ); 2568 2569 // setting collapsible: false while collapsed; open first panel 2570 if ( key === "collapsible" && !value && this.options.active === false ) { 2571 this._activate( 0 ); 2572 } 2573 2574 if ( key === "icons" ) { 2575 this._destroyIcons(); 2576 if ( value ) { 2577 this._createIcons(); 2578 } 2579 } 2580 2581 // #5332 - opacity doesn't cascade to positioned elements in IE 2582 // so we need to add the disabled class to the headers and panels 2583 if ( key === "disabled" ) { 2584 this.element 2585 .toggleClass( "ui-state-disabled", !!value ) 2586 .attr( "aria-disabled", value ); 2587 this.headers.add( this.headers.next() ) 2588 .toggleClass( "ui-state-disabled", !!value ); 2589 } 2590 }, 2591 2592 _keydown: function( event ) { 2593 if ( event.altKey || event.ctrlKey ) { 2594 return; 2595 } 2596 2597 var keyCode = $.ui.keyCode, 2598 length = this.headers.length, 2599 currentIndex = this.headers.index( event.target ), 2600 toFocus = false; 2601 2602 switch ( event.keyCode ) { 2603 case keyCode.RIGHT: 2604 case keyCode.DOWN: 2605 toFocus = this.headers[ ( currentIndex + 1 ) % length ]; 2606 break; 2607 case keyCode.LEFT: 2608 case keyCode.UP: 2609 toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; 2610 break; 2611 case keyCode.SPACE: 2612 case keyCode.ENTER: 2613 this._eventHandler( event ); 2614 break; 2615 case keyCode.HOME: 2616 toFocus = this.headers[ 0 ]; 2617 break; 2618 case keyCode.END: 2619 toFocus = this.headers[ length - 1 ]; 2620 break; 2621 } 2622 2623 if ( toFocus ) { 2624 $( event.target ).attr( "tabIndex", -1 ); 2625 $( toFocus ).attr( "tabIndex", 0 ); 2626 toFocus.focus(); 2627 event.preventDefault(); 2628 } 2629 }, 2630 2631 _panelKeyDown: function( event ) { 2632 if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { 2633 $( event.currentTarget ).prev().focus(); 2634 } 2635 }, 2636 2637 refresh: function() { 2638 var options = this.options; 2639 this._processPanels(); 2640 2641 // was collapsed or no panel 2642 if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) { 2643 options.active = false; 2644 this.active = $(); 2645 // active false only when collapsible is true 2646 } else if ( options.active === false ) { 2647 this._activate( 0 ); 2648 // was active, but active panel is gone 2649 } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { 2650 // all remaining panel are disabled 2651 if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) { 2652 options.active = false; 2653 this.active = $(); 2654 // activate previous panel 2655 } else { 2656 this._activate( Math.max( 0, options.active - 1 ) ); 2657 } 2658 // was active, active panel still exists 2659 } else { 2660 // make sure active index is correct 2661 options.active = this.headers.index( this.active ); 2662 } 2663 2664 this._destroyIcons(); 2665 2666 this._refresh(); 2667 }, 2668 2669 _processPanels: function() { 2670 var prevHeaders = this.headers, 2671 prevPanels = this.panels; 2672 2673 this.headers = this.element.find( this.options.header ) 2674 .addClass( "ui-accordion-header ui-state-default ui-corner-all" ); 2675 2676 this.panels = this.headers.next() 2677 .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) 2678 .filter( ":not(.ui-accordion-content-active)" ) 2679 .hide(); 2680 2681 // Avoid memory leaks (#10056) 2682 if ( prevPanels ) { 2683 this._off( prevHeaders.not( this.headers ) ); 2684 this._off( prevPanels.not( this.panels ) ); 2685 } 2686 }, 2687 2688 _refresh: function() { 2689 var maxHeight, 2690 options = this.options, 2691 heightStyle = options.heightStyle, 2692 parent = this.element.parent(); 2693 2694 this.active = this._findActive( options.active ) 2695 .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) 2696 .removeClass( "ui-corner-all" ); 2697 this.active.next() 2698 .addClass( "ui-accordion-content-active" ) 2699 .show(); 2700 2701 this.headers 2702 .attr( "role", "tab" ) 2703 .each(function() { 2704 var header = $( this ), 2705 headerId = header.uniqueId().attr( "id" ), 2706 panel = header.next(), 2707 panelId = panel.uniqueId().attr( "id" ); 2708 header.attr( "aria-controls", panelId ); 2709 panel.attr( "aria-labelledby", headerId ); 2710 }) 2711 .next() 2712 .attr( "role", "tabpanel" ); 2713 2714 this.headers 2715 .not( this.active ) 2716 .attr({ 2717 "aria-selected": "false", 2718 "aria-expanded": "false", 2719 tabIndex: -1 2720 }) 2721 .next() 2722 .attr({ 2723 "aria-hidden": "true" 2724 }) 2725 .hide(); 2726 2727 // make sure at least one header is in the tab order 2728 if ( !this.active.length ) { 2729 this.headers.eq( 0 ).attr( "tabIndex", 0 ); 2730 } else { 2731 this.active.attr({ 2732 "aria-selected": "true", 2733 "aria-expanded": "true", 2734 tabIndex: 0 2735 }) 2736 .next() 2737 .attr({ 2738 "aria-hidden": "false" 2739 }); 2740 } 2741 2742 this._createIcons(); 2743 2744 this._setupEvents( options.event ); 2745 2746 if ( heightStyle === "fill" ) { 2747 maxHeight = parent.height(); 2748 this.element.siblings( ":visible" ).each(function() { 2749 var elem = $( this ), 2750 position = elem.css( "position" ); 2751 2752 if ( position === "absolute" || position === "fixed" ) { 2753 return; 2754 } 2755 maxHeight -= elem.outerHeight( true ); 2756 }); 2757 2758 this.headers.each(function() { 2759 maxHeight -= $( this ).outerHeight( true ); 2760 }); 2761 2762 this.headers.next() 2763 .each(function() { 2764 $( this ).height( Math.max( 0, maxHeight - 2765 $( this ).innerHeight() + $( this ).height() ) ); 2766 }) 2767 .css( "overflow", "auto" ); 2768 } else if ( heightStyle === "auto" ) { 2769 maxHeight = 0; 2770 this.headers.next() 2771 .each(function() { 2772 maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); 2773 }) 2774 .height( maxHeight ); 2775 } 2776 }, 2777 2778 _activate: function( index ) { 2779 var active = this._findActive( index )[ 0 ]; 2780 2781 // trying to activate the already active panel 2782 if ( active === this.active[ 0 ] ) { 2783 return; 2784 } 2785 2786 // trying to collapse, simulate a click on the currently active header 2787 active = active || this.active[ 0 ]; 2788 2789 this._eventHandler({ 2790 target: active, 2791 currentTarget: active, 2792 preventDefault: $.noop 2793 }); 2794 }, 2795 2796 _findActive: function( selector ) { 2797 return typeof selector === "number" ? this.headers.eq( selector ) : $(); 2798 }, 2799 2800 _setupEvents: function( event ) { 2801 var events = { 2802 keydown: "_keydown" 2803 }; 2804 if ( event ) { 2805 $.each( event.split( " " ), function( index, eventName ) { 2806 events[ eventName ] = "_eventHandler"; 2807 }); 2808 } 2809 2810 this._off( this.headers.add( this.headers.next() ) ); 2811 this._on( this.headers, events ); 2812 this._on( this.headers.next(), { keydown: "_panelKeyDown" }); 2813 this._hoverable( this.headers ); 2814 this._focusable( this.headers ); 2815 }, 2816 2817 _eventHandler: function( event ) { 2818 var options = this.options, 2819 active = this.active, 2820 clicked = $( event.currentTarget ), 2821 clickedIsActive = clicked[ 0 ] === active[ 0 ], 2822 collapsing = clickedIsActive && options.collapsible, 2823 toShow = collapsing ? $() : clicked.next(), 2824 toHide = active.next(), 2825 eventData = { 2826 oldHeader: active, 2827 oldPanel: toHide, 2828 newHeader: collapsing ? $() : clicked, 2829 newPanel: toShow 2830 }; 2831 2832 event.preventDefault(); 2833 2834 if ( 2835 // click on active header, but not collapsible 2836 ( clickedIsActive && !options.collapsible ) || 2837 // allow canceling activation 2838 ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { 2839 return; 2840 } 2841 2842 options.active = collapsing ? false : this.headers.index( clicked ); 2843 2844 // when the call to ._toggle() comes after the class changes 2845 // it causes a very odd bug in IE 8 (see #6720) 2846 this.active = clickedIsActive ? $() : clicked; 2847 this._toggle( eventData ); 2848 2849 // switch classes 2850 // corner classes on the previously active header stay after the animation 2851 active.removeClass( "ui-accordion-header-active ui-state-active" ); 2852 if ( options.icons ) { 2853 active.children( ".ui-accordion-header-icon" ) 2854 .removeClass( options.icons.activeHeader ) 2855 .addClass( options.icons.header ); 2856 } 2857 2858 if ( !clickedIsActive ) { 2859 clicked 2860 .removeClass( "ui-corner-all" ) 2861 .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); 2862 if ( options.icons ) { 2863 clicked.children( ".ui-accordion-header-icon" ) 2864 .removeClass( options.icons.header ) 2865 .addClass( options.icons.activeHeader ); 2866 } 2867 2868 clicked 2869 .next() 2870 .addClass( "ui-accordion-content-active" ); 2871 } 2872 }, 2873 2874 _toggle: function( data ) { 2875 var toShow = data.newPanel, 2876 toHide = this.prevShow.length ? this.prevShow : data.oldPanel; 2877 2878 // handle activating a panel during the animation for another activation 2879 this.prevShow.add( this.prevHide ).stop( true, true ); 2880 this.prevShow = toShow; 2881 this.prevHide = toHide; 2882 2883 if ( this.options.animate ) { 2884 this._animate( toShow, toHide, data ); 2885 } else { 2886 toHide.hide(); 2887 toShow.show(); 2888 this._toggleComplete( data ); 2889 } 2890 2891 toHide.attr({ 2892 "aria-hidden": "true" 2893 }); 2894 toHide.prev().attr({ 2895 "aria-selected": "false", 2896 "aria-expanded": "false" 2897 }); 2898 // if we're switching panels, remove the old header from the tab order 2899 // if we're opening from collapsed state, remove the previous header from the tab order 2900 // if we're collapsing, then keep the collapsing header in the tab order 2901 if ( toShow.length && toHide.length ) { 2902 toHide.prev().attr({ 2903 "tabIndex": -1, 2904 "aria-expanded": "false" 2905 }); 2906 } else if ( toShow.length ) { 2907 this.headers.filter(function() { 2908 return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; 2909 }) 2910 .attr( "tabIndex", -1 ); 2911 } 2912 2913 toShow 2914 .attr( "aria-hidden", "false" ) 2915 .prev() 2916 .attr({ 2917 "aria-selected": "true", 2918 "aria-expanded": "true", 2919 tabIndex: 0 2920 }); 2921 }, 2922 2923 _animate: function( toShow, toHide, data ) { 2924 var total, easing, duration, 2925 that = this, 2926 adjust = 0, 2927 boxSizing = toShow.css( "box-sizing" ), 2928 down = toShow.length && 2929 ( !toHide.length || ( toShow.index() < toHide.index() ) ), 2930 animate = this.options.animate || {}, 2931 options = down && animate.down || animate, 2932 complete = function() { 2933 that._toggleComplete( data ); 2934 }; 2935 2936 if ( typeof options === "number" ) { 2937 duration = options; 2938 } 2939 if ( typeof options === "string" ) { 2940 easing = options; 2941 } 2942 // fall back from options to animation in case of partial down settings 2943 easing = easing || options.easing || animate.easing; 2944 duration = duration || options.duration || animate.duration; 2945 2946 if ( !toHide.length ) { 2947 return toShow.animate( this.showProps, duration, easing, complete ); 2948 } 2949 if ( !toShow.length ) { 2950 return toHide.animate( this.hideProps, duration, easing, complete ); 2951 } 2952 2953 total = toShow.show().outerHeight(); 2954 toHide.animate( this.hideProps, { 2955 duration: duration, 2956 easing: easing, 2957 step: function( now, fx ) { 2958 fx.now = Math.round( now ); 2959 } 2960 }); 2961 toShow 2962 .hide() 2963 .animate( this.showProps, { 2964 duration: duration, 2965 easing: easing, 2966 complete: complete, 2967 step: function( now, fx ) { 2968 fx.now = Math.round( now ); 2969 if ( fx.prop !== "height" ) { 2970 if ( boxSizing === "content-box" ) { 2971 adjust += fx.now; 2972 } 2973 } else if ( that.options.heightStyle !== "content" ) { 2974 fx.now = Math.round( total - toHide.outerHeight() - adjust ); 2975 adjust = 0; 2976 } 2977 } 2978 }); 2979 }, 2980 2981 _toggleComplete: function( data ) { 2982 var toHide = data.oldPanel; 2983 2984 toHide 2985 .removeClass( "ui-accordion-content-active" ) 2986 .prev() 2987 .removeClass( "ui-corner-top" ) 2988 .addClass( "ui-corner-all" ); 2989 2990 // Work around for rendering bug in IE (#5421) 2991 if ( toHide.length ) { 2992 toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className; 2993 } 2994 this._trigger( "activate", null, data ); 2995 } 2996}); 2997 2998/*! 2999 * jQuery UI Effects 1.11.4 3000 * http://jqueryui.com 3001 * 3002 * Copyright jQuery Foundation and other contributors 3003 * Released under the MIT license. 3004 * http://jquery.org/license 3005 * 3006 * http://api.jqueryui.com/category/effects-core/ 3007 */ 3008 3009 3010var dataSpace = "ui-effects-", 3011 3012 // Create a local jQuery because jQuery Color relies on it and the 3013 // global may not exist with AMD and a custom build (#10199) 3014 jQuery = $; 3015 3016$.effects = { 3017 effect: {} 3018}; 3019 3020/*! 3021 * jQuery Color Animations v2.1.2 3022 * https://github.com/jquery/jquery-color 3023 * 3024 * Copyright 2014 jQuery Foundation and other contributors 3025 * Released under the MIT license. 3026 * http://jquery.org/license 3027 * 3028 * Date: Wed Jan 16 08:47:09 2013 -0600 3029 */ 3030(function( jQuery, undefined ) { 3031 3032 var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", 3033 3034 // plusequals test for += 100 -= 100 3035 rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, 3036 // a set of RE's that can match strings and generate color tuples. 3037 stringParsers = [ { 3038 re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 3039 parse: function( execResult ) { 3040 return [ 3041 execResult[ 1 ], 3042 execResult[ 2 ], 3043 execResult[ 3 ], 3044 execResult[ 4 ] 3045 ]; 3046 } 3047 }, { 3048 re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 3049 parse: function( execResult ) { 3050 return [ 3051 execResult[ 1 ] * 2.55, 3052 execResult[ 2 ] * 2.55, 3053 execResult[ 3 ] * 2.55, 3054 execResult[ 4 ] 3055 ]; 3056 } 3057 }, { 3058 // this regex ignores A-F because it's compared against an already lowercased string 3059 re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, 3060 parse: function( execResult ) { 3061 return [ 3062 parseInt( execResult[ 1 ], 16 ), 3063 parseInt( execResult[ 2 ], 16 ), 3064 parseInt( execResult[ 3 ], 16 ) 3065 ]; 3066 } 3067 }, { 3068 // this regex ignores A-F because it's compared against an already lowercased string 3069 re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, 3070 parse: function( execResult ) { 3071 return [ 3072 parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), 3073 parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), 3074 parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) 3075 ]; 3076 } 3077 }, { 3078 re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 3079 space: "hsla", 3080 parse: function( execResult ) { 3081 return [ 3082 execResult[ 1 ], 3083 execResult[ 2 ] / 100, 3084 execResult[ 3 ] / 100, 3085 execResult[ 4 ] 3086 ]; 3087 } 3088 } ], 3089 3090 // jQuery.Color( ) 3091 color = jQuery.Color = function( color, green, blue, alpha ) { 3092 return new jQuery.Color.fn.parse( color, green, blue, alpha ); 3093 }, 3094 spaces = { 3095 rgba: { 3096 props: { 3097 red: { 3098 idx: 0, 3099 type: "byte" 3100 }, 3101 green: { 3102 idx: 1, 3103 type: "byte" 3104 }, 3105 blue: { 3106 idx: 2, 3107 type: "byte" 3108 } 3109 } 3110 }, 3111 3112 hsla: { 3113 props: { 3114 hue: { 3115 idx: 0, 3116 type: "degrees" 3117 }, 3118 saturation: { 3119 idx: 1, 3120 type: "percent" 3121 }, 3122 lightness: { 3123 idx: 2, 3124 type: "percent" 3125 } 3126 } 3127 } 3128 }, 3129 propTypes = { 3130 "byte": { 3131 floor: true, 3132 max: 255 3133 }, 3134 "percent": { 3135 max: 1 3136 }, 3137 "degrees": { 3138 mod: 360, 3139 floor: true 3140 } 3141 }, 3142 support = color.support = {}, 3143 3144 // element for support tests 3145 supportElem = jQuery( "<p>" )[ 0 ], 3146 3147 // colors = jQuery.Color.names 3148 colors, 3149 3150 // local aliases of functions called often 3151 each = jQuery.each; 3152 3153// determine rgba support immediately 3154supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; 3155support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; 3156 3157// define cache name and alpha properties 3158// for rgba and hsla spaces 3159each( spaces, function( spaceName, space ) { 3160 space.cache = "_" + spaceName; 3161 space.props.alpha = { 3162 idx: 3, 3163 type: "percent", 3164 def: 1 3165 }; 3166}); 3167 3168function clamp( value, prop, allowEmpty ) { 3169 var type = propTypes[ prop.type ] || {}; 3170 3171 if ( value == null ) { 3172 return (allowEmpty || !prop.def) ? null : prop.def; 3173 } 3174 3175 // ~~ is an short way of doing floor for positive numbers 3176 value = type.floor ? ~~value : parseFloat( value ); 3177 3178 // IE will pass in empty strings as value for alpha, 3179 // which will hit this case 3180 if ( isNaN( value ) ) { 3181 return prop.def; 3182 } 3183 3184 if ( type.mod ) { 3185 // we add mod before modding to make sure that negatives values 3186 // get converted properly: -10 -> 350 3187 return (value + type.mod) % type.mod; 3188 } 3189 3190 // for now all property types without mod have min and max 3191 return 0 > value ? 0 : type.max < value ? type.max : value; 3192} 3193 3194function stringParse( string ) { 3195 var inst = color(), 3196 rgba = inst._rgba = []; 3197 3198 string = string.toLowerCase(); 3199 3200 each( stringParsers, function( i, parser ) { 3201 var parsed, 3202 match = parser.re.exec( string ), 3203 values = match && parser.parse( match ), 3204 spaceName = parser.space || "rgba"; 3205 3206 if ( values ) { 3207 parsed = inst[ spaceName ]( values ); 3208 3209 // if this was an rgba parse the assignment might happen twice 3210 // oh well.... 3211 inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; 3212 rgba = inst._rgba = parsed._rgba; 3213 3214 // exit each( stringParsers ) here because we matched 3215 return false; 3216 } 3217 }); 3218 3219 // Found a stringParser that handled it 3220 if ( rgba.length ) { 3221 3222 // if this came from a parsed string, force "transparent" when alpha is 0 3223 // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) 3224 if ( rgba.join() === "0,0,0,0" ) { 3225 jQuery.extend( rgba, colors.transparent ); 3226 } 3227 return inst; 3228 } 3229 3230 // named colors 3231 return colors[ string ]; 3232} 3233 3234color.fn = jQuery.extend( color.prototype, { 3235 parse: function( red, green, blue, alpha ) { 3236 if ( red === undefined ) { 3237 this._rgba = [ null, null, null, null ]; 3238 return this; 3239 } 3240 if ( red.jquery || red.nodeType ) { 3241 red = jQuery( red ).css( green ); 3242 green = undefined; 3243 } 3244 3245 var inst = this, 3246 type = jQuery.type( red ), 3247 rgba = this._rgba = []; 3248 3249 // more than 1 argument specified - assume ( red, green, blue, alpha ) 3250 if ( green !== undefined ) { 3251 red = [ red, green, blue, alpha ]; 3252 type = "array"; 3253 } 3254 3255 if ( type === "string" ) { 3256 return this.parse( stringParse( red ) || colors._default ); 3257 } 3258 3259 if ( type === "array" ) { 3260 each( spaces.rgba.props, function( key, prop ) { 3261 rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); 3262 }); 3263 return this; 3264 } 3265 3266 if ( type === "object" ) { 3267 if ( red instanceof color ) { 3268 each( spaces, function( spaceName, space ) { 3269 if ( red[ space.cache ] ) { 3270 inst[ space.cache ] = red[ space.cache ].slice(); 3271 } 3272 }); 3273 } else { 3274 each( spaces, function( spaceName, space ) { 3275 var cache = space.cache; 3276 each( space.props, function( key, prop ) { 3277 3278 // if the cache doesn't exist, and we know how to convert 3279 if ( !inst[ cache ] && space.to ) { 3280 3281 // if the value was null, we don't need to copy it 3282 // if the key was alpha, we don't need to copy it either 3283 if ( key === "alpha" || red[ key ] == null ) { 3284 return; 3285 } 3286 inst[ cache ] = space.to( inst._rgba ); 3287 } 3288 3289 // this is the only case where we allow nulls for ALL properties. 3290 // call clamp with alwaysAllowEmpty 3291 inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); 3292 }); 3293 3294 // everything defined but alpha? 3295 if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { 3296 // use the default of 1 3297 inst[ cache ][ 3 ] = 1; 3298 if ( space.from ) { 3299 inst._rgba = space.from( inst[ cache ] ); 3300 } 3301 } 3302 }); 3303 } 3304 return this; 3305 } 3306 }, 3307 is: function( compare ) { 3308 var is = color( compare ), 3309 same = true, 3310 inst = this; 3311 3312 each( spaces, function( _, space ) { 3313 var localCache, 3314 isCache = is[ space.cache ]; 3315 if (isCache) { 3316 localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; 3317 each( space.props, function( _, prop ) { 3318 if ( isCache[ prop.idx ] != null ) { 3319 same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); 3320 return same; 3321 } 3322 }); 3323 } 3324 return same; 3325 }); 3326 return same; 3327 }, 3328 _space: function() { 3329 var used = [], 3330 inst = this; 3331 each( spaces, function( spaceName, space ) { 3332 if ( inst[ space.cache ] ) { 3333 used.push( spaceName ); 3334 } 3335 }); 3336 return used.pop(); 3337 }, 3338 transition: function( other, distance ) { 3339 var end = color( other ), 3340 spaceName = end._space(), 3341 space = spaces[ spaceName ], 3342 startColor = this.alpha() === 0 ? color( "transparent" ) : this, 3343 start = startColor[ space.cache ] || space.to( startColor._rgba ), 3344 result = start.slice(); 3345 3346 end = end[ space.cache ]; 3347 each( space.props, function( key, prop ) { 3348 var index = prop.idx, 3349 startValue = start[ index ], 3350 endValue = end[ index ], 3351 type = propTypes[ prop.type ] || {}; 3352 3353 // if null, don't override start value 3354 if ( endValue === null ) { 3355 return; 3356 } 3357 // if null - use end 3358 if ( startValue === null ) { 3359 result[ index ] = endValue; 3360 } else { 3361 if ( type.mod ) { 3362 if ( endValue - startValue > type.mod / 2 ) { 3363 startValue += type.mod; 3364 } else if ( startValue - endValue > type.mod / 2 ) { 3365 startValue -= type.mod; 3366 } 3367 } 3368 result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); 3369 } 3370 }); 3371 return this[ spaceName ]( result ); 3372 }, 3373 blend: function( opaque ) { 3374 // if we are already opaque - return ourself 3375 if ( this._rgba[ 3 ] === 1 ) { 3376 return this; 3377 } 3378 3379 var rgb = this._rgba.slice(), 3380 a = rgb.pop(), 3381 blend = color( opaque )._rgba; 3382 3383 return color( jQuery.map( rgb, function( v, i ) { 3384 return ( 1 - a ) * blend[ i ] + a * v; 3385 })); 3386 }, 3387 toRgbaString: function() { 3388 var prefix = "rgba(", 3389 rgba = jQuery.map( this._rgba, function( v, i ) { 3390 return v == null ? ( i > 2 ? 1 : 0 ) : v; 3391 }); 3392 3393 if ( rgba[ 3 ] === 1 ) { 3394 rgba.pop(); 3395 prefix = "rgb("; 3396 } 3397 3398 return prefix + rgba.join() + ")"; 3399 }, 3400 toHslaString: function() { 3401 var prefix = "hsla(", 3402 hsla = jQuery.map( this.hsla(), function( v, i ) { 3403 if ( v == null ) { 3404 v = i > 2 ? 1 : 0; 3405 } 3406 3407 // catch 1 and 2 3408 if ( i && i < 3 ) { 3409 v = Math.round( v * 100 ) + "%"; 3410 } 3411 return v; 3412 }); 3413 3414 if ( hsla[ 3 ] === 1 ) { 3415 hsla.pop(); 3416 prefix = "hsl("; 3417 } 3418 return prefix + hsla.join() + ")"; 3419 }, 3420 toHexString: function( includeAlpha ) { 3421 var rgba = this._rgba.slice(), 3422 alpha = rgba.pop(); 3423 3424 if ( includeAlpha ) { 3425 rgba.push( ~~( alpha * 255 ) ); 3426 } 3427 3428 return "#" + jQuery.map( rgba, function( v ) { 3429 3430 // default to 0 when nulls exist 3431 v = ( v || 0 ).toString( 16 ); 3432 return v.length === 1 ? "0" + v : v; 3433 }).join(""); 3434 }, 3435 toString: function() { 3436 return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); 3437 } 3438}); 3439color.fn.parse.prototype = color.fn; 3440 3441// hsla conversions adapted from: 3442// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 3443 3444function hue2rgb( p, q, h ) { 3445 h = ( h + 1 ) % 1; 3446 if ( h * 6 < 1 ) { 3447 return p + ( q - p ) * h * 6; 3448 } 3449 if ( h * 2 < 1) { 3450 return q; 3451 } 3452 if ( h * 3 < 2 ) { 3453 return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6; 3454 } 3455 return p; 3456} 3457 3458spaces.hsla.to = function( rgba ) { 3459 if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { 3460 return [ null, null, null, rgba[ 3 ] ]; 3461 } 3462 var r = rgba[ 0 ] / 255, 3463 g = rgba[ 1 ] / 255, 3464 b = rgba[ 2 ] / 255, 3465 a = rgba[ 3 ], 3466 max = Math.max( r, g, b ), 3467 min = Math.min( r, g, b ), 3468 diff = max - min, 3469 add = max + min, 3470 l = add * 0.5, 3471 h, s; 3472 3473 if ( min === max ) { 3474 h = 0; 3475 } else if ( r === max ) { 3476 h = ( 60 * ( g - b ) / diff ) + 360; 3477 } else if ( g === max ) { 3478 h = ( 60 * ( b - r ) / diff ) + 120; 3479 } else { 3480 h = ( 60 * ( r - g ) / diff ) + 240; 3481 } 3482 3483 // chroma (diff) == 0 means greyscale which, by definition, saturation = 0% 3484 // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) 3485 if ( diff === 0 ) { 3486 s = 0; 3487 } else if ( l <= 0.5 ) { 3488 s = diff / add; 3489 } else { 3490 s = diff / ( 2 - add ); 3491 } 3492 return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; 3493}; 3494 3495spaces.hsla.from = function( hsla ) { 3496 if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { 3497 return [ null, null, null, hsla[ 3 ] ]; 3498 } 3499 var h = hsla[ 0 ] / 360, 3500 s = hsla[ 1 ], 3501 l = hsla[ 2 ], 3502 a = hsla[ 3 ], 3503 q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, 3504 p = 2 * l - q; 3505 3506 return [ 3507 Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), 3508 Math.round( hue2rgb( p, q, h ) * 255 ), 3509 Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), 3510 a 3511 ]; 3512}; 3513 3514each( spaces, function( spaceName, space ) { 3515 var props = space.props, 3516 cache = space.cache, 3517 to = space.to, 3518 from = space.from; 3519 3520 // makes rgba() and hsla() 3521 color.fn[ spaceName ] = function( value ) { 3522 3523 // generate a cache for this space if it doesn't exist 3524 if ( to && !this[ cache ] ) { 3525 this[ cache ] = to( this._rgba ); 3526 } 3527 if ( value === undefined ) { 3528 return this[ cache ].slice(); 3529 } 3530 3531 var ret, 3532 type = jQuery.type( value ), 3533 arr = ( type === "array" || type === "object" ) ? value : arguments, 3534 local = this[ cache ].slice(); 3535 3536 each( props, function( key, prop ) { 3537 var val = arr[ type === "object" ? key : prop.idx ]; 3538 if ( val == null ) { 3539 val = local[ prop.idx ]; 3540 } 3541 local[ prop.idx ] = clamp( val, prop ); 3542 }); 3543 3544 if ( from ) { 3545 ret = color( from( local ) ); 3546 ret[ cache ] = local; 3547 return ret; 3548 } else { 3549 return color( local ); 3550 } 3551 }; 3552 3553 // makes red() green() blue() alpha() hue() saturation() lightness() 3554 each( props, function( key, prop ) { 3555 // alpha is included in more than one space 3556 if ( color.fn[ key ] ) { 3557 return; 3558 } 3559 color.fn[ key ] = function( value ) { 3560 var vtype = jQuery.type( value ), 3561 fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), 3562 local = this[ fn ](), 3563 cur = local[ prop.idx ], 3564 match; 3565 3566 if ( vtype === "undefined" ) { 3567 return cur; 3568 } 3569 3570 if ( vtype === "function" ) { 3571 value = value.call( this, cur ); 3572 vtype = jQuery.type( value ); 3573 } 3574 if ( value == null && prop.empty ) { 3575 return this; 3576 } 3577 if ( vtype === "string" ) { 3578 match = rplusequals.exec( value ); 3579 if ( match ) { 3580 value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); 3581 } 3582 } 3583 local[ prop.idx ] = value; 3584 return this[ fn ]( local ); 3585 }; 3586 }); 3587}); 3588 3589// add cssHook and .fx.step function for each named hook. 3590// accept a space separated string of properties 3591color.hook = function( hook ) { 3592 var hooks = hook.split( " " ); 3593 each( hooks, function( i, hook ) { 3594 jQuery.cssHooks[ hook ] = { 3595 set: function( elem, value ) { 3596 var parsed, curElem, 3597 backgroundColor = ""; 3598 3599 if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) { 3600 value = color( parsed || value ); 3601 if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { 3602 curElem = hook === "backgroundColor" ? elem.parentNode : elem; 3603 while ( 3604 (backgroundColor === "" || backgroundColor === "transparent") && 3605 curElem && curElem.style 3606 ) { 3607 try { 3608 backgroundColor = jQuery.css( curElem, "backgroundColor" ); 3609 curElem = curElem.parentNode; 3610 } catch ( e ) { 3611 } 3612 } 3613 3614 value = value.blend( backgroundColor && backgroundColor !== "transparent" ? 3615 backgroundColor : 3616 "_default" ); 3617 } 3618 3619 value = value.toRgbaString(); 3620 } 3621 try { 3622 elem.style[ hook ] = value; 3623 } catch ( e ) { 3624 // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' 3625 } 3626 } 3627 }; 3628 jQuery.fx.step[ hook ] = function( fx ) { 3629 if ( !fx.colorInit ) { 3630 fx.start = color( fx.elem, hook ); 3631 fx.end = color( fx.end ); 3632 fx.colorInit = true; 3633 } 3634 jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); 3635 }; 3636 }); 3637 3638}; 3639 3640color.hook( stepHooks ); 3641 3642jQuery.cssHooks.borderColor = { 3643 expand: function( value ) { 3644 var expanded = {}; 3645 3646 each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { 3647 expanded[ "border" + part + "Color" ] = value; 3648 }); 3649 return expanded; 3650 } 3651}; 3652 3653// Basic color names only. 3654// Usage of any of the other color names requires adding yourself or including 3655// jquery.color.svg-names.js. 3656colors = jQuery.Color.names = { 3657 // 4.1. Basic color keywords 3658 aqua: "#00ffff", 3659 black: "#000000", 3660 blue: "#0000ff", 3661 fuchsia: "#ff00ff", 3662 gray: "#808080", 3663 green: "#008000", 3664 lime: "#00ff00", 3665 maroon: "#800000", 3666 navy: "#000080", 3667 olive: "#808000", 3668 purple: "#800080", 3669 red: "#ff0000", 3670 silver: "#c0c0c0", 3671 teal: "#008080", 3672 white: "#ffffff", 3673 yellow: "#ffff00", 3674 3675 // 4.2.3. "transparent" color keyword 3676 transparent: [ null, null, null, 0 ], 3677 3678 _default: "#ffffff" 3679}; 3680 3681})( jQuery ); 3682 3683/******************************************************************************/ 3684/****************************** CLASS ANIMATIONS ******************************/ 3685/******************************************************************************/ 3686(function() { 3687 3688var classAnimationActions = [ "add", "remove", "toggle" ], 3689 shorthandStyles = { 3690 border: 1, 3691 borderBottom: 1, 3692 borderColor: 1, 3693 borderLeft: 1, 3694 borderRight: 1, 3695 borderTop: 1, 3696 borderWidth: 1, 3697 margin: 1, 3698 padding: 1 3699 }; 3700 3701$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { 3702 $.fx.step[ prop ] = function( fx ) { 3703 if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { 3704 jQuery.style( fx.elem, prop, fx.end ); 3705 fx.setAttr = true; 3706 } 3707 }; 3708}); 3709 3710function getElementStyles( elem ) { 3711 var key, len, 3712 style = elem.ownerDocument.defaultView ? 3713 elem.ownerDocument.defaultView.getComputedStyle( elem, null ) : 3714 elem.currentStyle, 3715 styles = {}; 3716 3717 if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { 3718 len = style.length; 3719 while ( len-- ) { 3720 key = style[ len ]; 3721 if ( typeof style[ key ] === "string" ) { 3722 styles[ $.camelCase( key ) ] = style[ key ]; 3723 } 3724 } 3725 // support: Opera, IE <9 3726 } else { 3727 for ( key in style ) { 3728 if ( typeof style[ key ] === "string" ) { 3729 styles[ key ] = style[ key ]; 3730 } 3731 } 3732 } 3733 3734 return styles; 3735} 3736 3737function styleDifference( oldStyle, newStyle ) { 3738 var diff = {}, 3739 name, value; 3740 3741 for ( name in newStyle ) { 3742 value = newStyle[ name ]; 3743 if ( oldStyle[ name ] !== value ) { 3744 if ( !shorthandStyles[ name ] ) { 3745 if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { 3746 diff[ name ] = value; 3747 } 3748 } 3749 } 3750 } 3751 3752 return diff; 3753} 3754 3755// support: jQuery <1.8 3756if ( !$.fn.addBack ) { 3757 $.fn.addBack = function( selector ) { 3758 return this.add( selector == null ? 3759 this.prevObject : this.prevObject.filter( selector ) 3760 ); 3761 }; 3762} 3763 3764$.effects.animateClass = function( value, duration, easing, callback ) { 3765 var o = $.speed( duration, easing, callback ); 3766 3767 return this.queue( function() { 3768 var animated = $( this ), 3769 baseClass = animated.attr( "class" ) || "", 3770 applyClassChange, 3771 allAnimations = o.children ? animated.find( "*" ).addBack() : animated; 3772 3773 // map the animated objects to store the original styles. 3774 allAnimations = allAnimations.map(function() { 3775 var el = $( this ); 3776 return { 3777 el: el, 3778 start: getElementStyles( this ) 3779 }; 3780 }); 3781 3782 // apply class change 3783 applyClassChange = function() { 3784 $.each( classAnimationActions, function(i, action) { 3785 if ( value[ action ] ) { 3786 animated[ action + "Class" ]( value[ action ] ); 3787 } 3788 }); 3789 }; 3790 applyClassChange(); 3791 3792 // map all animated objects again - calculate new styles and diff 3793 allAnimations = allAnimations.map(function() { 3794 this.end = getElementStyles( this.el[ 0 ] ); 3795 this.diff = styleDifference( this.start, this.end ); 3796 return this; 3797 }); 3798 3799 // apply original class 3800 animated.attr( "class", baseClass ); 3801 3802 // map all animated objects again - this time collecting a promise 3803 allAnimations = allAnimations.map(function() { 3804 var styleInfo = this, 3805 dfd = $.Deferred(), 3806 opts = $.extend({}, o, { 3807 queue: false, 3808 complete: function() { 3809 dfd.resolve( styleInfo ); 3810 } 3811 }); 3812 3813 this.el.animate( this.diff, opts ); 3814 return dfd.promise(); 3815 }); 3816 3817 // once all animations have completed: 3818 $.when.apply( $, allAnimations.get() ).done(function() { 3819 3820 // set the final class 3821 applyClassChange(); 3822 3823 // for each animated element, 3824 // clear all css properties that were animated 3825 $.each( arguments, function() { 3826 var el = this.el; 3827 $.each( this.diff, function(key) { 3828 el.css( key, "" ); 3829 }); 3830 }); 3831 3832 // this is guarnteed to be there if you use jQuery.speed() 3833 // it also handles dequeuing the next anim... 3834 o.complete.call( animated[ 0 ] ); 3835 }); 3836 }); 3837}; 3838 3839$.fn.extend({ 3840 addClass: (function( orig ) { 3841 return function( classNames, speed, easing, callback ) { 3842 return speed ? 3843 $.effects.animateClass.call( this, 3844 { add: classNames }, speed, easing, callback ) : 3845 orig.apply( this, arguments ); 3846 }; 3847 })( $.fn.addClass ), 3848 3849 removeClass: (function( orig ) { 3850 return function( classNames, speed, easing, callback ) { 3851 return arguments.length > 1 ? 3852 $.effects.animateClass.call( this, 3853 { remove: classNames }, speed, easing, callback ) : 3854 orig.apply( this, arguments ); 3855 }; 3856 })( $.fn.removeClass ), 3857 3858 toggleClass: (function( orig ) { 3859 return function( classNames, force, speed, easing, callback ) { 3860 if ( typeof force === "boolean" || force === undefined ) { 3861 if ( !speed ) { 3862 // without speed parameter 3863 return orig.apply( this, arguments ); 3864 } else { 3865 return $.effects.animateClass.call( this, 3866 (force ? { add: classNames } : { remove: classNames }), 3867 speed, easing, callback ); 3868 } 3869 } else { 3870 // without force parameter 3871 return $.effects.animateClass.call( this, 3872 { toggle: classNames }, force, speed, easing ); 3873 } 3874 }; 3875 })( $.fn.toggleClass ), 3876 3877 switchClass: function( remove, add, speed, easing, callback) { 3878 return $.effects.animateClass.call( this, { 3879 add: add, 3880 remove: remove 3881 }, speed, easing, callback ); 3882 } 3883}); 3884 3885})(); 3886 3887/******************************************************************************/ 3888/*********************************** EFFECTS **********************************/ 3889/******************************************************************************/ 3890 3891(function() { 3892 3893$.extend( $.effects, { 3894 version: "1.11.4", 3895 3896 // Saves a set of properties in a data storage 3897 save: function( element, set ) { 3898 for ( var i = 0; i < set.length; i++ ) { 3899 if ( set[ i ] !== null ) { 3900 element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); 3901 } 3902 } 3903 }, 3904 3905 // Restores a set of previously saved properties from a data storage 3906 restore: function( element, set ) { 3907 var val, i; 3908 for ( i = 0; i < set.length; i++ ) { 3909 if ( set[ i ] !== null ) { 3910 val = element.data( dataSpace + set[ i ] ); 3911 // support: jQuery 1.6.2 3912 // http://bugs.jquery.com/ticket/9917 3913 // jQuery 1.6.2 incorrectly returns undefined for any falsy value. 3914 // We can't differentiate between "" and 0 here, so we just assume 3915 // empty string since it's likely to be a more common value... 3916 if ( val === undefined ) { 3917 val = ""; 3918 } 3919 element.css( set[ i ], val ); 3920 } 3921 } 3922 }, 3923 3924 setMode: function( el, mode ) { 3925 if (mode === "toggle") { 3926 mode = el.is( ":hidden" ) ? "show" : "hide"; 3927 } 3928 return mode; 3929 }, 3930 3931 // Translates a [top,left] array into a baseline value 3932 // this should be a little more flexible in the future to handle a string & hash 3933 getBaseline: function( origin, original ) { 3934 var y, x; 3935 switch ( origin[ 0 ] ) { 3936 case "top": y = 0; break; 3937 case "middle": y = 0.5; break; 3938 case "bottom": y = 1; break; 3939 default: y = origin[ 0 ] / original.height; 3940 } 3941 switch ( origin[ 1 ] ) { 3942 case "left": x = 0; break; 3943 case "center": x = 0.5; break; 3944 case "right": x = 1; break; 3945 default: x = origin[ 1 ] / original.width; 3946 } 3947 return { 3948 x: x, 3949 y: y 3950 }; 3951 }, 3952 3953 // Wraps the element around a wrapper that copies position properties 3954 createWrapper: function( element ) { 3955 3956 // if the element is already wrapped, return it 3957 if ( element.parent().is( ".ui-effects-wrapper" )) { 3958 return element.parent(); 3959 } 3960 3961 // wrap the element 3962 var props = { 3963 width: element.outerWidth(true), 3964 height: element.outerHeight(true), 3965 "float": element.css( "float" ) 3966 }, 3967 wrapper = $( "<div></div>" ) 3968 .addClass( "ui-effects-wrapper" ) 3969 .css({ 3970 fontSize: "100%", 3971 background: "transparent", 3972 border: "none", 3973 margin: 0, 3974 padding: 0 3975 }), 3976 // Store the size in case width/height are defined in % - Fixes #5245 3977 size = { 3978 width: element.width(), 3979 height: element.height() 3980 }, 3981 active = document.activeElement; 3982 3983 // support: Firefox 3984 // Firefox incorrectly exposes anonymous content 3985 // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 3986 try { 3987 active.id; 3988 } catch ( e ) { 3989 active = document.body; 3990 } 3991 3992 element.wrap( wrapper ); 3993 3994 // Fixes #7595 - Elements lose focus when wrapped. 3995 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 3996 $( active ).focus(); 3997 } 3998 3999 wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element 4000 4001 // transfer positioning properties to the wrapper 4002 if ( element.css( "position" ) === "static" ) { 4003 wrapper.css({ position: "relative" }); 4004 element.css({ position: "relative" }); 4005 } else { 4006 $.extend( props, { 4007 position: element.css( "position" ), 4008 zIndex: element.css( "z-index" ) 4009 }); 4010 $.each([ "top", "left", "bottom", "right" ], function(i, pos) { 4011 props[ pos ] = element.css( pos ); 4012 if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { 4013 props[ pos ] = "auto"; 4014 } 4015 }); 4016 element.css({ 4017 position: "relative", 4018 top: 0, 4019 left: 0, 4020 right: "auto", 4021 bottom: "auto" 4022 }); 4023 } 4024 element.css(size); 4025 4026 return wrapper.css( props ).show(); 4027 }, 4028 4029 removeWrapper: function( element ) { 4030 var active = document.activeElement; 4031 4032 if ( element.parent().is( ".ui-effects-wrapper" ) ) { 4033 element.parent().replaceWith( element ); 4034 4035 // Fixes #7595 - Elements lose focus when wrapped. 4036 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 4037 $( active ).focus(); 4038 } 4039 } 4040 4041 return element; 4042 }, 4043 4044 setTransition: function( element, list, factor, value ) { 4045 value = value || {}; 4046 $.each( list, function( i, x ) { 4047 var unit = element.cssUnit( x ); 4048 if ( unit[ 0 ] > 0 ) { 4049 value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; 4050 } 4051 }); 4052 return value; 4053 } 4054}); 4055 4056// return an effect options object for the given parameters: 4057function _normalizeArguments( effect, options, speed, callback ) { 4058 4059 // allow passing all options as the first parameter 4060 if ( $.isPlainObject( effect ) ) { 4061 options = effect; 4062 effect = effect.effect; 4063 } 4064 4065 // convert to an object 4066 effect = { effect: effect }; 4067 4068 // catch (effect, null, ...) 4069 if ( options == null ) { 4070 options = {}; 4071 } 4072 4073 // catch (effect, callback) 4074 if ( $.isFunction( options ) ) { 4075 callback = options; 4076 speed = null; 4077 options = {}; 4078 } 4079 4080 // catch (effect, speed, ?) 4081 if ( typeof options === "number" || $.fx.speeds[ options ] ) { 4082 callback = speed; 4083 speed = options; 4084 options = {}; 4085 } 4086 4087 // catch (effect, options, callback) 4088 if ( $.isFunction( speed ) ) { 4089 callback = speed; 4090 speed = null; 4091 } 4092 4093 // add options to effect 4094 if ( options ) { 4095 $.extend( effect, options ); 4096 } 4097 4098 speed = speed || options.duration; 4099 effect.duration = $.fx.off ? 0 : 4100 typeof speed === "number" ? speed : 4101 speed in $.fx.speeds ? $.fx.speeds[ speed ] : 4102 $.fx.speeds._default; 4103 4104 effect.complete = callback || options.complete; 4105 4106 return effect; 4107} 4108 4109function standardAnimationOption( option ) { 4110 // Valid standard speeds (nothing, number, named speed) 4111 if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) { 4112 return true; 4113 } 4114 4115 // Invalid strings - treat as "normal" speed 4116 if ( typeof option === "string" && !$.effects.effect[ option ] ) { 4117 return true; 4118 } 4119 4120 // Complete callback 4121 if ( $.isFunction( option ) ) { 4122 return true; 4123 } 4124 4125 // Options hash (but not naming an effect) 4126 if ( typeof option === "object" && !option.effect ) { 4127 return true; 4128 } 4129 4130 // Didn't match any standard API 4131 return false; 4132} 4133 4134$.fn.extend({ 4135 effect: function( /* effect, options, speed, callback */ ) { 4136 var args = _normalizeArguments.apply( this, arguments ), 4137 mode = args.mode, 4138 queue = args.queue, 4139 effectMethod = $.effects.effect[ args.effect ]; 4140 4141 if ( $.fx.off || !effectMethod ) { 4142 // delegate to the original method (e.g., .show()) if possible 4143 if ( mode ) { 4144 return this[ mode ]( args.duration, args.complete ); 4145 } else { 4146 return this.each( function() { 4147 if ( args.complete ) { 4148 args.complete.call( this ); 4149 } 4150 }); 4151 } 4152 } 4153 4154 function run( next ) { 4155 var elem = $( this ), 4156 complete = args.complete, 4157 mode = args.mode; 4158 4159 function done() { 4160 if ( $.isFunction( complete ) ) { 4161 complete.call( elem[0] ); 4162 } 4163 if ( $.isFunction( next ) ) { 4164 next(); 4165 } 4166 } 4167 4168 // If the element already has the correct final state, delegate to 4169 // the core methods so the internal tracking of "olddisplay" works. 4170 if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { 4171 elem[ mode ](); 4172 done(); 4173 } else { 4174 effectMethod.call( elem[0], args, done ); 4175 } 4176 } 4177 4178 return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); 4179 }, 4180 4181 show: (function( orig ) { 4182 return function( option ) { 4183 if ( standardAnimationOption( option ) ) { 4184 return orig.apply( this, arguments ); 4185 } else { 4186 var args = _normalizeArguments.apply( this, arguments ); 4187 args.mode = "show"; 4188 return this.effect.call( this, args ); 4189 } 4190 }; 4191 })( $.fn.show ), 4192 4193 hide: (function( orig ) { 4194 return function( option ) { 4195 if ( standardAnimationOption( option ) ) { 4196 return orig.apply( this, arguments ); 4197 } else { 4198 var args = _normalizeArguments.apply( this, arguments ); 4199 args.mode = "hide"; 4200 return this.effect.call( this, args ); 4201 } 4202 }; 4203 })( $.fn.hide ), 4204 4205 toggle: (function( orig ) { 4206 return function( option ) { 4207 if ( standardAnimationOption( option ) || typeof option === "boolean" ) { 4208 return orig.apply( this, arguments ); 4209 } else { 4210 var args = _normalizeArguments.apply( this, arguments ); 4211 args.mode = "toggle"; 4212 return this.effect.call( this, args ); 4213 } 4214 }; 4215 })( $.fn.toggle ), 4216 4217 // helper functions 4218 cssUnit: function(key) { 4219 var style = this.css( key ), 4220 val = []; 4221 4222 $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { 4223 if ( style.indexOf( unit ) > 0 ) { 4224 val = [ parseFloat( style ), unit ]; 4225 } 4226 }); 4227 return val; 4228 } 4229}); 4230 4231})(); 4232 4233/******************************************************************************/ 4234/*********************************** EASING ***********************************/ 4235/******************************************************************************/ 4236 4237(function() { 4238 4239// based on easing equations from Robert Penner (http://www.robertpenner.com/easing) 4240 4241var baseEasings = {}; 4242 4243$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { 4244 baseEasings[ name ] = function( p ) { 4245 return Math.pow( p, i + 2 ); 4246 }; 4247}); 4248 4249$.extend( baseEasings, { 4250 Sine: function( p ) { 4251 return 1 - Math.cos( p * Math.PI / 2 ); 4252 }, 4253 Circ: function( p ) { 4254 return 1 - Math.sqrt( 1 - p * p ); 4255 }, 4256 Elastic: function( p ) { 4257 return p === 0 || p === 1 ? p : 4258 -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 ); 4259 }, 4260 Back: function( p ) { 4261 return p * p * ( 3 * p - 2 ); 4262 }, 4263 Bounce: function( p ) { 4264 var pow2, 4265 bounce = 4; 4266 4267 while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} 4268 return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); 4269 } 4270}); 4271 4272$.each( baseEasings, function( name, easeIn ) { 4273 $.easing[ "easeIn" + name ] = easeIn; 4274 $.easing[ "easeOut" + name ] = function( p ) { 4275 return 1 - easeIn( 1 - p ); 4276 }; 4277 $.easing[ "easeInOut" + name ] = function( p ) { 4278 return p < 0.5 ? 4279 easeIn( p * 2 ) / 2 : 4280 1 - easeIn( p * -2 + 2 ) / 2; 4281 }; 4282}); 4283 4284})(); 4285 4286var effect = $.effects; 4287 4288 4289/*! 4290 * jQuery UI Effects
4290Fade 1.11.4 4291 * http://jqueryui.com 4292 * 4293 * Copyright jQuery Foundation and other contributors 4294 * Released under the MIT license. 4295 * http://jquery.org/license 4296 * 4297 * http://api.jqueryui.com/fade-effect/ 4298 */ 4299 4300 4301var effectFade = $.effects.effect.fade = function( o, done ) { 4302 var el = $( this ), 4303 mode = $.effects.setMode( el, o.mode || "toggle" ); 4304 4305 el.animate({ 4306 opacity: mode 4307 }, { 4308 queue: false, 4309 duration: o.duration, 4310 easing: o.easing,
vendor: 1,442 bytes, lines 4311-4378
4311 complete: done 4312 }); 4313}; 4314 4315 4316/*! 4317 * jQuery UI Effects Slide 1.11.4 4318 * http://jqueryui.com 4319 * 4320 * Copyright jQuery Foundation and other contributors 4321 * Released under the MIT license. 4322 * http://jquery.org/license 4323 * 4324 * http://api.jqueryui.com/slide-effect/ 4325 */ 4326 4327 4328var effectSlide = $.effects.effect.slide = function( o, done ) { 4329 4330 // Create element 4331 var el = $( this ), 4332 props = [ "position", "top", "bottom", "left", "right", "width", "height" ], 4333 mode = $.effects.setMode( el, o.mode || "show" ), 4334 show = mode === "show", 4335 direction = o.direction || "left", 4336 ref = (direction === "up" || direction === "down") ? "top" : "left", 4337 positiveMotion = (direction === "up" || direction === "left"), 4338 distance, 4339 animation = {}; 4340 4341 // Adjust 4342 $.effects.save( el, props ); 4343 el.show(); 4344 distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ); 4345 4346 $.effects.createWrapper( el ).css({ 4347 overflow: "hidden" 4348 }); 4349 4350 if ( show ) { 4351 el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance ); 4352 } 4353 4354 // Animation 4355 animation[ ref ] = ( show ? 4356 ( positiveMotion ? "+=" : "-=") : 4357 ( positiveMotion ? "-=" : "+=")) + 4358 distance; 4359 4360 // Animate 4361 el.animate( animation, { 4362 queue: false, 4363 duration: o.duration, 4364 easing: o.easing, 4365 complete: function() { 4366 if ( mode === "hide" ) { 4367 el.hide(); 4368 } 4369 $.effects.restore( el, props ); 4370 $.effects.removeWrapper( el ); 4371 done(); 4372 } 4373 }); 4374}; 4375 4376 4377 4378}));
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.