1/*! jQuery UI - v1.12.1 - 2018-01-21
vendor: 45,763 bytes, lines 1-1735
1 2* http://jqueryui.com 3* Includes: widget.js, keycode.js, widgets/mouse.js, widgets/slider.js 4* Copyright 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$.ui = $.ui || {}; 19 20var version = $.ui.version = "1.12.1"; 21 22 23/*! 24 * jQuery UI Widget 1.12.1 25 * http://jqueryui.com 26 * 27 * Copyright jQuery Foundation and other contributors 28 * Released under the MIT license. 29 * http://jquery.org/license 30 */ 31 32//>>label: Widget 33//>>group: Core 34//>>description: Provides a factory for creating stateful widgets with a common API. 35//>>docs: http://api.jqueryui.com/jQuery.widget/ 36//>>demos: http://jqueryui.com/widget/ 37 38 39 40var widgetUuid = 0; 41var widgetSlice = Array.prototype.slice; 42 43$.cleanData = ( function( orig ) { 44 return function( elems ) { 45 var events, elem, i; 46 for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { 47 try { 48 49 // Only trigger remove when necessary to save time 50 events = $._data( elem, "events" ); 51 if ( events && events.remove ) { 52 $( elem ).triggerHandler( "remove" ); 53 } 54 55 // Http://bugs.jquery.com/ticket/8235 56 } catch ( e ) {} 57 } 58 orig( elems ); 59 }; 60} )( $.cleanData ); 61 62$.widget = function( name, base, prototype ) { 63 var existingConstructor, constructor, basePrototype; 64 65 // ProxiedPrototype allows the provided prototype to remain unmodified 66 // so that it can be used as a mixin for multiple widgets (#8876) 67 var proxiedPrototype = {}; 68 69 var namespace = name.split( "." )[ 0 ]; 70 name = name.split( "." )[ 1 ]; 71 var fullName = namespace + "-" + name; 72 73 if ( !prototype ) { 74 prototype = base; 75 base = $.Widget; 76 } 77 78 if ( $.isArray( prototype ) ) { 79 prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); 80 } 81 82 // Create selector for plugin 83 $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { 84 return !!$.data( elem, fullName ); 85 }; 86 87 $[ namespace ] = $[ namespace ] || {}; 88 existingConstructor = $[ namespace ][ name ]; 89 constructor = $[ namespace ][ name ] = function( options, element ) { 90 91 // Allow instantiation without "new" keyword 92 if ( !this._createWidget ) { 93 return new constructor( options, element ); 94 } 95 96 // Allow instantiation without initializing for simple inheritance 97 // must use "new" keyword (the code above always passes args) 98 if ( arguments.length ) { 99 this._createWidget( options, element ); 100 } 101 }; 102 103 // Extend with the existing constructor to carry over any static properties 104 $.extend( constructor, existingConstructor, { 105 version: prototype.version, 106 107 // Copy the object used to create the prototype in case we need to 108 // redefine the widget later 109 _proto: $.extend( {}, prototype ), 110 111 // Track widgets that inherit from this widget in case this widget is 112 // redefined after a widget inherits from it 113 _childConstructors: [] 114 } ); 115 116 basePrototype = new base(); 117 118 // We need to make the options hash a property directly on the new instance 119 // otherwise we'll modify the options hash on the prototype that we're 120 // inheriting from 121 basePrototype.options = $.widget.extend( {}, basePrototype.options ); 122 $.each( prototype, function( prop, value ) { 123 if ( !$.isFunction( value ) ) { 124 proxiedPrototype[ prop ] = value; 125 return; 126 } 127 proxiedPrototype[ prop ] = ( function() { 128 function _super() { 129 return base.prototype[ prop ].apply( this, arguments ); 130 } 131 132 function _superApply( args ) { 133 return base.prototype[ prop ].apply( this, args ); 134 } 135 136 return function() { 137 var __super = this._super; 138 var __superApply = this._superApply; 139 var returnValue; 140 141 this._super = _super; 142 this._superApply = _superApply; 143 144 returnValue = value.apply( this, arguments ); 145 146 this._super = __super; 147 this._superApply = __superApply; 148 149 return returnValue; 150 }; 151 } )(); 152 } ); 153 constructor.prototype = $.widget.extend( basePrototype, { 154 155 // TODO: remove support for widgetEventPrefix 156 // always use the name + a colon as the prefix, e.g., draggable:start 157 // don't prefix for widgets that aren't DOM-based 158 widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name 159 }, proxiedPrototype, { 160 constructor: constructor, 161 namespace: namespace, 162 widgetName: name, 163 widgetFullName: fullName 164 } ); 165 166 // If this widget is being redefined then we need to find all widgets that 167 // are inheriting from it and redefine all of them so that they inherit from 168 // the new version of this widget. We're essentially trying to replace one 169 // level in the prototype chain. 170 if ( existingConstructor ) { 171 $.each( existingConstructor._childConstructors, function( i, child ) { 172 var childPrototype = child.prototype; 173 174 // Redefine the child widget using the same prototype that was 175 // originally used, but inherit from the new version of the base 176 $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, 177 child._proto ); 178 } ); 179 180 // Remove the list of existing child constructors from the old constructor 181 // so the old child constructors can be garbage collected 182 delete existingConstructor._childConstructors; 183 } else { 184 base._childConstructors.push( constructor ); 185 } 186 187 $.widget.bridge( name, constructor ); 188 189 return constructor; 190}; 191 192$.widget.extend = function( target ) { 193 var input = widgetSlice.call( arguments, 1 ); 194 var inputIndex = 0; 195 var inputLength = input.length; 196 var key; 197 var value; 198 199 for ( ; inputIndex < inputLength; inputIndex++ ) { 200 for ( key in input[ inputIndex ] ) { 201 value = input[ inputIndex ][ key ]; 202 if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 203 204 // Clone objects 205 if ( $.isPlainObject( value ) ) { 206 target[ key ] = $.isPlainObject( target[ key ] ) ? 207 $.widget.extend( {}, target[ key ], value ) : 208 209 // Don't extend strings, arrays, etc. with objects 210 $.widget.extend( {}, value ); 211 212 // Copy everything else by reference 213 } else { 214 target[ key ] = value; 215 } 216 } 217 } 218 } 219 return target; 220}; 221 222$.widget.bridge = function( name, object ) { 223 var fullName = object.prototype.widgetFullName || name; 224 $.fn[ name ] = function( options ) { 225 var isMethodCall = typeof options === "string"; 226 var args = widgetSlice.call( arguments, 1 ); 227 var returnValue = this; 228 229 if ( isMethodCall ) { 230 231 // If this is an empty collection, we need to have the instance method 232 // return undefined instead of the jQuery instance 233 if ( !this.length && options === "instance" ) { 234 returnValue = undefined; 235 } else { 236 this.each( function() { 237 var methodValue; 238 var instance = $.data( this, fullName ); 239 240 if ( options === "instance" ) { 241 returnValue = instance; 242 return false; 243 } 244 245 if ( !instance ) { 246 return $.error( "cannot call methods on " + name + 247 " prior to initialization; " + 248 "attempted to call method '" + options + "'" ); 249 } 250 251 if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) { 252 return $.error( "no such method '" + options + "' for " + name + 253 " widget instance" ); 254 } 255 256 methodValue = instance[ options ].apply( instance, args ); 257 258 if ( methodValue !== instance && methodValue !== undefined ) { 259 returnValue = methodValue && methodValue.jquery ? 260 returnValue.pushStack( methodValue.get() ) : 261 methodValue; 262 return false; 263 } 264 } ); 265 } 266 } else { 267 268 // Allow multiple hashes to be passed on init 269 if ( args.length ) { 270 options = $.widget.extend.apply( null, [ options ].concat( args ) ); 271 } 272 273 this.each( function() { 274 var instance = $.data( this, fullName ); 275 if ( instance ) { 276 instance.option( options || {} ); 277 if ( instance._init ) { 278 instance._init(); 279 } 280 } else { 281 $.data( this, fullName, new object( options, this ) ); 282 } 283 } ); 284 } 285 286 return returnValue; 287 }; 288}; 289 290$.Widget = function( /* options, element */ ) {}; 291$.Widget._childConstructors = []; 292 293$.Widget.prototype = { 294 widgetName: "widget", 295 widgetEventPrefix: "", 296 defaultElement: "<div>", 297 298 options: { 299 classes: {}, 300 disabled: false, 301 302 // Callbacks 303 create: null 304 }, 305 306 _createWidget: function( options, element ) { 307 element = $( element || this.defaultElement || this )[ 0 ]; 308 this.element = $( element ); 309 this.uuid = widgetUuid++; 310 this.eventNamespace = "." + this.widgetName + this.uuid; 311 312 this.bindings = $(); 313 this.hoverable = $(); 314 this.focusable = $(); 315 this.classesElementLookup = {}; 316 317 if ( element !== this ) { 318 $.data( element, this.widgetFullName, this ); 319 this._on( true, this.element, { 320 remove: function( event ) { 321 if ( event.target === element ) { 322 this.destroy(); 323 } 324 } 325 } ); 326 this.document = $( element.style ? 327 328 // Element within the document 329 element.ownerDocument : 330 331 // Element is window or document 332 element.document || element ); 333 this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); 334 } 335 336 this.options = $.widget.extend( {}, 337 this.options, 338 this._getCreateOptions(), 339 options ); 340 341 this._create(); 342 343 if ( this.options.disabled ) { 344 this._setOptionDisabled( this.options.disabled ); 345 } 346 347 this._trigger( "create", null, this._getCreateEventData() ); 348 this._init(); 349 }, 350 351 _getCreateOptions: function() { 352 return {}; 353 }, 354 355 _getCreateEventData: $.noop, 356 357 _create: $.noop, 358 359 _init: $.noop, 360 361 destroy: function() { 362 var that = this; 363 364 this._destroy(); 365 $.each( this.classesElementLookup, function( key, value ) { 366 that._removeClass( value, key ); 367 } ); 368 369 // We can probably remove the unbind calls in 2.0 370 // all event bindings should go through this._on() 371 this.element 372 .off( this.eventNamespace ) 373 .removeData( this.widgetFullName ); 374 this.widget() 375 .off( this.eventNamespace ) 376 .removeAttr( "aria-disabled" ); 377 378 // Clean up events and states 379 this.bindings.off( this.eventNamespace ); 380 }, 381 382 _destroy: $.noop, 383 384 widget: function() { 385 return this.element; 386 }, 387 388 option: function( key, value ) { 389 var options = key; 390 var parts; 391 var curOption; 392 var i; 393 394 if ( arguments.length === 0 ) { 395 396 // Don't return a reference to the internal hash 397 return $.widget.extend( {}, this.options ); 398 } 399 400 if ( typeof key === "string" ) { 401 402 // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 403 options = {}; 404 parts = key.split( "." ); 405 key = parts.shift(); 406 if ( parts.length ) { 407 curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 408 for ( i = 0; i < parts.length - 1; i++ ) { 409 curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 410 curOption = curOption[ parts[ i ] ]; 411 } 412 key = parts.pop(); 413 if ( arguments.length === 1 ) { 414 return curOption[ key ] === undefined ? null : curOption[ key ]; 415 } 416 curOption[ key ] = value; 417 } else { 418 if ( arguments.length === 1 ) { 419 return this.options[ key ] === undefined ? null : this.options[ key ]; 420 } 421 options[ key ] = value; 422 } 423 } 424 425 this._setOptions( options ); 426 427 return this; 428 }, 429 430 _setOptions: function( options ) { 431 var key; 432 433 for ( key in options ) { 434 this._setOption( key, options[ key ] ); 435 } 436 437 return this; 438 }, 439 440 _setOption: function( key, value ) { 441 if ( key === "classes" ) { 442 this._setOptionClasses( value ); 443 } 444 445 this.options[ key ] = value; 446 447 if ( key === "disabled" ) { 448 this._setOptionDisabled( value ); 449 } 450 451 return this; 452 }, 453 454 _setOptionClasses: function( value ) { 455 var classKey, elements, currentElements; 456 457 for ( classKey in value ) { 458 currentElements = this.classesElementLookup[ classKey ]; 459 if ( value[ classKey ] === this.options.classes[ classKey ] || 460 !currentElements || 461 !currentElements.length ) { 462 continue; 463 } 464 465 // We are doing this to create a new jQuery object because the _removeClass() call 466 // on the next line is going to destroy the reference to the current elements being 467 // tracked. We need to save a copy of this collection so that we can add the new classes 468 // below. 469 elements = $( currentElements.get() ); 470 this._removeClass( currentElements, classKey ); 471 472 // We don't use _addClass() here, because that uses this.options.classes 473 // for generating the string of classes. We want to use the value passed in from 474 // _setOption(), this is the new value of the classes option which was passed to 475 // _setOption(). We pass this value directly to _classes(). 476 elements.addClass( this._classes( { 477 element: elements, 478 keys: classKey, 479 classes: value, 480 add: true 481 } ) ); 482 } 483 }, 484 485 _setOptionDisabled: function( value ) { 486 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); 487 488 // If the widget is becoming disabled, then nothing is interactive 489 if ( value ) { 490 this._removeClass( this.hoverable, null, "ui-state-hover" ); 491 this._removeClass( this.focusable, null, "ui-state-focus" ); 492 } 493 }, 494 495 enable: function() { 496 return this._setOptions( { disabled: false } ); 497 }, 498 499 disable: function() { 500 return this._setOptions( { disabled: true } ); 501 }, 502 503 _classes: function( options ) { 504 var full = []; 505 var that = this; 506 507 options = $.extend( { 508 element: this.element, 509 classes: this.options.classes || {} 510 }, options ); 511 512 function processClassString( classes, checkOption ) { 513 var current, i; 514 for ( i = 0; i < classes.length; i++ ) { 515 current = that.classesElementLookup[ classes[ i ] ] || $(); 516 if ( options.add ) { 517 current = $( $.unique( current.get().concat( options.element.get() ) ) ); 518 } else { 519 current = $( current.not( options.element ).get() ); 520 } 521 that.classesElementLookup[ classes[ i ] ] = current; 522 full.push( classes[ i ] ); 523 if ( checkOption && options.classes[ classes[ i ] ] ) { 524 full.push( options.classes[ classes[ i ] ] ); 525 } 526 } 527 } 528 529 this._on( options.element, { 530 "remove": "_untrackClassesElement" 531 } ); 532 533 if ( options.keys ) { 534 processClassString( options.keys.match( /\S+/g ) || [], true ); 535 } 536 if ( options.extra ) { 537 processClassString( options.extra.match( /\S+/g ) || [] ); 538 } 539 540 return full.join( " " ); 541 }, 542 543 _untrackClassesElement: function( event ) { 544 var that = this; 545 $.each( that.classesElementLookup, function( key, value ) { 546 if ( $.inArray( event.target, value ) !== -1 ) { 547 that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); 548 } 549 } ); 550 }, 551 552 _removeClass: function( element, keys, extra ) { 553 return this._toggleClass( element, keys, extra, false ); 554 }, 555 556 _addClass: function( element, keys, extra ) { 557 return this._toggleClass( element, keys, extra, true ); 558 }, 559 560 _toggleClass: function( element, keys, extra, add ) { 561 add = ( typeof add === "boolean" ) ? add : extra; 562 var shift = ( typeof element === "string" || element === null ), 563 options = { 564 extra: shift ? keys : extra, 565 keys: shift ? element : keys, 566 element: shift ? this.element : element, 567 add: add 568 }; 569 options.element.toggleClass( this._classes( options ), add ); 570 return this; 571 }, 572 573 _on: function( suppressDisabledCheck, element, handlers ) { 574 var delegateElement; 575 var instance = this; 576 577 // No suppressDisabledCheck flag, shuffle arguments 578 if ( typeof suppressDisabledCheck !== "boolean" ) { 579 handlers = element; 580 element = suppressDisabledCheck; 581 suppressDisabledCheck = false; 582 } 583 584 // No element argument, shuffle and use this.element 585 if ( !handlers ) { 586 handlers = element; 587 element = this.element; 588 delegateElement = this.widget(); 589 } else { 590 element = delegateElement = $( element ); 591 this.bindings = this.bindings.add( element ); 592 } 593 594 $.each( handlers, function( event, handler ) { 595 function handlerProxy() { 596 597 // Allow widgets to customize the disabled handling 598 // - disabled as an array instead of boolean 599 // - disabled class as method for disabling individual parts 600 if ( !suppressDisabledCheck && 601 ( instance.options.disabled === true || 602 $( this ).hasClass( "ui-state-disabled" ) ) ) { 603 return; 604 } 605 return ( typeof handler === "string" ? instance[ handler ] : handler ) 606 .apply( instance, arguments ); 607 } 608 609 // Copy the guid so direct unbinding works 610 if ( typeof handler !== "string" ) { 611 handlerProxy.guid = handler.guid = 612 handler.guid || handlerProxy.guid || $.guid++; 613 } 614 615 var match = event.match( /^([\w:-]*)\s*(.*)$/ ); 616 var eventName = match[ 1 ] + instance.eventNamespace; 617 var selector = match[ 2 ]; 618 619 if ( selector ) { 620 delegateElement.on( eventName, selector, handlerProxy ); 621 } else { 622 element.on( eventName, handlerProxy ); 623 } 624 } ); 625 }, 626 627 _off: function( element, eventName ) { 628 eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + 629 this.eventNamespace; 630 element.off( eventName ).off( eventName ); 631 632 // Clear the stack to avoid memory leaks (#10056) 633 this.bindings = $( this.bindings.not( element ).get() ); 634 this.focusable = $( this.focusable.not( element ).get() ); 635 this.hoverable = $( this.hoverable.not( element ).get() ); 636 }, 637 638 _delay: function( handler, delay ) { 639 function handlerProxy() { 640 return ( typeof handler === "string" ? instance[ handler ] : handler ) 641 .apply( instance, arguments ); 642 } 643 var instance = this; 644 return setTimeout( handlerProxy, delay || 0 ); 645 }, 646 647 _hoverable: function( element ) { 648 this.hoverable = this.hoverable.add( element ); 649 this._on( element, { 650 mouseenter: function( event ) { 651 this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); 652 }, 653 mouseleave: function( event ) { 654 this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); 655 } 656 } ); 657 }, 658 659 _focusable: function( element ) { 660 this.focusable = this.focusable.add( element ); 661 this._on( element, { 662 focusin: function( event ) { 663 this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); 664 }, 665 focusout: function( event ) { 666 this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); 667 } 668 } ); 669 }, 670 671 _trigger: function( type, event, data ) { 672 var prop, orig; 673 var callback = this.options[ type ]; 674 675 data = data || {}; 676 event = $.Event( event ); 677 event.type = ( type === this.widgetEventPrefix ? 678 type : 679 this.widgetEventPrefix + type ).toLowerCase(); 680 681 // The original event may come from any element 682 // so we need to reset the target on the new event 683 event.target = this.element[ 0 ]; 684 685 // Copy original event properties over to the new event 686 orig = event.originalEvent; 687 if ( orig ) { 688 for ( prop in orig ) { 689 if ( !( prop in event ) ) { 690 event[ prop ] = orig[ prop ]; 691 } 692 } 693 } 694 695 this.element.trigger( event, data ); 696 return !( $.isFunction( callback ) && 697 callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || 698 event.isDefaultPrevented() ); 699 } 700}; 701 702$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 703 $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 704 if ( typeof options === "string" ) { 705 options = { effect: options }; 706 } 707 708 var hasOptions; 709 var effectName = !options ? 710 method : 711 options === true || typeof options === "number" ? 712 defaultEffect : 713 options.effect || defaultEffect; 714 715 options = options || {}; 716 if ( typeof options === "number" ) { 717 options = { duration: options }; 718 } 719 720 hasOptions = !$.isEmptyObject( options ); 721 options.complete = callback; 722 723 if ( options.delay ) { 724 element.delay( options.delay ); 725 } 726 727 if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 728 element[ method ]( options ); 729 } else if ( effectName !== method && element[ effectName ] ) { 730 element[ effectName ]( options.duration, options.easing, callback ); 731 } else { 732 element.queue( function( next ) { 733 $( this )[ method ](); 734 if ( callback ) { 735 callback.call( element[ 0 ] ); 736 } 737 next(); 738 } ); 739 } 740 }; 741} ); 742 743var widget = $.widget; 744 745 746/*! 747 * jQuery UI Keycode 1.12.1 748 * http://jqueryui.com 749 * 750 * Copyright jQuery Foundation and other contributors 751 * Released under the MIT license. 752 * http://jquery.org/license 753 */ 754 755//>>label: Keycode 756//>>group: Core 757//>>description: Provide keycodes as keynames 758//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ 759 760 761var keycode = $.ui.keyCode = { 762 BACKSPACE: 8, 763 COMMA: 188, 764 DELETE: 46, 765 DOWN: 40, 766 END: 35, 767 ENTER: 13, 768 ESCAPE: 27, 769 HOME: 36, 770 LEFT: 37, 771 PAGE_DOWN: 34, 772 PAGE_UP: 33, 773 PERIOD: 190, 774 RIGHT: 39, 775 SPACE: 32, 776 TAB: 9, 777 UP: 38 778}; 779 780 781 782 783// This file is deprecated 784var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); 785 786/*! 787 * jQuery UI Mouse 1.12.1 788 * http://jqueryui.com 789 * 790 * Copyright jQuery Foundation and other contributors 791 * Released under the MIT license. 792 * http://jquery.org/license 793 */ 794 795//>>label: Mouse 796//>>group: Widgets 797//>>description: Abstracts mouse-based interactions to assist in creating certain widgets. 798//>>docs: http://api.jqueryui.com/mouse/ 799 800 801 802var mouseHandled = false; 803$( document ).on( "mouseup", function() { 804 mouseHandled = false; 805} ); 806 807var widgetsMouse = $.widget( "ui.mouse", { 808 version: "1.12.1", 809 options: { 810 cancel: "input, textarea, button, select, option", 811 distance: 1, 812 delay: 0 813 }, 814 _mouseInit: function() { 815 var that = this; 816 817 this.element 818 .on( "mousedown." + this.widgetName, function( event ) { 819 return that._mouseDown( event ); 820 } ) 821 .on( "click." + this.widgetName, function( event ) { 822 if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) { 823 $.removeData( event.target, that.widgetName + ".preventClickEvent" ); 824 event.stopImmediatePropagation(); 825 return false; 826 } 827 } ); 828 829 this.started = false; 830 }, 831 832 // TODO: make sure destroying one instance of mouse doesn't mess with 833 // other instances of mouse 834 _mouseDestroy: function() { 835 this.element.off( "." + this.widgetName ); 836 if ( this._mouseMoveDelegate ) { 837 this.document 838 .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 839 .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 840 } 841 }, 842 843 _mouseDown: function( event ) { 844 845 // don't let more than one widget handle mouseStart 846 if ( mouseHandled ) { 847 return; 848 } 849 850 this._mouseMoved = false; 851 852 // We may have missed mouseup (out of window) 853 ( this._mouseStarted && this._mouseUp( event ) ); 854 855 this._mouseDownEvent = event; 856 857 var that = this, 858 btnIsLeft = ( event.which === 1 ), 859 860 // event.target.nodeName works around a bug in IE 8 with 861 // disabled inputs (#7620) 862 elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ? 863 $( event.target ).closest( this.options.cancel ).length : false ); 864 if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { 865 return true; 866 } 867 868 this.mouseDelayMet = !this.options.delay; 869 if ( !this.mouseDelayMet ) { 870 this._mouseDelayTimer = setTimeout( function() { 871 that.mouseDelayMet = true; 872 }, this.options.delay ); 873 } 874 875 if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 876 this._mouseStarted = ( this._mouseStart( event ) !== false ); 877 if ( !this._mouseStarted ) { 878 event.preventDefault(); 879 return true; 880 } 881 } 882 883 // Click event may never have fired (Gecko & Opera) 884 if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) { 885 $.removeData( event.target, this.widgetName + ".preventClickEvent" ); 886 } 887 888 // These delegates are required to keep context 889 this._mouseMoveDelegate = function( event ) { 890 return that._mouseMove( event ); 891 }; 892 this._mouseUpDelegate = function( event ) { 893 return that._mouseUp( event ); 894 }; 895 896 this.document 897 .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 898 .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); 899 900 event.preventDefault(); 901 902 mouseHandled = true; 903 return true; 904 }, 905 906 _mouseMove: function( event ) { 907 908 // Only check for mouseups outside the document if you've moved inside the document 909 // at least once. This prevents the firing of mouseup in the case of IE<9, which will 910 // fire a mousemove event if content is placed under the cursor. See #7778 911 // Support: IE <9 912 if ( this._mouseMoved ) { 913 914 // IE mouseup check - mouseup happened when mouse was out of window 915 if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && 916 !event.button ) { 917 return this._mouseUp( event ); 918 919 // Iframe mouseup check - mouseup occurred in another document 920 } else if ( !event.which ) { 921 922 // Support: Safari <=8 - 9 923 // Safari sets which to 0 if you press any of the following keys 924 // during a drag (#14461) 925 if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || 926 event.originalEvent.metaKey || event.originalEvent.shiftKey ) { 927 this.ignoreMissingWhich = true; 928 } else if ( !this.ignoreMissingWhich ) { 929 return this._mouseUp( event ); 930 } 931 } 932 } 933 934 if ( event.which || event.button ) { 935 this._mouseMoved = true; 936 } 937 938 if ( this._mouseStarted ) { 939 this._mouseDrag( event ); 940 return event.preventDefault(); 941 } 942 943 if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 944 this._mouseStarted = 945 ( this._mouseStart( this._mouseDownEvent, event ) !== false ); 946 ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) ); 947 } 948 949 return !this._mouseStarted; 950 }, 951 952 _mouseUp: function( event ) { 953 this.document 954 .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 955 .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 956 957 if ( this._mouseStarted ) { 958 this._mouseStarted = false; 959 960 if ( event.target === this._mouseDownEvent.target ) { 961 $.data( event.target, this.widgetName + ".preventClickEvent", true ); 962 } 963 964 this._mouseStop( event ); 965 } 966 967 if ( this._mouseDelayTimer ) { 968 clearTimeout( this._mouseDelayTimer ); 969 delete this._mouseDelayTimer; 970 } 971 972 this.ignoreMissingWhich = false; 973 mouseHandled = false; 974 event.preventDefault(); 975 }, 976 977 _mouseDistanceMet: function( event ) { 978 return ( Math.max( 979 Math.abs( this._mouseDownEvent.pageX - event.pageX ), 980 Math.abs( this._mouseDownEvent.pageY - event.pageY ) 981 ) >= this.options.distance 982 ); 983 }, 984 985 _mouseDelayMet: function( /* event */ ) { 986 return this.mouseDelayMet; 987 }, 988 989 // These are placeholder methods, to be overriden by extending plugin 990 _mouseStart: function( /* event */ ) {}, 991 _mouseDrag: function( /* event */ ) {}, 992 _mouseStop: function( /* event */ ) {}, 993 _mouseCapture: function( /* event */ ) { return true; } 994} ); 995 996 997/*! 998 * jQuery UI Slider 1.12.1 999 * http://jqueryui.com 1000 * 1001 * Copyright jQuery Foundation and other contributors 1002 * Released under the MIT license. 1003 * http://jquery.org/license 1004 */ 1005 1006//>>label: Slider 1007//>>group: Widgets 1008//>>description: Displays a flexible slider with ranges and accessibility via keyboard. 1009//>>docs: http://api.jqueryui.com/slider/ 1010//>>demos: http://jqueryui.com/slider/ 1011//>>css.structure: ../../themes/base/core.css 1012//>>css.structure: ../../themes/base/slider.css 1013//>>css.theme: ../../themes/base/theme.css 1014 1015 1016 1017var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, { 1018 version: "1.12.1", 1019 widgetEventPrefix: "slide", 1020 1021 options: { 1022 animate: false, 1023 classes: { 1024 "ui-slider": "ui-corner-all", 1025 "ui-slider-handle": "ui-corner-all", 1026 1027 // Note: ui-widget-header isn't the most fittingly semantic framework class for this 1028 // element, but worked best visually with a variety of themes 1029 "ui-slider-range": "ui-corner-all ui-widget-header" 1030 }, 1031 distance: 0, 1032 max: 100, 1033 min: 0, 1034 orientation: "horizontal", 1035 range: false, 1036 step: 1, 1037 value: 0, 1038 values: null, 1039 1040 // Callbacks 1041 change: null, 1042 slide: null, 1043 start: null, 1044 stop: null 1045 }, 1046 1047 // Number of pages in a slider 1048 // (how many times can you page up/down to go through the whole range) 1049 numPages: 5, 1050 1051 _create: function() { 1052 this._keySliding = false; 1053 this._mouseSliding = false; 1054 this._animateOff = true; 1055 this._handleIndex = null; 1056 this._detectOrientation(); 1057 this._mouseInit(); 1058 this._calculateNewMax(); 1059 1060 this._addClass( "ui-slider ui-slider-" + this.orientation, 1061 "ui-widget ui-widget-content" ); 1062 1063 this._refresh(); 1064 1065 this._animateOff = false; 1066 }, 1067 1068 _refresh: function() { 1069 this._createRange(); 1070 this._createHandles(); 1071 this._setupEvents(); 1072 this._refreshValue(); 1073 }, 1074 1075 _createHandles: function() { 1076 var i, handleCount, 1077 options = this.options, 1078 existingHandles = this.element.find( ".ui-slider-handle" ), 1079 handle = "<span tabindex='0'></span>", 1080 handles = []; 1081 1082 handleCount = ( options.values && options.values.length ) || 1; 1083 1084 if ( existingHandles.length > handleCount ) { 1085 existingHandles.slice( handleCount ).remove(); 1086 existingHandles = existingHandles.slice( 0, handleCount ); 1087 } 1088 1089 for ( i = existingHandles.length; i < handleCount; i++ ) { 1090 handles.push( handle ); 1091 } 1092 1093 this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); 1094 1095 this._addClass( this.handles, "ui-slider-handle", "ui-state-default" ); 1096 1097 this.handle = this.handles.eq( 0 ); 1098 1099 this.handles.each( function( i ) { 1100 $( this ) 1101 .data( "ui-slider-handle-index", i ) 1102 .attr( "tabIndex", 0 ); 1103 } ); 1104 }, 1105 1106 _createRange: function() { 1107 var options = this.options; 1108 1109 if ( options.range ) { 1110 if ( options.range === true ) { 1111 if ( !options.values ) { 1112 options.values = [ this._valueMin(), this._valueMin() ]; 1113 } else if ( options.values.length && options.values.length !== 2 ) { 1114 options.values = [ options.values[ 0 ], options.values[ 0 ] ]; 1115 } else if ( $.isArray( options.values ) ) { 1116 options.values = options.values.slice( 0 ); 1117 } 1118 } 1119 1120 if ( !this.range || !this.range.length ) { 1121 this.range = $( "<div>" ) 1122 .appendTo( this.element ); 1123 1124 this._addClass( this.range, "ui-slider-range" ); 1125 } else { 1126 this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" ); 1127 1128 // Handle range switching from true to min/max 1129 this.range.css( { 1130 "left": "", 1131 "bottom": "" 1132 } ); 1133 } 1134 if ( options.range === "min" || options.range === "max" ) { 1135 this._addClass( this.range, "ui-slider-range-" + options.range ); 1136 } 1137 } else { 1138 if ( this.range ) { 1139 this.range.remove(); 1140 } 1141 this.range = null; 1142 } 1143 }, 1144 1145 _setupEvents: function() { 1146 this._off( this.handles ); 1147 this._on( this.handles, this._handleEvents ); 1148 this._hoverable( this.handles ); 1149 this._focusable( this.handles ); 1150 }, 1151 1152 _destroy: function() { 1153 this.handles.remove(); 1154 if ( this.range ) { 1155 this.range.remove(); 1156 } 1157 1158 this._mouseDestroy(); 1159 }, 1160 1161 _mouseCapture: function( event ) { 1162 var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, 1163 that = this, 1164 o = this.options; 1165 1166 if ( o.disabled ) { 1167 return false; 1168 } 1169 1170 this.elementSize = { 1171 width: this.element.outerWidth(), 1172 height: this.element.outerHeight() 1173 }; 1174 this.elementOffset = this.element.offset(); 1175 1176 position = { x: event.pageX, y: event.pageY }; 1177 normValue = this._normValueFromMouse( position ); 1178 distance = this._valueMax() - this._valueMin() + 1; 1179 this.handles.each( function( i ) { 1180 var thisDistance = Math.abs( normValue - that.values( i ) ); 1181 if ( ( distance > thisDistance ) || 1182 ( distance === thisDistance && 1183 ( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) { 1184 distance = thisDistance; 1185 closestHandle = $( this ); 1186 index = i; 1187 } 1188 } ); 1189 1190 allowed = this._start( event, index ); 1191 if ( allowed === false ) { 1192 return false; 1193 } 1194 this._mouseSliding = true; 1195 1196 this._handleIndex = index; 1197 1198 this._addClass( closestHandle, null, "ui-state-active" ); 1199 closestHandle.trigger( "focus" ); 1200 1201 offset = closestHandle.offset(); 1202 mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" ); 1203 this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { 1204 left: event.pageX - offset.left - ( closestHandle.width() / 2 ), 1205 top: event.pageY - offset.top - 1206 ( closestHandle.height() / 2 ) - 1207 ( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) - 1208 ( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) + 1209 ( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 ) 1210 }; 1211 1212 if ( !this.handles.hasClass( "ui-state-hover" ) ) { 1213 this._slide( event, index, normValue ); 1214 } 1215 this._animateOff = true; 1216 return true; 1217 }, 1218 1219 _mouseStart: function() { 1220 return true; 1221 }, 1222 1223 _mouseDrag: function( event ) { 1224 var position = { x: event.pageX, y: event.pageY }, 1225 normValue = this._normValueFromMouse( position ); 1226 1227 this._slide( event, this._handleIndex, normValue ); 1228 1229 return false; 1230 }, 1231 1232 _mouseStop: function( event ) { 1233 this._removeClass( this.handles, null, "ui-state-active" ); 1234 this._mouseSliding = false; 1235 1236 this._stop( event, this._handleIndex ); 1237 this._change( event, this._handleIndex ); 1238 1239 this._handleIndex = null; 1240 this._clickOffset = null; 1241 this._animateOff = false; 1242 1243 return false; 1244 }, 1245 1246 _detectOrientation: function() { 1247 this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; 1248 }, 1249 1250 _normValueFromMouse: function( position ) { 1251 var pixelTotal, 1252 pixelMouse, 1253 percentMouse, 1254 valueTotal, 1255 valueMouse; 1256 1257 if ( this.orientation === "horizontal" ) { 1258 pixelTotal = this.elementSize.width; 1259 pixelMouse = position.x - this.elementOffset.left - 1260 ( this._clickOffset ? this._clickOffset.left : 0 ); 1261 } else { 1262 pixelTotal = this.elementSize.height; 1263 pixelMouse = position.y - this.elementOffset.top - 1264 ( this._clickOffset ? this._clickOffset.top : 0 ); 1265 } 1266 1267 percentMouse = ( pixelMouse / pixelTotal ); 1268 if ( percentMouse > 1 ) { 1269 percentMouse = 1; 1270 } 1271 if ( percentMouse < 0 ) { 1272 percentMouse = 0; 1273 } 1274 if ( this.orientation === "vertical" ) { 1275 percentMouse = 1 - percentMouse; 1276 } 1277 1278 valueTotal = this._valueMax() - this._valueMin(); 1279 valueMouse = this._valueMin() + percentMouse * valueTotal; 1280 1281 return this._trimAlignValue( valueMouse ); 1282 }, 1283 1284 _uiHash: function( index, value, values ) { 1285 var uiHash = { 1286 handle: this.handles[ index ], 1287 handleIndex: index, 1288 value: value !== undefined ? value : this.value() 1289 }; 1290 1291 if ( this._hasMultipleValues() ) { 1292 uiHash.value = value !== undefined ? value : this.values( index ); 1293 uiHash.values = values || this.values(); 1294 } 1295 1296 return uiHash; 1297 }, 1298 1299 _hasMultipleValues: function() { 1300 return this.options.values && this.options.values.length; 1301 }, 1302 1303 _start: function( event, index ) { 1304 return this._trigger( "start", event, this._uiHash( index ) ); 1305 }, 1306 1307 _slide: function( event, index, newVal ) { 1308 var allowed, otherVal, 1309 currentValue = this.value(), 1310 newValues = this.values(); 1311 1312 if ( this._hasMultipleValues() ) { 1313 otherVal = this.values( index ? 0 : 1 ); 1314 currentValue = this.values( index ); 1315 1316 if ( this.options.values.length === 2 && this.options.range === true ) { 1317 newVal = index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal ); 1318 } 1319 1320 newValues[ index ] = newVal; 1321 } 1322 1323 if ( newVal === currentValue ) { 1324 return; 1325 } 1326 1327 allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) ); 1328 1329 // A slide can be canceled by returning false from the slide callback 1330 if ( allowed === false ) { 1331 return; 1332 } 1333 1334 if ( this._hasMultipleValues() ) { 1335 this.values( index, newVal ); 1336 } else { 1337 this.value( newVal ); 1338 } 1339 }, 1340 1341 _stop: function( event, index ) { 1342 this._trigger( "stop", event, this._uiHash( index ) ); 1343 }, 1344 1345 _change: function( event, index ) { 1346 if ( !this._keySliding && !this._mouseSliding ) { 1347 1348 //store the last changed value index for reference when handles overlap 1349 this._lastChangedValue = index; 1350 this._trigger( "change", event, this._uiHash( index ) ); 1351 } 1352 }, 1353 1354 value: function( newValue ) { 1355 if ( arguments.length ) { 1356 this.options.value = this._trimAlignValue( newValue ); 1357 this._refreshValue(); 1358 this._change( null, 0 ); 1359 return; 1360 } 1361 1362 return this._value(); 1363 }, 1364 1365 values: function( index, newValue ) { 1366 var vals, 1367 newValues, 1368 i; 1369 1370 if ( arguments.length > 1 ) { 1371 this.options.values[ index ] = this._trimAlignValue( newValue ); 1372 this._refreshValue(); 1373 this._change( null, index ); 1374 return; 1375 } 1376 1377 if ( arguments.length ) { 1378 if ( $.isArray( arguments[ 0 ] ) ) { 1379 vals = this.options.values; 1380 newValues = arguments[ 0 ]; 1381 for ( i = 0; i < vals.length; i += 1 ) { 1382 vals[ i ] = this._trimAlignValue( newValues[ i ] ); 1383 this._change( null, i ); 1384 } 1385 this._refreshValue(); 1386 } else { 1387 if ( this._hasMultipleValues() ) { 1388 return this._values( index ); 1389 } else { 1390 return this.value(); 1391 } 1392 } 1393 } else { 1394 return this._values(); 1395 } 1396 }, 1397 1398 _setOption: function( key, value ) { 1399 var i, 1400 valsLength = 0; 1401 1402 if ( key === "range" && this.options.range === true ) { 1403 if ( value === "min" ) { 1404 this.options.value = this._values( 0 ); 1405 this.options.values = null; 1406 } else if ( value === "max" ) { 1407 this.options.value = this._values( this.options.values.length - 1 ); 1408 this.options.values = null; 1409 } 1410 } 1411 1412 if ( $.isArray( this.options.values ) ) { 1413 valsLength = this.options.values.length; 1414 } 1415 1416 this._super( key, value ); 1417 1418 switch ( key ) { 1419 case "orientation": 1420 this._detectOrientation(); 1421 this._removeClass( "ui-slider-horizontal ui-slider-vertical" ) 1422 ._addClass( "ui-slider-" + this.orientation ); 1423 this._refreshValue(); 1424 if ( this.options.range ) { 1425 this._refreshRange( value ); 1426 } 1427 1428 // Reset positioning from previous orientation 1429 this.handles.css( value === "horizontal" ? "bottom" : "left", "" ); 1430 break; 1431 case "value": 1432 this._animateOff = true; 1433 this._refreshValue(); 1434 this._change( null, 0 ); 1435 this._animateOff = false; 1436 break; 1437 case "values": 1438 this._animateOff = true; 1439 this._refreshValue(); 1440 1441 // Start from the last handle to prevent unreachable handles (#9046) 1442 for ( i = valsLength - 1; i >= 0; i-- ) { 1443 this._change( null, i ); 1444 } 1445 this._animateOff = false; 1446 break; 1447 case "step": 1448 case "min": 1449 case "max": 1450 this._animateOff = true; 1451 this._calculateNewMax(); 1452 this._refreshValue(); 1453 this._animateOff = false; 1454 break; 1455 case "range": 1456 this._animateOff = true; 1457 this._refresh(); 1458 this._animateOff = false; 1459 break; 1460 } 1461 }, 1462 1463 _setOptionDisabled: function( value ) { 1464 this._super( value ); 1465 1466 this._toggleClass( null, "ui-state-disabled", !!value ); 1467 }, 1468 1469 //internal value getter 1470 // _value() returns value trimmed by min and max, aligned by step 1471 _value: function() { 1472 var val = this.options.value; 1473 val = this._trimAlignValue( val ); 1474 1475 return val; 1476 }, 1477 1478 //internal values getter 1479 // _values() returns array of values trimmed by min and max, aligned by step 1480 // _values( index ) returns single value trimmed by min and max, aligned by step 1481 _values: function( index ) { 1482 var val, 1483 vals, 1484 i; 1485 1486 if ( arguments.length ) { 1487 val = this.options.values[ index ]; 1488 val = this._trimAlignValue( val ); 1489 1490 return val; 1491 } else if ( this._hasMultipleValues() ) { 1492 1493 // .slice() creates a copy of the array 1494 // this copy gets trimmed by min and max and then returned 1495 vals = this.options.values.slice(); 1496 for ( i = 0; i < vals.length; i += 1 ) { 1497 vals[ i ] = this._trimAlignValue( vals[ i ] ); 1498 } 1499 1500 return vals; 1501 } else { 1502 return []; 1503 } 1504 }, 1505 1506 // Returns the step-aligned value that val is closest to, between (inclusive) min and max 1507 _trimAlignValue: function( val ) { 1508 if ( val <= this._valueMin() ) { 1509 return this._valueMin(); 1510 } 1511 if ( val >= this._valueMax() ) { 1512 return this._valueMax(); 1513 } 1514 var step = ( this.options.step > 0 ) ? this.options.step : 1, 1515 valModStep = ( val - this._valueMin() ) % step, 1516 alignValue = val - valModStep; 1517 1518 if ( Math.abs( valModStep ) * 2 >= step ) { 1519 alignValue += ( valModStep > 0 ) ? step : ( -step ); 1520 } 1521 1522 // Since JavaScript has problems with large floats, round 1523 // the final value to 5 digits after the decimal point (see #4124) 1524 return parseFloat( alignValue.toFixed( 5 ) ); 1525 }, 1526 1527 _calculateNewMax: function() { 1528 var max = this.options.max, 1529 min = this._valueMin(), 1530 step = this.options.step, 1531 aboveMin = Math.round( ( max - min ) / step ) * step; 1532 max = aboveMin + min; 1533 if ( max > this.options.max ) { 1534 1535 //If max is not divisible by step, rounding off may increase its value 1536 max -= step; 1537 } 1538 this.max = parseFloat( max.toFixed( this._precision() ) ); 1539 }, 1540 1541 _precision: function() { 1542 var precision = this._precisionOf( this.options.step ); 1543 if ( this.options.min !== null ) { 1544 precision = Math.max( precision, this._precisionOf( this.options.min ) ); 1545 } 1546 return precision; 1547 }, 1548 1549 _precisionOf: function( num ) { 1550 var str = num.toString(), 1551 decimal = str.indexOf( "." ); 1552 return decimal === -1 ? 0 : str.length - decimal - 1; 1553 }, 1554 1555 _valueMin: function() { 1556 return this.options.min; 1557 }, 1558 1559 _valueMax: function() { 1560 return this.max; 1561 }, 1562 1563 _refreshRange: function( orientation ) { 1564 if ( orientation === "vertical" ) { 1565 this.range.css( { "width": "", "left": "" } ); 1566 } 1567 if ( orientation === "horizontal" ) { 1568 this.range.css( { "height": "", "bottom": "" } ); 1569 } 1570 }, 1571 1572 _refreshValue: function() { 1573 var lastValPercent, valPercent, value, valueMin, valueMax, 1574 oRange = this.options.range, 1575 o = this.options, 1576 that = this, 1577 animate = ( !this._animateOff ) ? o.animate : false, 1578 _set = {}; 1579 1580 if ( this._hasMultipleValues() ) { 1581 this.handles.each( function( i ) { 1582 valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() - 1583 that._valueMin() ) * 100; 1584 _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; 1585 $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); 1586 if ( that.options.range === true ) { 1587 if ( that.orientation === "horizontal" ) { 1588 if ( i === 0 ) { 1589 that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 1590 left: valPercent + "%" 1591 }, o.animate ); 1592 } 1593 if ( i === 1 ) { 1594 that.range[ animate ? "animate" : "css" ]( { 1595 width: ( valPercent - lastValPercent ) + "%" 1596 }, { 1597 queue: false, 1598 duration: o.animate 1599 } ); 1600 } 1601 } else { 1602 if ( i === 0 ) { 1603 that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 1604 bottom: ( valPercent ) + "%" 1605 }, o.animate ); 1606 } 1607 if ( i === 1 ) { 1608 that.range[ animate ? "animate" : "css" ]( { 1609 height: ( valPercent - lastValPercent ) + "%" 1610 }, { 1611 queue: false, 1612 duration: o.animate 1613 } ); 1614 } 1615 } 1616 } 1617 lastValPercent = valPercent; 1618 } ); 1619 } else { 1620 value = this.value(); 1621 valueMin = this._valueMin(); 1622 valueMax = this._valueMax(); 1623 valPercent = ( valueMax !== valueMin ) ? 1624 ( value - valueMin ) / ( valueMax - valueMin ) * 100 : 1625 0; 1626 _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; 1627 this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); 1628 1629 if ( oRange === "min" && this.orientation === "horizontal" ) { 1630 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 1631 width: valPercent + "%" 1632 }, o.animate ); 1633 } 1634 if ( oRange === "max" && this.orientation === "horizontal" ) { 1635 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 1636 width: ( 100 - valPercent ) + "%" 1637 }, o.animate ); 1638 } 1639 if ( oRange === "min" && this.orientation === "vertical" ) { 1640 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 1641 height: valPercent + "%" 1642 }, o.animate ); 1643 } 1644 if ( oRange === "max" && this.orientation === "vertical" ) { 1645 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 1646 height: ( 100 - valPercent ) + "%" 1647 }, o.animate ); 1648 } 1649 } 1650 }, 1651 1652 _handleEvents: { 1653 keydown: function( event ) { 1654 var allowed, curVal, newVal, step, 1655 index = $( event.target ).data( "ui-slider-handle-index" ); 1656 1657 switch ( event.keyCode ) { 1658 case $.ui.keyCode.HOME: 1659 case $.ui.keyCode.END: 1660 case $.ui.keyCode.PAGE_UP: 1661 case $.ui.keyCode.PAGE_DOWN: 1662 case $.ui.keyCode.UP: 1663 case $.ui.keyCode.RIGHT: 1664 case $.ui.keyCode.DOWN: 1665 case $.ui.keyCode.LEFT: 1666 event.preventDefault(); 1667 if ( !this._keySliding ) { 1668 this._keySliding = true; 1669 this._addClass( $( event.target ), null, "ui-state-active" ); 1670 allowed = this._start( event, index ); 1671 if ( allowed === false ) { 1672 return; 1673 } 1674 } 1675 break; 1676 } 1677 1678 step = this.options.step; 1679 if ( this._hasMultipleValues() ) { 1680 curVal = newVal = this.values( index ); 1681 } else { 1682 curVal = newVal = this.value(); 1683 } 1684 1685 switch ( event.keyCode ) { 1686 case $.ui.keyCode.HOME: 1687 newVal = this._valueMin(); 1688 break; 1689 case $.ui.keyCode.END: 1690 newVal = this._valueMax(); 1691 break; 1692 case $.ui.keyCode.PAGE_UP: 1693 newVal = this._trimAlignValue( 1694 curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages ) 1695 ); 1696 break; 1697 case $.ui.keyCode.PAGE_DOWN: 1698 newVal = this._trimAlignValue( 1699 curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) ); 1700 break; 1701 case $.ui.keyCode.UP: 1702 case $.ui.keyCode.RIGHT: 1703 if ( curVal === this._valueMax() ) { 1704 return; 1705 } 1706 newVal = this._trimAlignValue( curVal + step ); 1707 break; 1708 case $.ui.keyCode.DOWN: 1709 case $.ui.keyCode.LEFT: 1710 if ( curVal === this._valueMin() ) { 1711 return; 1712 } 1713 newVal = this._trimAlignValue( curVal - step ); 1714 break; 1715 } 1716 1717 this._slide( event, index, newVal ); 1718 }, 1719 keyup: function( event ) { 1720 var index = $( event.target ).data( "ui-slider-handle-index" ); 1721 1722 if ( this._keySliding ) { 1723 this._keySliding = false; 1724 this._stop( event, index ); 1725 this._change( event, index ); 1726 this._removeClass( $( event.target ), null, "ui-state-active" ); 1727 } 1728 } 1729 } 1730} ); 1731 1732 1733 1734 1735}));
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.