Dotclear

Changeset 3684:1c48f7836e8a


Ignore:
Timestamp:
01/27/18 11:56:45 (8 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Update jQuery migrate plugin from 1.3.0 to 1.4.1
Update jQuery UI (custom) from 1.11.4 to 1.12.1

Location:
admin/js/jquery
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/js/jquery/jquery-migrate.js

    r3178 r3684  
    11/*! 
    2  * jQuery Migrate - v1.3.0 - 2016-01-13 
     2 * jQuery Migrate - v1.4.1 - 2016-05-19 
    33 * Copyright jQuery Foundation and other contributors 
    44 */ 
     
    88 
    99 
    10 jQuery.migrateVersion = "1.3.0"; 
     10jQuery.migrateVersion = "1.4.1"; 
    1111 
    1212 
     
    2020 
    2121// Show a message on the console so devs know we're active 
    22 if ( !jQuery.migrateMute && window.console && window.console.log ) { 
    23      window.console.log("JQMIGRATE: Logging is active"); 
     22if ( window.console && window.console.log ) { 
     23     window.console.log( "JQMIGRATE: Migrate is installed" + 
     24          ( jQuery.migrateMute ? "" : " with logging active" ) + 
     25          ", version " + jQuery.migrateVersion ); 
    2426} 
    2527 
     
    192194var matched, browser, 
    193195     oldInit = jQuery.fn.init, 
     196     oldFind = jQuery.find, 
    194197     oldParseJSON = jQuery.parseJSON, 
    195198     rspaceAngle = /^\s*</, 
     199     rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, 
     200     rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g, 
    196201     // Note: XSS check is done below after string is trimmed 
    197202     rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/; 
     
    201206     var match, ret; 
    202207 
    203      if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) && 
    204                (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) { 
    205           // This is an HTML string according to the "old" rules; is it still? 
    206           if ( !rspaceAngle.test( selector ) ) { 
    207                migrateWarn("$(html) HTML strings must start with '<' character"); 
    208           } 
    209           if ( match[ 3 ] ) { 
    210                migrateWarn("$(html) HTML text after last tag is ignored"); 
    211           } 
    212  
    213           // Consistently reject any HTML-like string starting with a hash (#9521) 
    214           // Note that this may break jQuery 1.6.x code that otherwise would work. 
    215           if ( match[ 0 ].charAt( 0 ) === "#" ) { 
    216                migrateWarn("HTML string cannot start with a '#' character"); 
    217                jQuery.error("JQMIGRATE: Invalid selector string (XSS)"); 
    218           } 
    219           // Now process using loose rules; let pre-1.8 play too 
    220           if ( context && context.context ) { 
    221                // jQuery object as context; parseHTML expects a DOM object 
    222                context = context.context; 
    223           } 
    224           if ( jQuery.parseHTML ) { 
    225                return oldInit.call( this, 
    226                          jQuery.parseHTML( match[ 2 ], context && context.ownerDocument || 
    227                               context || document, true ), context, rootjQuery ); 
    228           } 
    229      } 
    230  
    231      // jQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0 
    232      if ( selector === "#" ) { 
    233           migrateWarn( "jQuery( '#' ) is not a valid selector" ); 
    234           selector = []; 
     208     if ( selector && typeof selector === "string" ) { 
     209          if ( !jQuery.isPlainObject( context ) && 
     210                    (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) { 
     211 
     212               // This is an HTML string according to the "old" rules; is it still? 
     213               if ( !rspaceAngle.test( selector ) ) { 
     214                    migrateWarn("$(html) HTML strings must start with '<' character"); 
     215               } 
     216               if ( match[ 3 ] ) { 
     217                    migrateWarn("$(html) HTML text after last tag is ignored"); 
     218               } 
     219 
     220               // Consistently reject any HTML-like string starting with a hash (gh-9521) 
     221               // Note that this may break jQuery 1.6.x code that otherwise would work. 
     222               if ( match[ 0 ].charAt( 0 ) === "#" ) { 
     223                    migrateWarn("HTML string cannot start with a '#' character"); 
     224                    jQuery.error("JQMIGRATE: Invalid selector string (XSS)"); 
     225               } 
     226 
     227               // Now process using loose rules; let pre-1.8 play too 
     228               // Is this a jQuery context? parseHTML expects a DOM element (#178) 
     229               if ( context && context.context && context.context.nodeType ) { 
     230                    context = context.context; 
     231               } 
     232 
     233               if ( jQuery.parseHTML ) { 
     234                    return oldInit.call( this, 
     235                              jQuery.parseHTML( match[ 2 ], context && context.ownerDocument || 
     236                                   context || document, true ), context, rootjQuery ); 
     237               } 
     238          } 
    235239     } 
    236240 
     
    253257}; 
    254258jQuery.fn.init.prototype = jQuery.fn; 
     259 
     260jQuery.find = function( selector ) { 
     261     var args = Array.prototype.slice.call( arguments ); 
     262 
     263     // Support: PhantomJS 1.x 
     264     // String#match fails to match when used with a //g RegExp, only on some strings 
     265     if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { 
     266 
     267          // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 
     268          // First see if qS thinks it's a valid selector, if so avoid a false positive 
     269          try { 
     270               document.querySelector( selector ); 
     271          } catch ( err1 ) { 
     272 
     273               // Didn't *look* valid to qSA, warn and try quoting what we think is the value 
     274               selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { 
     275                    return "[" + attr + op + "\"" + value + "\"]"; 
     276               } ); 
     277 
     278               // If the regexp *may* have created an invalid selector, don't update it 
     279               // Note that there may be false alarms if selector uses jQuery extensions 
     280               try { 
     281                    document.querySelector( selector ); 
     282                    migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); 
     283                    args[ 0 ] = selector; 
     284               } catch ( err2 ) { 
     285                    migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); 
     286               } 
     287          } 
     288     } 
     289 
     290     return oldFind.apply( this, args ); 
     291}; 
     292 
     293// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) 
     294var findProp; 
     295for ( findProp in oldFind ) { 
     296     if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { 
     297          jQuery.find[ findProp ] = oldFind[ findProp ]; 
     298     } 
     299} 
    255300 
    256301// Let $.parseJSON(falsy_value) return null 
     
    504549     jQuery.fn[ name ] = function() { 
    505550          var args = Array.prototype.slice.call( arguments, 0 ); 
    506           migrateWarn( "jQuery.fn." + name + "() is deprecated" ); 
    507551 
    508552          // If this is an ajax load() the first arg should be the string URL; 
     
    510554          // which just goes to show why this dumb signature has been deprecated! 
    511555          // jQuery custom builds that exclude the Ajax module justifiably die here. 
    512           if ( name === "load" && typeof arguments[ 0 ] === "string" ) { 
    513                return oldLoad.apply( this, arguments ); 
    514           } 
     556          if ( name === "load" && typeof args[ 0 ] === "string" ) { 
     557               return oldLoad.apply( this, args ); 
     558          } 
     559 
     560          migrateWarn( "jQuery.fn." + name + "() is deprecated" ); 
    515561 
    516562          args.splice( 0, 0, name ); 
     
    613659 
    614660jQuery.event.special.ready = { 
    615      setup: function() { migrateWarn( "'ready' event is deprecated" ); } 
     661     setup: function() { 
     662          if ( this === document ) { 
     663               migrateWarn( "'ready' event is deprecated" ); 
     664          } 
     665     } 
    616666}; 
    617667 
    618668var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack, 
    619      oldFind = jQuery.fn.find; 
     669     oldFnFind = jQuery.fn.find; 
    620670 
    621671jQuery.fn.andSelf = function() { 
     
    625675 
    626676jQuery.fn.find = function( selector ) { 
    627      var ret = oldFind.apply( this, arguments ); 
     677     var ret = oldFnFind.apply( this, arguments ); 
    628678     ret.context = this.context; 
    629679     ret.selector = this.selector ? this.selector + " " + selector : selector; 
  • admin/js/jquery/jquery-ui.custom.js

    r3178 r3684  
    1 /*! jQuery UI - v1.11.4 - 2016-02-20 
     1/*! jQuery UI - v1.12.1 - 2018-01-27 
    22* http://jqueryui.com 
    3 * Includes: core.js, widget.js, mouse.js, draggable.js, sortable.js, accordion.js 
     3* Includes: widget.js, data.js, keycode.js, scroll-parent.js, unique-id.js, widgets/draggable.js, widgets/sortable.js, widgets/accordion.js, widgets/mouse.js 
    44* Copyright jQuery Foundation and other contributors; Licensed MIT */ 
    55 
     
    1515     } 
    1616}(function( $ ) { 
     17 
     18$.ui = $.ui || {}; 
     19 
     20var version = $.ui.version = "1.12.1"; 
     21 
     22 
    1723/*! 
    18  * jQuery UI Core 1.11.4 
     24 * jQuery UI Widget 1.12.1 
    1925 * http://jqueryui.com 
    2026 * 
     
    2228 * Released under the MIT license. 
    2329 * http://jquery.org/license 
    24  * 
    25  * http://api.jqueryui.com/category/ui-core/ 
    2630 */ 
    2731 
    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 
    94 function 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  
    115 function 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 
    146 if ( !$( "<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 
    193 if ( !$.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) 
    202 if ( $( "<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  
    323 var widget_uuid = 0, 
    324      widget_slice = Array.prototype.slice; 
    325  
    326 $.cleanData = (function( orig ) { 
     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 ) { 
    32744     return function( elems ) { 
    32845          var events, elem, i; 
    329           for ( i = 0; (elem = elems[i]) != null; i++ ) { 
     46          for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { 
    33047               try { 
    33148 
     
    33653                    } 
    33754 
    338                // http://bugs.jquery.com/ticket/8235 
     55               // Http://bugs.jquery.com/ticket/8235 
    33956               } catch ( e ) {} 
    34057          } 
    34158          orig( elems ); 
    34259     }; 
    343 })( $.cleanData ); 
     60} )( $.cleanData ); 
    34461 
    34562$.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  
     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 ]; 
    35270     name = name.split( "." )[ 1 ]; 
    353      fullName = namespace + "-" + name; 
     71     var fullName = namespace + "-" + name; 
    35472 
    35573     if ( !prototype ) { 
     
    35876     } 
    35977 
    360      // create selector for plugin 
     78     if ( $.isArray( prototype ) ) { 
     79          prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); 
     80     } 
     81 
     82     // Create selector for plugin 
    36183     $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { 
    36284          return !!$.data( elem, fullName ); 
     
    36688     existingConstructor = $[ namespace ][ name ]; 
    36789     constructor = $[ namespace ][ name ] = function( options, element ) { 
    368           // allow instantiation without "new" keyword 
     90 
     91          // Allow instantiation without "new" keyword 
    36992          if ( !this._createWidget ) { 
    37093               return new constructor( options, element ); 
    37194          } 
    37295 
    373           // allow instantiation without initializing for simple inheritance 
     96          // Allow instantiation without initializing for simple inheritance 
    37497          // must use "new" keyword (the code above always passes args) 
    37598          if ( arguments.length ) { 
     
    377100          } 
    378101     }; 
    379      // extend with the existing constructor to carry over any static properties 
     102 
     103     // Extend with the existing constructor to carry over any static properties 
    380104     $.extend( constructor, existingConstructor, { 
    381105          version: prototype.version, 
    382           // copy the object used to create the prototype in case we need to 
     106 
     107          // Copy the object used to create the prototype in case we need to 
    383108          // redefine the widget later 
    384109          _proto: $.extend( {}, prototype ), 
    385           // track widgets that inherit from this widget in case this widget is 
     110 
     111          // Track widgets that inherit from this widget in case this widget is 
    386112          // redefined after a widget inherits from it 
    387113          _childConstructors: [] 
    388      }); 
     114     } ); 
    389115 
    390116     basePrototype = new base(); 
    391      // we need to make the options hash a property directly on the new instance 
     117 
     118     // We need to make the options hash a property directly on the new instance 
    392119     // otherwise we'll modify the options hash on the prototype that we're 
    393120     // inheriting from 
     
    398125               return; 
    399126          } 
    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                     }; 
     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 
    407136               return function() { 
    408                     var __super = this._super, 
    409                          __superApply = this._superApply, 
    410                          returnValue; 
     137                    var __super = this._super; 
     138                    var __superApply = this._superApply; 
     139                    var returnValue; 
    411140 
    412141                    this._super = _super; 
     
    420149                    return returnValue; 
    421150               }; 
    422           })(); 
    423      }); 
     151          } )(); 
     152     } ); 
    424153     constructor.prototype = $.widget.extend( basePrototype, { 
     154 
    425155          // TODO: remove support for widgetEventPrefix 
    426156          // always use the name + a colon as the prefix, e.g., draggable:start 
    427157          // don't prefix for widgets that aren't DOM-based 
    428           widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name 
     158          widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name 
    429159     }, proxiedPrototype, { 
    430160          constructor: constructor, 
     
    432162          widgetName: name, 
    433163          widgetFullName: fullName 
    434      }); 
     164     } ); 
    435165 
    436166     // If this widget is being redefined then we need to find all widgets that 
     
    442172               var childPrototype = child.prototype; 
    443173 
    444                // redefine the child widget using the same prototype that was 
     174               // Redefine the child widget using the same prototype that was 
    445175               // 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 
     176               $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, 
     177                    child._proto ); 
     178          } ); 
     179 
     180          // Remove the list of existing child constructors from the old constructor 
    449181          // so the old child constructors can be garbage collected 
    450182          delete existingConstructor._childConstructors; 
     
    459191 
    460192$.widget.extend = function( target ) { 
    461      var input = widget_slice.call( arguments, 1 ), 
    462           inputIndex = 0, 
    463           inputLength = input.length, 
    464           key, 
    465           value; 
     193     var input = widgetSlice.call( arguments, 1 ); 
     194     var inputIndex = 0; 
     195     var inputLength = input.length; 
     196     var key; 
     197     var value; 
     198 
    466199     for ( ; inputIndex < inputLength; inputIndex++ ) { 
    467200          for ( key in input[ inputIndex ] ) { 
    468201               value = input[ inputIndex ][ key ]; 
    469202               if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 
     203 
    470204                    // Clone objects 
    471205                    if ( $.isPlainObject( value ) ) { 
    472206                         target[ key ] = $.isPlainObject( target[ key ] ) ? 
    473207                              $.widget.extend( {}, target[ key ], value ) : 
     208 
    474209                              // Don't extend strings, arrays, etc. with objects 
    475210                              $.widget.extend( {}, value ); 
     211 
    476212                    // Copy everything else by reference 
    477213                    } else { 
     
    487223     var fullName = object.prototype.widgetFullName || name; 
    488224     $.fn[ name ] = function( options ) { 
    489           var isMethodCall = typeof options === "string", 
    490                args = widget_slice.call( arguments, 1 ), 
    491                returnValue = this; 
     225          var isMethodCall = typeof options === "string"; 
     226          var args = widgetSlice.call( arguments, 1 ); 
     227          var returnValue = this; 
    492228 
    493229          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                }); 
     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               } 
    516266          } else { 
    517267 
    518268               // Allow multiple hashes to be passed on init 
    519269               if ( args.length ) { 
    520                     options = $.widget.extend.apply( null, [ options ].concat(args) ); 
    521                } 
    522  
    523                this.each(function() { 
     270                    options = $.widget.extend.apply( null, [ options ].concat( args ) ); 
     271               } 
     272 
     273               this.each( function() { 
    524274                    var instance = $.data( this, fullName ); 
    525275                    if ( instance ) { 
     
    531281                         $.data( this, fullName, new object( options, this ) ); 
    532282                    } 
    533                }); 
     283               } ); 
    534284          } 
    535285 
     
    545295     widgetEventPrefix: "", 
    546296     defaultElement: "<div>", 
     297 
    547298     options: { 
     299          classes: {}, 
    548300          disabled: false, 
    549301 
    550           // callbacks 
     302          // Callbacks 
    551303          create: null 
    552304     }, 
     305 
    553306     _createWidget: function( options, element ) { 
    554307          element = $( element || this.defaultElement || this )[ 0 ]; 
    555308          this.element = $( element ); 
    556           this.uuid = widget_uuid++; 
     309          this.uuid = widgetUuid++; 
    557310          this.eventNamespace = "." + this.widgetName + this.uuid; 
    558311 
     
    560313          this.hoverable = $(); 
    561314          this.focusable = $(); 
     315          this.classesElementLookup = {}; 
    562316 
    563317          if ( element !== this ) { 
     
    569323                         } 
    570324                    } 
    571                }); 
     325               } ); 
    572326               this.document = $( element.style ? 
    573                     // element within the document 
     327 
     328                    // Element within the document 
    574329                    element.ownerDocument : 
    575                     // element is window or document 
     330 
     331                    // Element is window or document 
    576332                    element.document || element ); 
    577                this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); 
     333               this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); 
    578334          } 
    579335 
     
    584340 
    585341          this._create(); 
     342 
     343          if ( this.options.disabled ) { 
     344               this._setOptionDisabled( this.options.disabled ); 
     345          } 
     346 
    586347          this._trigger( "create", null, this._getCreateEventData() ); 
    587348          this._init(); 
    588349     }, 
    589      _getCreateOptions: $.noop, 
     350 
     351     _getCreateOptions: function() { 
     352          return {}; 
     353     }, 
     354 
    590355     _getCreateEventData: $.noop, 
     356 
    591357     _create: $.noop, 
     358 
    592359     _init: $.noop, 
    593360 
    594361     destroy: function() { 
     362          var that = this; 
     363 
    595364          this._destroy(); 
    596           // we can probably remove the unbind calls in 2.0 
     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 
    597370          // all event bindings should go through this._on() 
    598371          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 ) ); 
     372               .off( this.eventNamespace ) 
     373               .removeData( this.widgetFullName ); 
    604374          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      }, 
     375               .off( this.eventNamespace ) 
     376               .removeAttr( "aria-disabled" ); 
     377 
     378          // Clean up events and states 
     379          this.bindings.off( this.eventNamespace ); 
     380     }, 
     381 
    616382     _destroy: $.noop, 
    617383 
     
    621387 
    622388     option: function( key, value ) { 
    623           var options = key, 
    624                parts, 
    625                curOption, 
    626                i; 
     389          var options = key; 
     390          var parts; 
     391          var curOption; 
     392          var i; 
    627393 
    628394          if ( arguments.length === 0 ) { 
    629                // don't return a reference to the internal hash 
     395 
     396               // Don't return a reference to the internal hash 
    630397               return $.widget.extend( {}, this.options ); 
    631398          } 
    632399 
    633400          if ( typeof key === "string" ) { 
    634                // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 
     401 
     402               // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 
    635403               options = {}; 
    636404               parts = key.split( "." ); 
     
    659427          return this; 
    660428     }, 
     429 
    661430     _setOptions: function( options ) { 
    662431          var key; 
     
    668437          return this; 
    669438     }, 
     439 
    670440     _setOption: function( key, value ) { 
     441          if ( key === "classes" ) { 
     442               this._setOptionClasses( value ); 
     443          } 
     444 
    671445          this.options[ key ] = value; 
    672446 
    673447          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                } 
     448               this._setOptionDisabled( value ); 
    682449          } 
    683450 
     
    685452     }, 
    686453 
     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 
    687495     enable: function() { 
    688           return this._setOptions({ disabled: false }); 
    689      }, 
     496          return this._setOptions( { disabled: false } ); 
     497     }, 
     498 
    690499     disable: function() { 
    691           return this._setOptions({ disabled: true }); 
     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; 
    692571     }, 
    693572 
    694573     _on: function( suppressDisabledCheck, element, handlers ) { 
    695           var delegateElement, 
    696                instance = this; 
    697  
    698           // no suppressDisabledCheck flag, shuffle arguments 
     574          var delegateElement; 
     575          var instance = this; 
     576 
     577          // No suppressDisabledCheck flag, shuffle arguments 
    699578          if ( typeof suppressDisabledCheck !== "boolean" ) { 
    700579               handlers = element; 
     
    703582          } 
    704583 
    705           // no element argument, shuffle and use this.element 
     584          // No element argument, shuffle and use this.element 
    706585          if ( !handlers ) { 
    707586               handlers = element; 
     
    715594          $.each( handlers, function( event, handler ) { 
    716595               function handlerProxy() { 
    717                     // allow widgets to customize the disabled handling 
     596 
     597                    // Allow widgets to customize the disabled handling 
    718598                    // - disabled as an array instead of boolean 
    719599                    // - disabled class as method for disabling individual parts 
    720600                    if ( !suppressDisabledCheck && 
    721601                              ( instance.options.disabled === true || 
    722                                    $( this ).hasClass( "ui-state-disabled" ) ) ) { 
     602                              $( this ).hasClass( "ui-state-disabled" ) ) ) { 
    723603                         return; 
    724604                    } 
     
    727607               } 
    728608 
    729                // copy the guid so direct unbinding works 
     609               // Copy the guid so direct unbinding works 
    730610               if ( typeof handler !== "string" ) { 
    731611                    handlerProxy.guid = handler.guid = 
     
    733613               } 
    734614 
    735                var match = event.match( /^([\w:-]*)\s*(.*)$/ ), 
    736                     eventName = match[1] + instance.eventNamespace, 
    737                     selector = match[2]; 
     615               var match = event.match( /^([\w:-]*)\s*(.*)$/ ); 
     616               var eventName = match[ 1 ] + instance.eventNamespace; 
     617               var selector = match[ 2 ]; 
     618 
    738619               if ( selector ) { 
    739                     delegateElement.delegate( selector, eventName, handlerProxy ); 
     620                    delegateElement.on( eventName, selector, handlerProxy ); 
    740621               } else { 
    741                     element.bind( eventName, handlerProxy ); 
    742                } 
    743           }); 
     622                    element.on( eventName, handlerProxy ); 
     623               } 
     624          } ); 
    744625     }, 
    745626 
    746627     _off: function( element, eventName ) { 
    747           eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + 
     628          eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + 
    748629               this.eventNamespace; 
    749           element.unbind( eventName ).undelegate( eventName ); 
     630          element.off( eventName ).off( eventName ); 
    750631 
    751632          // Clear the stack to avoid memory leaks (#10056) 
     
    768649          this._on( element, { 
    769650               mouseenter: function( event ) { 
    770                     $( event.currentTarget ).addClass( "ui-state-hover" ); 
     651                    this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); 
    771652               }, 
    772653               mouseleave: function( event ) { 
    773                     $( event.currentTarget ).removeClass( "ui-state-hover" ); 
    774                } 
    775           }); 
     654                    this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); 
     655               } 
     656          } ); 
    776657     }, 
    777658 
     
    780661          this._on( element, { 
    781662               focusin: function( event ) { 
    782                     $( event.currentTarget ).addClass( "ui-state-focus" ); 
     663                    this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); 
    783664               }, 
    784665               focusout: function( event ) { 
    785                     $( event.currentTarget ).removeClass( "ui-state-focus" ); 
    786                } 
    787           }); 
     666                    this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); 
     667               } 
     668          } ); 
    788669     }, 
    789670 
    790671     _trigger: function( type, event, data ) { 
    791           var prop, orig, 
    792                callback = this.options[ type ]; 
     672          var prop, orig; 
     673          var callback = this.options[ type ]; 
    793674 
    794675          data = data || {}; 
     
    797678               type : 
    798679               this.widgetEventPrefix + type ).toLowerCase(); 
    799           // the original event may come from any element 
     680 
     681          // The original event may come from any element 
    800682          // so we need to reset the target on the new event 
    801683          event.target = this.element[ 0 ]; 
    802684 
    803           // copy original event properties over to the new event 
     685          // Copy original event properties over to the new event 
    804686          orig = event.originalEvent; 
    805687          if ( orig ) { 
     
    813695          this.element.trigger( event, data ); 
    814696          return !( $.isFunction( callback ) && 
    815                callback.apply( this.element[0], [ event ].concat( data ) ) === false || 
     697               callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || 
    816698               event.isDefaultPrevented() ); 
    817699     } 
     
    823705               options = { effect: options }; 
    824706          } 
    825           var hasOptions, 
    826                effectName = !options ? 
    827                     method : 
    828                     options === true || typeof options === "number" ? 
    829                          defaultEffect : 
    830                          options.effect || defaultEffect; 
     707 
     708          var hasOptions; 
     709          var effectName = !options ? 
     710               method : 
     711               options === true || typeof options === "number" ? 
     712                    defaultEffect : 
     713                    options.effect || defaultEffect; 
     714 
    831715          options = options || {}; 
    832716          if ( typeof options === "number" ) { 
    833717               options = { duration: options }; 
    834718          } 
     719 
    835720          hasOptions = !$.isEmptyObject( options ); 
    836721          options.complete = callback; 
     722 
    837723          if ( options.delay ) { 
    838724               element.delay( options.delay ); 
    839725          } 
     726 
    840727          if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 
    841728               element[ method ]( options ); 
     
    843730               element[ effectName ]( options.duration, options.easing, callback ); 
    844731          } else { 
    845                element.queue(function( next ) { 
     732               element.queue( function( next ) { 
    846733                    $( this )[ method ](); 
    847734                    if ( callback ) { 
     
    849736                    } 
    850737                    next(); 
    851                }); 
     738               } ); 
    852739          } 
    853740     }; 
    854 }); 
     741} ); 
    855742 
    856743var widget = $.widget; 
     
    858745 
    859746/*! 
    860  * jQuery UI Mouse 1.11.4 
     747 * jQuery UI :data 1.12.1 
    861748 * http://jqueryui.com 
    862749 * 
     
    864751 * Released under the MIT license. 
    865752 * http://jquery.org/license 
     753 */ 
     754 
     755//>>label: :data Selector 
     756//>>group: Core 
     757//>>description: Selects elements which have data stored under the specified key. 
     758//>>docs: http://api.jqueryui.com/data-selector/ 
     759 
     760 
     761var data = $.extend( $.expr[ ":" ], { 
     762     data: $.expr.createPseudo ? 
     763          $.expr.createPseudo( function( dataName ) { 
     764               return function( elem ) { 
     765                    return !!$.data( elem, dataName ); 
     766               }; 
     767          } ) : 
     768 
     769          // Support: jQuery <1.8 
     770          function( elem, i, match ) { 
     771               return !!$.data( elem, match[ 3 ] ); 
     772          } 
     773} ); 
     774 
     775/*! 
     776 * jQuery UI Keycode 1.12.1 
     777 * http://jqueryui.com 
    866778 * 
    867  * http://api.jqueryui.com/mouse/ 
     779 * Copyright jQuery Foundation and other contributors 
     780 * Released under the MIT license. 
     781 * http://jquery.org/license 
    868782 */ 
    869783 
     784//>>label: Keycode 
     785//>>group: Core 
     786//>>description: Provide keycodes as keynames 
     787//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ 
     788 
     789 
     790var keycode = $.ui.keyCode = { 
     791     BACKSPACE: 8, 
     792     COMMA: 188, 
     793     DELETE: 46, 
     794     DOWN: 40, 
     795     END: 35, 
     796     ENTER: 13, 
     797     ESCAPE: 27, 
     798     HOME: 36, 
     799     LEFT: 37, 
     800     PAGE_DOWN: 34, 
     801     PAGE_UP: 33, 
     802     PERIOD: 190, 
     803     RIGHT: 39, 
     804     SPACE: 32, 
     805     TAB: 9, 
     806     UP: 38 
     807}; 
     808 
     809 
     810/*! 
     811 * jQuery UI Scroll Parent 1.12.1 
     812 * http://jqueryui.com 
     813 * 
     814 * Copyright jQuery Foundation and other contributors 
     815 * Released under the MIT license. 
     816 * http://jquery.org/license 
     817 */ 
     818 
     819//>>label: scrollParent 
     820//>>group: Core 
     821//>>description: Get the closest ancestor element that is scrollable. 
     822//>>docs: http://api.jqueryui.com/scrollParent/ 
     823 
     824 
     825 
     826var scrollParent = $.fn.scrollParent = function( includeHidden ) { 
     827     var position = this.css( "position" ), 
     828          excludeStaticParent = position === "absolute", 
     829          overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, 
     830          scrollParent = this.parents().filter( function() { 
     831               var parent = $( this ); 
     832               if ( excludeStaticParent && parent.css( "position" ) === "static" ) { 
     833                    return false; 
     834               } 
     835               return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + 
     836                    parent.css( "overflow-x" ) ); 
     837          } ).eq( 0 ); 
     838 
     839     return position === "fixed" || !scrollParent.length ? 
     840          $( this[ 0 ].ownerDocument || document ) : 
     841          scrollParent; 
     842}; 
     843 
     844 
     845/*! 
     846 * jQuery UI Unique ID 1.12.1 
     847 * http://jqueryui.com 
     848 * 
     849 * Copyright jQuery Foundation and other contributors 
     850 * Released under the MIT license. 
     851 * http://jquery.org/license 
     852 */ 
     853 
     854//>>label: uniqueId 
     855//>>group: Core 
     856//>>description: Functions to generate and remove uniqueId's 
     857//>>docs: http://api.jqueryui.com/uniqueId/ 
     858 
     859 
     860 
     861var uniqueId = $.fn.extend( { 
     862     uniqueId: ( function() { 
     863          var uuid = 0; 
     864 
     865          return function() { 
     866               return this.each( function() { 
     867                    if ( !this.id ) { 
     868                         this.id = "ui-id-" + ( ++uuid ); 
     869                    } 
     870               } ); 
     871          }; 
     872     } )(), 
     873 
     874     removeUniqueId: function() { 
     875          return this.each( function() { 
     876               if ( /^ui-id-\d+$/.test( this.id ) ) { 
     877                    $( this ).removeAttr( "id" ); 
     878               } 
     879          } ); 
     880     } 
     881} ); 
     882 
     883 
     884 
     885 
     886// This file is deprecated 
     887var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); 
     888 
     889/*! 
     890 * jQuery UI Mouse 1.12.1 
     891 * http://jqueryui.com 
     892 * 
     893 * Copyright jQuery Foundation and other contributors 
     894 * Released under the MIT license. 
     895 * http://jquery.org/license 
     896 */ 
     897 
     898//>>label: Mouse 
     899//>>group: Widgets 
     900//>>description: Abstracts mouse-based interactions to assist in creating certain widgets. 
     901//>>docs: http://api.jqueryui.com/mouse/ 
     902 
     903 
    870904 
    871905var mouseHandled = false; 
    872 $( document ).mouseup( function() { 
     906$( document ).on( "mouseup", function() { 
    873907     mouseHandled = false; 
    874 }); 
    875  
    876 var mouse = $.widget("ui.mouse", { 
    877      version: "1.11.4", 
     908} ); 
     909 
     910var widgetsMouse = $.widget( "ui.mouse", { 
     911     version: "1.12.1", 
    878912     options: { 
    879           cancel: "input,textarea,button,select,option", 
     913          cancel: "input, textarea, button, select, option", 
    880914          distance: 1, 
    881915          delay: 0 
     
    885919 
    886920          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"); 
     921               .on( "mousedown." + this.widgetName, function( event ) { 
     922                    return that._mouseDown( event ); 
     923               } ) 
     924               .on( "click." + this.widgetName, function( event ) { 
     925                    if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) { 
     926                         $.removeData( event.target, that.widgetName + ".preventClickEvent" ); 
    893927                         event.stopImmediatePropagation(); 
    894928                         return false; 
    895929                    } 
    896                }); 
     930               } ); 
    897931 
    898932          this.started = false; 
     
    902936     // other instances of mouse 
    903937     _mouseDestroy: function() { 
    904           this.element.unbind("." + this.widgetName); 
     938          this.element.off( "." + this.widgetName ); 
    905939          if ( this._mouseMoveDelegate ) { 
    906940               this.document 
    907                     .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) 
    908                     .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); 
    909           } 
    910      }, 
    911  
    912      _mouseDown: function(event) { 
     941                    .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 
     942                    .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 
     943          } 
     944     }, 
     945 
     946     _mouseDown: function( event ) { 
     947 
    913948          // don't let more than one widget handle mouseStart 
    914949          if ( mouseHandled ) { 
     
    918953          this._mouseMoved = false; 
    919954 
    920           // we may have missed mouseup (out of window) 
    921           (this._mouseStarted && this._mouseUp(event)); 
     955          // We may have missed mouseup (out of window) 
     956          ( this._mouseStarted && this._mouseUp( event ) ); 
    922957 
    923958          this._mouseDownEvent = event; 
    924959 
    925960          var that = this, 
    926                btnIsLeft = (event.which === 1), 
     961               btnIsLeft = ( event.which === 1 ), 
     962 
    927963               // event.target.nodeName works around a bug in IE 8 with 
    928964               // 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)) { 
     965               elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ? 
     966                    $( event.target ).closest( this.options.cancel ).length : false ); 
     967          if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { 
    931968               return true; 
    932969          } 
    933970 
    934971          this.mouseDelayMet = !this.options.delay; 
    935           if (!this.mouseDelayMet) { 
    936                this._mouseDelayTimer = setTimeout(function() { 
     972          if ( !this.mouseDelayMet ) { 
     973               this._mouseDelayTimer = setTimeout( function() { 
    937974                    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) { 
     975               }, this.options.delay ); 
     976          } 
     977 
     978          if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 
     979               this._mouseStarted = ( this._mouseStart( event ) !== false ); 
     980               if ( !this._mouseStarted ) { 
    944981                    event.preventDefault(); 
    945982                    return true; 
     
    948985 
    949986          // 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); 
     987          if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) { 
     988               $.removeData( event.target, this.widgetName + ".preventClickEvent" ); 
     989          } 
     990 
     991          // These delegates are required to keep context 
     992          this._mouseMoveDelegate = function( event ) { 
     993               return that._mouseMove( event ); 
    957994          }; 
    958           this._mouseUpDelegate = function(event) { 
    959                return that._mouseUp(event); 
     995          this._mouseUpDelegate = function( event ) { 
     996               return that._mouseUp( event ); 
    960997          }; 
    961998 
    962999          this.document 
    963                .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 
    964                .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); 
     1000               .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 
     1001               .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); 
    9651002 
    9661003          event.preventDefault(); 
     
    9701007     }, 
    9711008 
    972      _mouseMove: function(event) { 
     1009     _mouseMove: function( event ) { 
     1010 
    9731011          // Only check for mouseups outside the document if you've moved inside the document 
    9741012          // at least once. This prevents the firing of mouseup in the case of IE<9, which will 
     
    9761014          // Support: IE <9 
    9771015          if ( this._mouseMoved ) { 
     1016 
    9781017               // 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); 
     1018               if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && 
     1019                         !event.button ) { 
     1020                    return this._mouseUp( event ); 
    9811021 
    9821022               // Iframe mouseup check - mouseup occurred in another document 
    9831023               } else if ( !event.which ) { 
    984                     return this._mouseUp( event ); 
     1024 
     1025                    // Support: Safari <=8 - 9 
     1026                    // Safari sets which to 0 if you press any of the following keys 
     1027                    // during a drag (#14461) 
     1028                    if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || 
     1029                              event.originalEvent.metaKey || event.originalEvent.shiftKey ) { 
     1030                         this.ignoreMissingWhich = true; 
     1031                    } else if ( !this.ignoreMissingWhich ) { 
     1032                         return this._mouseUp( event ); 
     1033                    } 
    9851034               } 
    9861035          } 
     
    9901039          } 
    9911040 
    992           if (this._mouseStarted) { 
    993                this._mouseDrag(event); 
     1041          if ( this._mouseStarted ) { 
     1042               this._mouseDrag( event ); 
    9941043               return event.preventDefault(); 
    9951044          } 
    9961045 
    997           if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { 
     1046          if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 
    9981047               this._mouseStarted = 
    999                     (this._mouseStart(this._mouseDownEvent, event) !== false); 
    1000                (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); 
     1048                    ( this._mouseStart( this._mouseDownEvent, event ) !== false ); 
     1049               ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) ); 
    10011050          } 
    10021051 
     
    10041053     }, 
    10051054 
    1006      _mouseUp: function(event) { 
     1055     _mouseUp: function( event ) { 
    10071056          this.document 
    1008                .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 
    1009                .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); 
    1010  
    1011           if (this._mouseStarted) { 
     1057               .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 
     1058               .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 
     1059 
     1060          if ( this._mouseStarted ) { 
    10121061               this._mouseStarted = false; 
    10131062 
    1014                if (event.target === this._mouseDownEvent.target) { 
    1015                     $.data(event.target, this.widgetName + ".preventClickEvent", true); 
    1016                } 
    1017  
    1018                this._mouseStop(event); 
    1019           } 
    1020  
     1063               if ( event.target === this._mouseDownEvent.target ) { 
     1064                    $.data( event.target, this.widgetName + ".preventClickEvent", true ); 
     1065               } 
     1066 
     1067               this._mouseStop( event ); 
     1068          } 
     1069 
     1070          if ( this._mouseDelayTimer ) { 
     1071               clearTimeout( this._mouseDelayTimer ); 
     1072               delete this._mouseDelayTimer; 
     1073          } 
     1074 
     1075          this.ignoreMissingWhich = false; 
    10211076          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) 
     1077          event.preventDefault(); 
     1078     }, 
     1079 
     1080     _mouseDistanceMet: function( event ) { 
     1081          return ( Math.max( 
     1082                    Math.abs( this._mouseDownEvent.pageX - event.pageX ), 
     1083                    Math.abs( this._mouseDownEvent.pageY - event.pageY ) 
    10291084               ) >= this.options.distance 
    10301085          ); 
    10311086     }, 
    10321087 
    1033      _mouseDelayMet: function(/* event */) { 
     1088     _mouseDelayMet: function( /* event */ ) { 
    10341089          return this.mouseDelayMet; 
    10351090     }, 
    10361091 
    10371092     // 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 }); 
     1093     _mouseStart: function( /* event */ ) {}, 
     1094     _mouseDrag: function( /* event */ ) {}, 
     1095     _mouseStop: function( /* event */ ) {}, 
     1096     _mouseCapture: function( /* event */ ) { return true; } 
     1097} ); 
     1098 
     1099 
     1100 
     1101 
     1102// $.ui.plugin is deprecated. Use $.widget() extensions instead. 
     1103var plugin = $.ui.plugin = { 
     1104     add: function( module, option, set ) { 
     1105          var i, 
     1106               proto = $.ui[ module ].prototype; 
     1107          for ( i in set ) { 
     1108               proto.plugins[ i ] = proto.plugins[ i ] || []; 
     1109               proto.plugins[ i ].push( [ option, set[ i ] ] ); 
     1110          } 
     1111     }, 
     1112     call: function( instance, name, args, allowDisconnected ) { 
     1113          var i, 
     1114               set = instance.plugins[ name ]; 
     1115 
     1116          if ( !set ) { 
     1117               return; 
     1118          } 
     1119 
     1120          if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || 
     1121                    instance.element[ 0 ].parentNode.nodeType === 11 ) ) { 
     1122               return; 
     1123          } 
     1124 
     1125          for ( i = 0; i < set.length; i++ ) { 
     1126               if ( instance.options[ set[ i ][ 0 ] ] ) { 
     1127                    set[ i ][ 1 ].apply( instance.element, args ); 
     1128               } 
     1129          } 
     1130     } 
     1131}; 
     1132 
     1133 
     1134 
     1135var safeActiveElement = $.ui.safeActiveElement = function( document ) { 
     1136     var activeElement; 
     1137 
     1138     // Support: IE 9 only 
     1139     // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> 
     1140     try { 
     1141          activeElement = document.activeElement; 
     1142     } catch ( error ) { 
     1143          activeElement = document.body; 
     1144     } 
     1145 
     1146     // Support: IE 9 - 11 only 
     1147     // IE may return null instead of an element 
     1148     // Interestingly, this only seems to occur when NOT in an iframe 
     1149     if ( !activeElement ) { 
     1150          activeElement = document.body; 
     1151     } 
     1152 
     1153     // Support: IE 11 only 
     1154     // IE11 returns a seemingly empty object in some cases when accessing 
     1155     // document.activeElement from an <iframe> 
     1156     if ( !activeElement.nodeName ) { 
     1157          activeElement = document.body; 
     1158     } 
     1159 
     1160     return activeElement; 
     1161}; 
     1162 
     1163 
     1164 
     1165var safeBlur = $.ui.safeBlur = function( element ) { 
     1166 
     1167     // Support: IE9 - 10 only 
     1168     // If the <body> is blurred, IE will switch windows, see #9420 
     1169     if ( element && element.nodeName.toLowerCase() !== "body" ) { 
     1170          $( element ).trigger( "blur" ); 
     1171     } 
     1172}; 
    10431173 
    10441174 
    10451175/*! 
    1046  * jQuery UI Draggable 1.11.4 
     1176 * jQuery UI Draggable 1.12.1 
    10471177 * http://jqueryui.com 
    10481178 * 
     
    10501180 * Released under the MIT license. 
    10511181 * http://jquery.org/license 
    1052  * 
    1053  * http://api.jqueryui.com/draggable/ 
    10541182 */ 
    10551183 
    1056  
    1057 $.widget("ui.draggable", $.ui.mouse, { 
    1058      version: "1.11.4", 
     1184//>>label: Draggable 
     1185//>>group: Interactions 
     1186//>>description: Enables dragging functionality for any element. 
     1187//>>docs: http://api.jqueryui.com/draggable/ 
     1188//>>demos: http://jqueryui.com/draggable/ 
     1189//>>css.structure: ../../themes/base/draggable.css 
     1190 
     1191 
     1192 
     1193$.widget( "ui.draggable", $.ui.mouse, { 
     1194     version: "1.12.1", 
    10591195     widgetEventPrefix: "drag", 
    10601196     options: { 
     
    10841220          zIndex: false, 
    10851221 
    1086           // callbacks 
     1222          // Callbacks 
    10871223          drag: null, 
    10881224          start: null, 
     
    10941230               this._setPositionRelative(); 
    10951231          } 
    1096           if (this.options.addClasses){ 
    1097                this.element.addClass("ui-draggable"); 
    1098           } 
    1099           if (this.options.disabled){ 
    1100                this.element.addClass("ui-draggable-disabled"); 
     1232          if ( this.options.addClasses ) { 
     1233               this._addClass( "ui-draggable" ); 
    11011234          } 
    11021235          this._setHandleClassName(); 
     
    11181251               return; 
    11191252          } 
    1120           this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); 
    11211253          this._removeHandleClassName(); 
    11221254          this._mouseDestroy(); 
    11231255     }, 
    11241256 
    1125      _mouseCapture: function(event) { 
     1257     _mouseCapture: function( event ) { 
    11261258          var o = this.options; 
    11271259 
     1260          // Among others, prevent a drag on a resizable-handle 
     1261          if ( this.helper || o.disabled || 
     1262                    $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) { 
     1263               return false; 
     1264          } 
     1265 
     1266          //Quit if we're not on a valid handle 
     1267          this.handle = this._getHandle( event ); 
     1268          if ( !this.handle ) { 
     1269               return false; 
     1270          } 
     1271 
    11281272          this._blurActiveElement( event ); 
    11291273 
    1130           // among others, prevent a drag on a resizable-handle 
    1131           if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) { 
    1132                return false; 
    1133           } 
    1134  
    1135           //Quit if we're not on a valid handle 
    1136           this.handle = this._getHandle(event); 
    1137           if (!this.handle) { 
    1138                return false; 
    1139           } 
    1140  
    11411274          this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix ); 
    11421275 
     
    11461279 
    11471280     _blockFrames: function( selector ) { 
    1148           this.iframeBlocks = this.document.find( selector ).map(function() { 
     1281          this.iframeBlocks = this.document.find( selector ).map( function() { 
    11491282               var iframe = $( this ); 
    11501283 
     
    11551288                    .outerHeight( iframe.outerHeight() ) 
    11561289                    .offset( iframe.offset() )[ 0 ]; 
    1157           }); 
     1290          } ); 
    11581291     }, 
    11591292 
     
    11661299 
    11671300     _blurActiveElement: function( event ) { 
    1168           var document = this.document[ 0 ]; 
    1169  
    1170           // Only need to blur if the event occurred on the draggable itself, see #10527 
    1171           if ( !this.handleElement.is( event.target ) ) { 
     1301          var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), 
     1302               target = $( event.target ); 
     1303 
     1304          // Don't blur if the event occurred on an element that is within 
     1305          // the currently focused element 
     1306          // See #10527, #12472 
     1307          if ( target.closest( activeElement ).length ) { 
    11721308               return; 
    11731309          } 
    11741310 
    1175           // support: IE9 
    1176           // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> 
    1177           try { 
    1178  
    1179                // Support: IE9, IE10 
    1180                // If the <body> is blurred, IE will switch windows, see #9520 
    1181                if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) { 
    1182  
    1183                     // Blur any element that currently has focus, see #4261 
    1184                     $( document.activeElement ).blur(); 
    1185                } 
    1186           } catch ( error ) {} 
    1187      }, 
    1188  
    1189      _mouseStart: function(event) { 
     1311          // Blur any element that currently has focus, see #4261 
     1312          $.ui.safeBlur( activeElement ); 
     1313     }, 
     1314 
     1315     _mouseStart: function( event ) { 
    11901316 
    11911317          var o = this.options; 
    11921318 
    11931319          //Create and append the visible helper 
    1194           this.helper = this._createHelper(event); 
    1195  
    1196           this.helper.addClass("ui-draggable-dragging"); 
     1320          this.helper = this._createHelper( event ); 
     1321 
     1322          this._addClass( this.helper, "ui-draggable-dragging" ); 
    11971323 
    11981324          //Cache the helper size 
     
    12001326 
    12011327          //If ddmanager is used for droppables, set the global draggable 
    1202           if ($.ui.ddmanager) { 
     1328          if ( $.ui.ddmanager ) { 
    12031329               $.ui.ddmanager.current = this; 
    12041330          } 
     
    12161342          this.scrollParent = this.helper.scrollParent( true ); 
    12171343          this.offsetParent = this.helper.offsetParent(); 
    1218           this.hasFixedAncestor = this.helper.parents().filter(function() { 
     1344          this.hasFixedAncestor = this.helper.parents().filter( function() { 
    12191345                    return $( this ).css( "position" ) === "fixed"; 
    1220                }).length > 0; 
     1346               } ).length > 0; 
    12211347 
    12221348          //The element's absolute position on the page minus margins 
     
    12301356 
    12311357          //Adjust the mouse offset relative to the helper if "cursorAt" is supplied 
    1232           (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); 
     1358          ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) ); 
    12331359 
    12341360          //Set a containment if given in the options 
     
    12361362 
    12371363          //Trigger event + callbacks 
    1238           if (this._trigger("start", event) === false) { 
     1364          if ( this._trigger( "start", event ) === false ) { 
    12391365               this._clear(); 
    12401366               return false; 
     
    12451371 
    12461372          //Prepare the droppable offsets 
    1247           if ($.ui.ddmanager && !o.dropBehaviour) { 
    1248                $.ui.ddmanager.prepareOffsets(this, event); 
    1249           } 
    1250  
    1251           // Reset helper's right/bottom css if they're set and set explicit width/height instead 
    1252           // as this prevents resizing of elements with right/bottom set (see #7772) 
    1253           this._normalizeRightBottom(); 
    1254  
    1255           this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position 
    1256  
    1257           //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) 
     1373          if ( $.ui.ddmanager && !o.dropBehaviour ) { 
     1374               $.ui.ddmanager.prepareOffsets( this, event ); 
     1375          } 
     1376 
     1377          // Execute the drag once - this causes the helper not to be visible before getting its 
     1378          // correct position 
     1379          this._mouseDrag( event, true ); 
     1380 
     1381          // If the ddmanager is used for droppables, inform the manager that dragging has started 
     1382          // (see #5003) 
    12581383          if ( $.ui.ddmanager ) { 
    1259                $.ui.ddmanager.dragStart(this, event); 
     1384               $.ui.ddmanager.dragStart( this, event ); 
    12601385          } 
    12611386 
     
    12781403     }, 
    12791404 
    1280      _mouseDrag: function(event, noPropagation) { 
     1405     _mouseDrag: function( event, noPropagation ) { 
     1406 
    12811407          // reset any necessary cached properties (see #5009) 
    12821408          if ( this.hasFixedAncestor ) { 
     
    12861412          //Compute the helpers position 
    12871413          this.position = this._generatePosition( event, true ); 
    1288           this.positionAbs = this._convertPositionTo("absolute"); 
     1414          this.positionAbs = this._convertPositionTo( "absolute" ); 
    12891415 
    12901416          //Call plugins and callbacks and use the resulting position if something is returned 
    1291           if (!noPropagation) { 
     1417          if ( !noPropagation ) { 
    12921418               var ui = this._uiHash(); 
    1293                if (this._trigger("drag", event, ui) === false) { 
    1294                     this._mouseUp({}); 
     1419               if ( this._trigger( "drag", event, ui ) === false ) { 
     1420                    this._mouseUp( new $.Event( "mouseup", event ) ); 
    12951421                    return false; 
    12961422               } 
     
    13011427          this.helper[ 0 ].style.top = this.position.top + "px"; 
    13021428 
    1303           if ($.ui.ddmanager) { 
    1304                $.ui.ddmanager.drag(this, event); 
     1429          if ( $.ui.ddmanager ) { 
     1430               $.ui.ddmanager.drag( this, event ); 
    13051431          } 
    13061432 
     
    13081434     }, 
    13091435 
    1310      _mouseStop: function(event) { 
     1436     _mouseStop: function( event ) { 
    13111437 
    13121438          //If we are using droppables, inform the manager about the drop 
    13131439          var that = this, 
    13141440               dropped = false; 
    1315           if ($.ui.ddmanager && !this.options.dropBehaviour) { 
    1316                dropped = $.ui.ddmanager.drop(this, event); 
     1441          if ( $.ui.ddmanager && !this.options.dropBehaviour ) { 
     1442               dropped = $.ui.ddmanager.drop( this, event ); 
    13171443          } 
    13181444 
    13191445          //if a drop comes from outside (a sortable) 
    1320           if (this.dropped) { 
     1446          if ( this.dropped ) { 
    13211447               dropped = this.dropped; 
    13221448               this.dropped = false; 
    13231449          } 
    13241450 
    1325           if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { 
    1326                $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { 
    1327                     if (that._trigger("stop", event) !== false) { 
    1328                          that._clear(); 
    1329                     } 
    1330                }); 
     1451          if ( ( this.options.revert === "invalid" && !dropped ) || 
     1452                    ( this.options.revert === "valid" && dropped ) || 
     1453                    this.options.revert === true || ( $.isFunction( this.options.revert ) && 
     1454                    this.options.revert.call( this.element, dropped ) ) 
     1455          ) { 
     1456               $( this.helper ).animate( 
     1457                    this.originalPosition, 
     1458                    parseInt( this.options.revertDuration, 10 ), 
     1459                    function() { 
     1460                         if ( that._trigger( "stop", event ) !== false ) { 
     1461                              that._clear(); 
     1462                         } 
     1463                    } 
     1464               ); 
    13311465          } else { 
    1332                if (this._trigger("stop", event) !== false) { 
     1466               if ( this._trigger( "stop", event ) !== false ) { 
    13331467                    this._clear(); 
    13341468               } 
     
    13411475          this._unblockFrames(); 
    13421476 
    1343           //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) 
     1477          // If the ddmanager is used for droppables, inform the manager that dragging has stopped 
     1478          // (see #5003) 
    13441479          if ( $.ui.ddmanager ) { 
    1345                $.ui.ddmanager.dragStop(this, event); 
     1480               $.ui.ddmanager.dragStop( this, event ); 
    13461481          } 
    13471482 
    13481483          // Only need to focus if the event occurred on the draggable itself, see #10527 
    13491484          if ( this.handleElement.is( event.target ) ) { 
    1350                // The interaction is over; whether or not the click resulted in a drag, focus the element 
    1351                this.element.focus(); 
    1352           } 
    1353  
    1354           return $.ui.mouse.prototype._mouseUp.call(this, event); 
     1485 
     1486               // The interaction is over; whether or not the click resulted in a drag, 
     1487               // focus the element 
     1488               this.element.trigger( "focus" ); 
     1489          } 
     1490 
     1491          return $.ui.mouse.prototype._mouseUp.call( this, event ); 
    13551492     }, 
    13561493 
    13571494     cancel: function() { 
    13581495 
    1359           if (this.helper.is(".ui-draggable-dragging")) { 
    1360                this._mouseUp({}); 
     1496          if ( this.helper.is( ".ui-draggable-dragging" ) ) { 
     1497               this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) ); 
    13611498          } else { 
    13621499               this._clear(); 
     
    13671504     }, 
    13681505 
    1369      _getHandle: function(event) { 
     1506     _getHandle: function( event ) { 
    13701507          return this.options.handle ? 
    13711508               !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : 
     
    13761513          this.handleElement = this.options.handle ? 
    13771514               this.element.find( this.options.handle ) : this.element; 
    1378           this.handleElement.addClass( "ui-draggable-handle" ); 
     1515          this._addClass( this.handleElement, "ui-draggable-handle" ); 
    13791516     }, 
    13801517 
    13811518     _removeHandleClassName: function() { 
    1382           this.handleElement.removeClass( "ui-draggable-handle" ); 
    1383      }, 
    1384  
    1385      _createHelper: function(event) { 
     1519          this._removeClass( this.handleElement, "ui-draggable-handle" ); 
     1520     }, 
     1521 
     1522     _createHelper: function( event ) { 
    13861523 
    13871524          var o = this.options, 
     
    13931530                         this.element ); 
    13941531 
    1395           if (!helper.parents("body").length) { 
    1396                helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo)); 
    1397           } 
    1398  
    1399           // http://bugs.jqueryui.com/ticket/9446 
     1532          if ( !helper.parents( "body" ).length ) { 
     1533               helper.appendTo( ( o.appendTo === "parent" ? 
     1534                    this.element[ 0 ].parentNode : 
     1535                    o.appendTo ) ); 
     1536          } 
     1537 
     1538          // Http://bugs.jqueryui.com/ticket/9446 
    14001539          // a helper function can return the original element 
    14011540          // which wouldn't have been set to relative in _create 
     
    14041543          } 
    14051544 
    1406           if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) { 
    1407                helper.css("position", "absolute"); 
     1545          if ( helper[ 0 ] !== this.element[ 0 ] && 
     1546                    !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) { 
     1547               helper.css( "position", "absolute" ); 
    14081548          } 
    14091549 
     
    14181558     }, 
    14191559 
    1420      _adjustOffsetFromHelper: function(obj) { 
    1421           if (typeof obj === "string") { 
    1422                obj = obj.split(" "); 
    1423           } 
    1424           if ($.isArray(obj)) { 
    1425                obj = { left: +obj[0], top: +obj[1] || 0 }; 
    1426           } 
    1427           if ("left" in obj) { 
     1560     _adjustOffsetFromHelper: function( obj ) { 
     1561          if ( typeof obj === "string" ) { 
     1562               obj = obj.split( " " ); 
     1563          } 
     1564          if ( $.isArray( obj ) ) { 
     1565               obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; 
     1566          } 
     1567          if ( "left" in obj ) { 
    14281568               this.offset.click.left = obj.left + this.margins.left; 
    14291569          } 
    1430           if ("right" in obj) { 
     1570          if ( "right" in obj ) { 
    14311571               this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; 
    14321572          } 
    1433           if ("top" in obj) { 
     1573          if ( "top" in obj ) { 
    14341574               this.offset.click.top = obj.top + this.margins.top; 
    14351575          } 
    1436           if ("bottom" in obj) { 
     1576          if ( "bottom" in obj ) { 
    14371577               this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; 
    14381578          } 
     
    14491589               document = this.document[ 0 ]; 
    14501590 
    1451           // This is a special case where we need to modify a offset calculated on start, since the following happened: 
    1452           // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent 
    1453           // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that 
    1454           //    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag 
    1455           if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) { 
     1591          // This is a special case where we need to modify a offset calculated on start, since the 
     1592          // following happened: 
     1593          // 1. The position of the helper is absolute, so it's position is calculated based on the 
     1594          // next positioned parent 
     1595          // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't 
     1596          // the document, which means that the scroll is included in the initial calculation of the 
     1597          // offset of the parent, and never recalculated upon drag 
     1598          if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document && 
     1599                    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { 
    14561600               po.left += this.scrollParent.scrollLeft(); 
    14571601               po.top += this.scrollParent.scrollTop(); 
     
    14631607 
    14641608          return { 
    1465                top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), 
    1466                left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) 
     1609               top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), 
     1610               left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) 
    14671611          }; 
    14681612 
     
    14781622 
    14791623          return { 
    1480                top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ), 
    1481                left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 ) 
     1624               top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + 
     1625                    ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ), 
     1626               left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + 
     1627                    ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 ) 
    14821628          }; 
    14831629 
     
    14861632     _cacheMargins: function() { 
    14871633          this.margins = { 
    1488                left: (parseInt(this.element.css("marginLeft"), 10) || 0), 
    1489                top: (parseInt(this.element.css("marginTop"), 10) || 0), 
    1490                right: (parseInt(this.element.css("marginRight"), 10) || 0), 
    1491                bottom: (parseInt(this.element.css("marginBottom"), 10) || 0) 
     1634               left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ), 
     1635               top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ), 
     1636               right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ), 
     1637               bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 ) 
    14921638          }; 
    14931639     }, 
     
    15171663                    $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, 
    15181664                    $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, 
    1519                     $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left, 
    1520                     $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top 
     1665                    $( window ).scrollLeft() + $( window ).width() - 
     1666                         this.helperProportions.width - this.margins.left, 
     1667                    $( window ).scrollTop() + 
     1668                         ( $( window ).height() || document.body.parentNode.scrollHeight ) - 
     1669                         this.helperProportions.height - this.margins.top 
    15211670               ]; 
    15221671               return; 
    15231672          } 
    15241673 
    1525           if ( o.containment === "document") { 
     1674          if ( o.containment === "document" ) { 
    15261675               this.containment = [ 
    15271676                    0, 
    15281677                    0, 
    15291678                    $( document ).width() - this.helperProportions.width - this.margins.left, 
    1530                     ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top 
     1679                    ( $( document ).height() || document.body.parentNode.scrollHeight ) - 
     1680                         this.helperProportions.height - this.margins.top 
    15311681               ]; 
    15321682               return; 
     
    15521702 
    15531703          this.containment = [ 
    1554                ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), 
    1555                ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ), 
     1704               ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + 
     1705                    ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), 
     1706               ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + 
     1707                    ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ), 
    15561708               ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - 
    15571709                    ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - 
     
    15701722     }, 
    15711723 
    1572      _convertPositionTo: function(d, pos) { 
    1573  
    1574           if (!pos) { 
     1724     _convertPositionTo: function( d, pos ) { 
     1725 
     1726          if ( !pos ) { 
    15751727               pos = this.position; 
    15761728          } 
     
    15811733          return { 
    15821734               top: ( 
    1583                     pos.top   +                                                                               // The absolute mouse position 
    1584                     this.offset.relative.top * mod +                                                // Only for relative positioned nodes: Relative offset from element to offset parent 
    1585                     this.offset.parent.top * mod -                                                  // The offsetParent's offset without borders (offset + border) 
    1586                     ( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod) 
     1735 
     1736                    // The absolute mouse position 
     1737                    pos.top   + 
     1738 
     1739                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     1740                    this.offset.relative.top * mod + 
     1741 
     1742                    // The offsetParent's offset without borders (offset + border) 
     1743                    this.offset.parent.top * mod - 
     1744                    ( ( this.cssPosition === "fixed" ? 
     1745                         -this.offset.scroll.top : 
     1746                         ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod ) 
    15871747               ), 
    15881748               left: ( 
    1589                     pos.left +                                                                                // The absolute mouse position 
    1590                     this.offset.relative.left * mod +                                               // Only for relative positioned nodes: Relative offset from element to offset parent 
    1591                     this.offset.parent.left * mod -                                                 // The offsetParent's offset without borders (offset + border) 
    1592                     ( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod) 
     1749 
     1750                    // The absolute mouse position 
     1751                    pos.left + 
     1752 
     1753                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     1754                    this.offset.relative.left * mod + 
     1755 
     1756                    // The offsetParent's offset without borders (offset + border) 
     1757                    this.offset.parent.left * mod - 
     1758                    ( ( this.cssPosition === "fixed" ? 
     1759                         -this.offset.scroll.left : 
     1760                         ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod ) 
    15931761               ) 
    15941762          }; 
     
    16201788          if ( constrainPosition ) { 
    16211789               if ( this.containment ) { 
    1622                     if ( this.relativeContainer ){ 
     1790                    if ( this.relativeContainer ) { 
    16231791                         co = this.relativeContainer.offset(); 
    16241792                         containment = [ 
     
    16321800                    } 
    16331801 
    1634                     if (event.pageX - this.offset.click.left < containment[0]) { 
    1635                          pageX = containment[0] + this.offset.click.left; 
    1636                     } 
    1637                     if (event.pageY - this.offset.click.top < containment[1]) { 
    1638                          pageY = containment[1] + this.offset.click.top; 
    1639                     } 
    1640                     if (event.pageX - this.offset.click.left > containment[2]) { 
    1641                          pageX = containment[2] + this.offset.click.left; 
    1642                     } 
    1643                     if (event.pageY - this.offset.click.top > containment[3]) { 
    1644                          pageY = containment[3] + this.offset.click.top; 
    1645                     } 
    1646                } 
    1647  
    1648                if (o.grid) { 
    1649                     //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) 
    1650                     top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; 
    1651                     pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; 
    1652  
    1653                     left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; 
    1654                     pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; 
     1802                    if ( event.pageX - this.offset.click.left < containment[ 0 ] ) { 
     1803                         pageX = containment[ 0 ] + this.offset.click.left; 
     1804                    } 
     1805                    if ( event.pageY - this.offset.click.top < containment[ 1 ] ) { 
     1806                         pageY = containment[ 1 ] + this.offset.click.top; 
     1807                    } 
     1808                    if ( event.pageX - this.offset.click.left > containment[ 2 ] ) { 
     1809                         pageX = containment[ 2 ] + this.offset.click.left; 
     1810                    } 
     1811                    if ( event.pageY - this.offset.click.top > containment[ 3 ] ) { 
     1812                         pageY = containment[ 3 ] + this.offset.click.top; 
     1813                    } 
     1814               } 
     1815 
     1816               if ( o.grid ) { 
     1817 
     1818                    //Check for grid elements set to 0 to prevent divide by 0 error causing invalid 
     1819                    // argument errors in IE (see ticket #6950) 
     1820                    top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY - 
     1821                         this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY; 
     1822                    pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] || 
     1823                         top - this.offset.click.top > containment[ 3 ] ) ? 
     1824                              top : 
     1825                              ( ( top - this.offset.click.top >= containment[ 1 ] ) ? 
     1826                                   top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top; 
     1827 
     1828                    left = o.grid[ 0 ] ? this.originalPageX + 
     1829                         Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] : 
     1830                         this.originalPageX; 
     1831                    pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] || 
     1832                         left - this.offset.click.left > containment[ 2 ] ) ? 
     1833                              left : 
     1834                              ( ( left - this.offset.click.left >= containment[ 0 ] ) ? 
     1835                                   left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left; 
    16551836               } 
    16561837 
     
    16661847          return { 
    16671848               top: ( 
    1668                     pageY -                                                                                   // The absolute mouse position 
    1669                     this.offset.click.top    -                                                           // Click offset (relative to the element) 
    1670                     this.offset.relative.top -                                                           // Only for relative positioned nodes: Relative offset from element to offset parent 
    1671                     this.offset.parent.top +                                                        // The offsetParent's offset without borders (offset + border) 
    1672                     ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) 
     1849 
     1850                    // The absolute mouse position 
     1851                    pageY - 
     1852 
     1853                    // Click offset (relative to the element) 
     1854                    this.offset.click.top - 
     1855 
     1856                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     1857                    this.offset.relative.top - 
     1858 
     1859                    // The offsetParent's offset without borders (offset + border) 
     1860                    this.offset.parent.top + 
     1861                    ( this.cssPosition === "fixed" ? 
     1862                         -this.offset.scroll.top : 
     1863                         ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) 
    16731864               ), 
    16741865               left: ( 
    1675                     pageX -                                                                                   // The absolute mouse position 
    1676                     this.offset.click.left -                                                        // Click offset (relative to the element) 
    1677                     this.offset.relative.left -                                                          // Only for relative positioned nodes: Relative offset from element to offset parent 
    1678                     this.offset.parent.left +                                                            // The offsetParent's offset without borders (offset + border) 
    1679                     ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) 
     1866 
     1867                    // The absolute mouse position 
     1868                    pageX - 
     1869 
     1870                    // Click offset (relative to the element) 
     1871                    this.offset.click.left - 
     1872 
     1873                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     1874                    this.offset.relative.left - 
     1875 
     1876                    // The offsetParent's offset without borders (offset + border) 
     1877                    this.offset.parent.left + 
     1878                    ( this.cssPosition === "fixed" ? 
     1879                         -this.offset.scroll.left : 
     1880                         ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) 
    16801881               ) 
    16811882          }; 
     
    16841885 
    16851886     _clear: function() { 
    1686           this.helper.removeClass("ui-draggable-dragging"); 
    1687           if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) { 
     1887          this._removeClass( this.helper, "ui-draggable-dragging" ); 
     1888          if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) { 
    16881889               this.helper.remove(); 
    16891890          } 
     
    16921893          if ( this.destroyOnClear ) { 
    16931894               this.destroy(); 
    1694           } 
    1695      }, 
    1696  
    1697      _normalizeRightBottom: function() { 
    1698           if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) { 
    1699                this.helper.width( this.helper.width() ); 
    1700                this.helper.css( "right", "auto" ); 
    1701           } 
    1702           if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) { 
    1703                this.helper.height( this.helper.height() ); 
    1704                this.helper.css( "bottom", "auto" ); 
    17051895          } 
    17061896     }, 
     
    17311921     } 
    17321922 
    1733 }); 
     1923} ); 
    17341924 
    17351925$.ui.plugin.add( "draggable", "connectToSortable", { 
     
    17371927          var uiSortable = $.extend( {}, ui, { 
    17381928               item: draggable.element 
    1739           }); 
     1929          } ); 
    17401930 
    17411931          draggable.sortables = []; 
    1742           $( draggable.options.connectToSortable ).each(function() { 
     1932          $( draggable.options.connectToSortable ).each( function() { 
    17431933               var sortable = $( this ).sortable( "instance" ); 
    17441934 
     
    17461936                    draggable.sortables.push( sortable ); 
    17471937 
    1748                     // refreshPositions is called at drag start to refresh the containerCache 
     1938                    // RefreshPositions is called at drag start to refresh the containerCache 
    17491939                    // which is used in drag. This ensures it's initialized and synchronized 
    17501940                    // with any changes that might have happened on the page since initialization. 
    17511941                    sortable.refreshPositions(); 
    1752                     sortable._trigger("activate", event, uiSortable); 
    1753                } 
    1754           }); 
     1942                    sortable._trigger( "activate", event, uiSortable ); 
     1943               } 
     1944          } ); 
    17551945     }, 
    17561946     stop: function( event, ui, draggable ) { 
    17571947          var uiSortable = $.extend( {}, ui, { 
    17581948               item: draggable.element 
    1759           }); 
     1949          } ); 
    17601950 
    17611951          draggable.cancelHelperRemoval = false; 
     
    17801970                    }; 
    17811971 
    1782                     sortable._mouseStop(event); 
     1972                    sortable._mouseStop( event ); 
    17831973 
    17841974                    // Once drag has ended, the sortable should return to using 
     
    17861976                    sortable.options.helper = sortable.options._helper; 
    17871977               } else { 
     1978 
    17881979                    // Prevent this Sortable from removing the helper. 
    17891980                    // However, don't set the draggable to remove the helper 
     
    17931984                    sortable._trigger( "deactivate", event, uiSortable ); 
    17941985               } 
    1795           }); 
     1986          } ); 
    17961987     }, 
    17971988     drag: function( event, ui, draggable ) { 
     
    18092000 
    18102001                    $.each( draggable.sortables, function() { 
     2002 
    18112003                         // Copy over variables that sortable's _intersectsWith uses 
    18122004                         this.positionAbs = draggable.positionAbs; 
     
    18212013 
    18222014                         return innermostIntersecting; 
    1823                     }); 
     2015                    } ); 
    18242016               } 
    18252017 
    18262018               if ( innermostIntersecting ) { 
     2019 
    18272020                    // If it intersects, we use a little isOver variable and set it once, 
    18282021                    // so that the move-in stuff gets fired only once. 
     
    18692062                         $.each( draggable.sortables, function() { 
    18702063                              this.refreshPositions(); 
    1871                          }); 
    1872  
    1873                          // hack so receive/update callbacks work (mostly) 
     2064                         } ); 
     2065 
     2066                         // Hack so receive/update callbacks work (mostly) 
    18742067                         draggable.currentItem = draggable.element; 
    18752068                         sortable.fromOutside = draggable; 
     
    18782071                    if ( sortable.currentItem ) { 
    18792072                         sortable._mouseDrag( event ); 
     2073 
    18802074                         // Copy the sortable's position because the draggable's can potentially reflect 
    18812075                         // a relative position, while sortable is always absolute, which the dragged 
     
    18842078                    } 
    18852079               } else { 
     2080 
    18862081                    // If it doesn't intersect with the sortable, and it intersected before, 
    18872082                    // we fake the drag stop of the sortable, but make sure it doesn't remove 
     
    19002095                         sortable._mouseStop( event, true ); 
    19012096 
    1902                          // restore sortable behaviors that were modfied 
     2097                         // Restore sortable behaviors that were modfied 
    19032098                         // when the draggable entered the sortable area (#9481) 
    19042099                         sortable.options.revert = sortable.options._revert; 
     
    19242119                         $.each( draggable.sortables, function() { 
    19252120                              this.refreshPositions(); 
    1926                          }); 
    1927                     } 
    1928                } 
    1929           }); 
     2121                         } ); 
     2122                    } 
     2123               } 
     2124          } ); 
    19302125     } 
    1931 }); 
    1932  
    1933 $.ui.plugin.add("draggable", "cursor", { 
     2126} ); 
     2127 
     2128$.ui.plugin.add( "draggable", "cursor", { 
    19342129     start: function( event, ui, instance ) { 
    19352130          var t = $( "body" ), 
    19362131               o = instance.options; 
    19372132 
    1938           if (t.css("cursor")) { 
    1939                o._cursor = t.css("cursor"); 
    1940           } 
    1941           t.css("cursor", o.cursor); 
     2133          if ( t.css( "cursor" ) ) { 
     2134               o._cursor = t.css( "cursor" ); 
     2135          } 
     2136          t.css( "cursor", o.cursor ); 
    19422137     }, 
    19432138     stop: function( event, ui, instance ) { 
    19442139          var o = instance.options; 
    1945           if (o._cursor) { 
    1946                $("body").css("cursor", o._cursor); 
     2140          if ( o._cursor ) { 
     2141               $( "body" ).css( "cursor", o._cursor ); 
    19472142          } 
    19482143     } 
    1949 }); 
    1950  
    1951 $.ui.plugin.add("draggable", "opacity", { 
     2144} ); 
     2145 
     2146$.ui.plugin.add( "draggable", "opacity", { 
    19522147     start: function( event, ui, instance ) { 
    19532148          var t = $( ui.helper ), 
    19542149               o = instance.options; 
    1955           if (t.css("opacity")) { 
    1956                o._opacity = t.css("opacity"); 
    1957           } 
    1958           t.css("opacity", o.opacity); 
     2150          if ( t.css( "opacity" ) ) { 
     2151               o._opacity = t.css( "opacity" ); 
     2152          } 
     2153          t.css( "opacity", o.opacity ); 
    19592154     }, 
    19602155     stop: function( event, ui, instance ) { 
    19612156          var o = instance.options; 
    1962           if (o._opacity) { 
    1963                $(ui.helper).css("opacity", o._opacity); 
     2157          if ( o._opacity ) { 
     2158               $( ui.helper ).css( "opacity", o._opacity ); 
    19642159          } 
    19652160     } 
    1966 }); 
    1967  
    1968 $.ui.plugin.add("draggable", "scroll", { 
     2161} ); 
     2162 
     2163$.ui.plugin.add( "draggable", "scroll", { 
    19692164     start: function( event, ui, i ) { 
    19702165          if ( !i.scrollParentNotHidden ) { 
     
    19722167          } 
    19732168 
    1974           if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) { 
     2169          if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && 
     2170                    i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) { 
    19752171               i.overflowOffset = i.scrollParentNotHidden.offset(); 
    19762172          } 
     
    19852181          if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) { 
    19862182               if ( !o.axis || o.axis !== "x" ) { 
    1987                     if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) { 
     2183                    if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < 
     2184                              o.scrollSensitivity ) { 
    19882185                         scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed; 
    19892186                    } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) { 
     
    19932190 
    19942191               if ( !o.axis || o.axis !== "y" ) { 
    1995                     if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) { 
     2192                    if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < 
     2193                              o.scrollSensitivity ) { 
    19962194                         scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed; 
    19972195                    } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) { 
     
    20022200          } else { 
    20032201 
    2004                if (!o.axis || o.axis !== "x") { 
    2005                     if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) { 
    2006                          scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); 
    2007                     } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) { 
    2008                          scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); 
    2009                     } 
    2010                } 
    2011  
    2012                if (!o.axis || o.axis !== "y") { 
    2013                     if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) { 
    2014                          scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); 
    2015                     } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) { 
    2016                          scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); 
    2017                     } 
    2018                } 
    2019  
    2020           } 
    2021  
    2022           if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { 
    2023                $.ui.ddmanager.prepareOffsets(i, event); 
     2202               if ( !o.axis || o.axis !== "x" ) { 
     2203                    if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) { 
     2204                         scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed ); 
     2205                    } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) < 
     2206                              o.scrollSensitivity ) { 
     2207                         scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed ); 
     2208                    } 
     2209               } 
     2210 
     2211               if ( !o.axis || o.axis !== "y" ) { 
     2212                    if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) { 
     2213                         scrolled = $( document ).scrollLeft( 
     2214                              $( document ).scrollLeft() - o.scrollSpeed 
     2215                         ); 
     2216                    } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) < 
     2217                              o.scrollSensitivity ) { 
     2218                         scrolled = $( document ).scrollLeft( 
     2219                              $( document ).scrollLeft() + o.scrollSpeed 
     2220                         ); 
     2221                    } 
     2222               } 
     2223 
     2224          } 
     2225 
     2226          if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { 
     2227               $.ui.ddmanager.prepareOffsets( i, event ); 
    20242228          } 
    20252229 
    20262230     } 
    2027 }); 
    2028  
    2029 $.ui.plugin.add("draggable", "snap", { 
     2231} ); 
     2232 
     2233$.ui.plugin.add( "draggable", "snap", { 
    20302234     start: function( event, ui, i ) { 
    20312235 
     
    20342238          i.snapElements = []; 
    20352239 
    2036           $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() { 
    2037                var $t = $(this), 
    2038                     $o = $t.offset(); 
    2039                if (this !== i.element[0]) { 
    2040                     i.snapElements.push({ 
    2041                          item: this, 
    2042                          width: $t.outerWidth(), height: $t.outerHeight(), 
    2043                          top: $o.top, left: $o.left 
    2044                     }); 
    2045                } 
    2046           }); 
     2240          $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap ) 
     2241               .each( function() { 
     2242                    var $t = $( this ), 
     2243                         $o = $t.offset(); 
     2244                    if ( this !== i.element[ 0 ] ) { 
     2245                         i.snapElements.push( { 
     2246                              item: this, 
     2247                              width: $t.outerWidth(), height: $t.outerHeight(), 
     2248                              top: $o.top, left: $o.left 
     2249                         } ); 
     2250                    } 
     2251               } ); 
    20472252 
    20482253     }, 
     
    20552260               y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; 
    20562261 
    2057           for (i = inst.snapElements.length - 1; i >= 0; i--){ 
    2058  
    2059                l = inst.snapElements[i].left - inst.margins.left; 
    2060                r = l + inst.snapElements[i].width; 
    2061                t = inst.snapElements[i].top - inst.margins.top; 
    2062                b = t + inst.snapElements[i].height; 
    2063  
    2064                if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) { 
    2065                     if (inst.snapElements[i].snapping) { 
    2066                          (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); 
    2067                     } 
    2068                     inst.snapElements[i].snapping = false; 
     2262          for ( i = inst.snapElements.length - 1; i >= 0; i-- ) { 
     2263 
     2264               l = inst.snapElements[ i ].left - inst.margins.left; 
     2265               r = l + inst.snapElements[ i ].width; 
     2266               t = inst.snapElements[ i ].top - inst.margins.top; 
     2267               b = t + inst.snapElements[ i ].height; 
     2268 
     2269               if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || 
     2270                         !$.contains( inst.snapElements[ i ].item.ownerDocument, 
     2271                         inst.snapElements[ i ].item ) ) { 
     2272                    if ( inst.snapElements[ i ].snapping ) { 
     2273                         ( inst.options.snap.release && 
     2274                              inst.options.snap.release.call( 
     2275                                   inst.element, 
     2276                                   event, 
     2277                                   $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) 
     2278                              ) ); 
     2279                    } 
     2280                    inst.snapElements[ i ].snapping = false; 
    20692281                    continue; 
    20702282               } 
    20712283 
    2072                if (o.snapMode !== "inner") { 
    2073                     ts = Math.abs(t - y2) <= d; 
    2074                     bs = Math.abs(b - y1) <= d; 
    2075                     ls = Math.abs(l - x2) <= d; 
    2076                     rs = Math.abs(r - x1) <= d; 
    2077                     if (ts) { 
    2078                          ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top; 
    2079                     } 
    2080                     if (bs) { 
    2081                          ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top; 
    2082                     } 
    2083                     if (ls) { 
    2084                          ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left; 
    2085                     } 
    2086                     if (rs) { 
    2087                          ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left; 
    2088                     } 
    2089                } 
    2090  
    2091                first = (ts || bs || ls || rs); 
    2092  
    2093                if (o.snapMode !== "outer") { 
    2094                     ts = Math.abs(t - y1) <= d; 
    2095                     bs = Math.abs(b - y2) <= d; 
    2096                     ls = Math.abs(l - x1) <= d; 
    2097                     rs = Math.abs(r - x2) <= d; 
    2098                     if (ts) { 
    2099                          ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top; 
    2100                     } 
    2101                     if (bs) { 
    2102                          ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top; 
    2103                     } 
    2104                     if (ls) { 
    2105                          ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left; 
    2106                     } 
    2107                     if (rs) { 
    2108                          ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left; 
    2109                     } 
    2110                } 
    2111  
    2112                if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) { 
    2113                     (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); 
    2114                } 
    2115                inst.snapElements[i].snapping = (ts || bs || ls || rs || first); 
     2284               if ( o.snapMode !== "inner" ) { 
     2285                    ts = Math.abs( t - y2 ) <= d; 
     2286                    bs = Math.abs( b - y1 ) <= d; 
     2287                    ls = Math.abs( l - x2 ) <= d; 
     2288                    rs = Math.abs( r - x1 ) <= d; 
     2289                    if ( ts ) { 
     2290                         ui.position.top = inst._convertPositionTo( "relative", { 
     2291                              top: t - inst.helperProportions.height, 
     2292                              left: 0 
     2293                         } ).top; 
     2294                    } 
     2295                    if ( bs ) { 
     2296                         ui.position.top = inst._convertPositionTo( "relative", { 
     2297                              top: b, 
     2298                              left: 0 
     2299                         } ).top; 
     2300                    } 
     2301                    if ( ls ) { 
     2302                         ui.position.left = inst._convertPositionTo( "relative", { 
     2303                              top: 0, 
     2304                              left: l - inst.helperProportions.width 
     2305                         } ).left; 
     2306                    } 
     2307                    if ( rs ) { 
     2308                         ui.position.left = inst._convertPositionTo( "relative", { 
     2309                              top: 0, 
     2310                              left: r 
     2311                         } ).left; 
     2312                    } 
     2313               } 
     2314 
     2315               first = ( ts || bs || ls || rs ); 
     2316 
     2317               if ( o.snapMode !== "outer" ) { 
     2318                    ts = Math.abs( t - y1 ) <= d; 
     2319                    bs = Math.abs( b - y2 ) <= d; 
     2320                    ls = Math.abs( l - x1 ) <= d; 
     2321                    rs = Math.abs( r - x2 ) <= d; 
     2322                    if ( ts ) { 
     2323                         ui.position.top = inst._convertPositionTo( "relative", { 
     2324                              top: t, 
     2325                              left: 0 
     2326                         } ).top; 
     2327                    } 
     2328                    if ( bs ) { 
     2329                         ui.position.top = inst._convertPositionTo( "relative", { 
     2330                              top: b - inst.helperProportions.height, 
     2331                              left: 0 
     2332                         } ).top; 
     2333                    } 
     2334                    if ( ls ) { 
     2335                         ui.position.left = inst._convertPositionTo( "relative", { 
     2336                              top: 0, 
     2337                              left: l 
     2338                         } ).left; 
     2339                    } 
     2340                    if ( rs ) { 
     2341                         ui.position.left = inst._convertPositionTo( "relative", { 
     2342                              top: 0, 
     2343                              left: r - inst.helperProportions.width 
     2344                         } ).left; 
     2345                    } 
     2346               } 
     2347 
     2348               if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) { 
     2349                    ( inst.options.snap.snap && 
     2350                         inst.options.snap.snap.call( 
     2351                              inst.element, 
     2352                              event, 
     2353                              $.extend( inst._uiHash(), { 
     2354                                   snapItem: inst.snapElements[ i ].item 
     2355                              } ) ) ); 
     2356               } 
     2357               inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first ); 
    21162358 
    21172359          } 
    21182360 
    21192361     } 
    2120 }); 
    2121  
    2122 $.ui.plugin.add("draggable", "stack", { 
     2362} ); 
     2363 
     2364$.ui.plugin.add( "draggable", "stack", { 
    21232365     start: function( event, ui, instance ) { 
    21242366          var min, 
    21252367               o = instance.options, 
    2126                group = $.makeArray($(o.stack)).sort(function(a, b) { 
    2127                     return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0); 
    2128                }); 
    2129  
    2130           if (!group.length) { return; } 
    2131  
    2132           min = parseInt($(group[0]).css("zIndex"), 10) || 0; 
    2133           $(group).each(function(i) { 
    2134                $(this).css("zIndex", min + i); 
    2135           }); 
    2136           this.css("zIndex", (min + group.length)); 
     2368               group = $.makeArray( $( o.stack ) ).sort( function( a, b ) { 
     2369                    return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) - 
     2370                         ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 ); 
     2371               } ); 
     2372 
     2373          if ( !group.length ) { return; } 
     2374 
     2375          min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0; 
     2376          $( group ).each( function( i ) { 
     2377               $( this ).css( "zIndex", min + i ); 
     2378          } ); 
     2379          this.css( "zIndex", ( min + group.length ) ); 
    21372380     } 
    2138 }); 
    2139  
    2140 $.ui.plugin.add("draggable", "zIndex", { 
     2381} ); 
     2382 
     2383$.ui.plugin.add( "draggable", "zIndex", { 
    21412384     start: function( event, ui, instance ) { 
    21422385          var t = $( ui.helper ), 
    21432386               o = instance.options; 
    21442387 
    2145           if (t.css("zIndex")) { 
    2146                o._zIndex = t.css("zIndex"); 
    2147           } 
    2148           t.css("zIndex", o.zIndex); 
     2388          if ( t.css( "zIndex" ) ) { 
     2389               o._zIndex = t.css( "zIndex" ); 
     2390          } 
     2391          t.css( "zIndex", o.zIndex ); 
    21492392     }, 
    21502393     stop: function( event, ui, instance ) { 
    21512394          var o = instance.options; 
    21522395 
    2153           if (o._zIndex) { 
    2154                $(ui.helper).css("zIndex", o._zIndex); 
     2396          if ( o._zIndex ) { 
     2397               $( ui.helper ).css( "zIndex", o._zIndex ); 
    21552398          } 
    21562399     } 
    2157 }); 
    2158  
    2159 var draggable = $.ui.draggable; 
     2400} ); 
     2401 
     2402var widgetsDraggable = $.ui.draggable; 
    21602403 
    21612404 
    21622405/*! 
    2163  * jQuery UI Sortable 1.11.4 
     2406 * jQuery UI Sortable 1.12.1 
    21642407 * http://jqueryui.com 
    21652408 * 
     
    21672410 * Released under the MIT license. 
    21682411 * http://jquery.org/license 
    2169  * 
    2170  * http://api.jqueryui.com/sortable/ 
    21712412 */ 
    21722413 
    2173  
    2174 var sortable = $.widget("ui.sortable", $.ui.mouse, { 
    2175      version: "1.11.4", 
     2414//>>label: Sortable 
     2415//>>group: Interactions 
     2416//>>description: Enables items in a list to be sorted using the mouse. 
     2417//>>docs: http://api.jqueryui.com/sortable/ 
     2418//>>demos: http://jqueryui.com/sortable/ 
     2419//>>css.structure: ../../themes/base/sortable.css 
     2420 
     2421 
     2422 
     2423var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, { 
     2424     version: "1.12.1", 
    21762425     widgetEventPrefix: "sort", 
    21772426     ready: false, 
     
    22002449          zIndex: 1000, 
    22012450 
    2202           // callbacks 
     2451          // Callbacks 
    22032452          activate: null, 
    22042453          beforeStop: null, 
     
    22202469 
    22212470     _isFloating: function( item ) { 
    2222           return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display")); 
     2471          return ( /left|right/ ).test( item.css( "float" ) ) || 
     2472               ( /inline|table-cell/ ).test( item.css( "display" ) ); 
    22232473     }, 
    22242474 
    22252475     _create: function() { 
    22262476          this.containerCache = {}; 
    2227           this.element.addClass("ui-sortable"); 
     2477          this._addClass( "ui-sortable" ); 
    22282478 
    22292479          //Get the items 
     
    22522502 
    22532503     _setHandleClassName: function() { 
    2254           this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" ); 
     2504          var that = this; 
     2505          this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" ); 
    22552506          $.each( this.items, function() { 
    2256                ( this.instance.options.handle ? 
    2257                     this.item.find( this.instance.options.handle ) : this.item ) 
    2258                     .addClass( "ui-sortable-handle" ); 
    2259           }); 
     2507               that._addClass( 
     2508                    this.instance.options.handle ? 
     2509                         this.item.find( this.instance.options.handle ) : 
     2510                         this.item, 
     2511                    "ui-sortable-handle" 
     2512               ); 
     2513          } ); 
    22602514     }, 
    22612515 
    22622516     _destroy: function() { 
    2263           this.element 
    2264                .removeClass( "ui-sortable ui-sortable-disabled" ) 
    2265                .find( ".ui-sortable-handle" ) 
    2266                     .removeClass( "ui-sortable-handle" ); 
    22672517          this._mouseDestroy(); 
    22682518 
    22692519          for ( var i = this.items.length - 1; i >= 0; i-- ) { 
    2270                this.items[i].item.removeData(this.widgetName + "-item"); 
     2520               this.items[ i ].item.removeData( this.widgetName + "-item" ); 
    22712521          } 
    22722522 
     
    22742524     }, 
    22752525 
    2276      _mouseCapture: function(event, overrideHandle) { 
     2526     _mouseCapture: function( event, overrideHandle ) { 
    22772527          var currentItem = null, 
    22782528               validHandle = false, 
    22792529               that = this; 
    22802530 
    2281           if (this.reverting) { 
     2531          if ( this.reverting ) { 
    22822532               return false; 
    22832533          } 
    22842534 
    2285           if(this.options.disabled || this.options.type === "static") { 
     2535          if ( this.options.disabled || this.options.type === "static" ) { 
    22862536               return false; 
    22872537          } 
    22882538 
    22892539          //We have to refresh the items data once first 
    2290           this._refreshItems(event); 
     2540          this._refreshItems( event ); 
    22912541 
    22922542          //Find out if the clicked node (or one of its parents) is a actual item in this.items 
    2293           $(event.target).parents().each(function() { 
    2294                if($.data(this, that.widgetName + "-item") === that) { 
    2295                     currentItem = $(this); 
     2543          $( event.target ).parents().each( function() { 
     2544               if ( $.data( this, that.widgetName + "-item" ) === that ) { 
     2545                    currentItem = $( this ); 
    22962546                    return false; 
    22972547               } 
    2298           }); 
    2299           if($.data(event.target, that.widgetName + "-item") === that) { 
    2300                currentItem = $(event.target); 
    2301           } 
    2302  
    2303           if(!currentItem) { 
     2548          } ); 
     2549          if ( $.data( event.target, that.widgetName + "-item" ) === that ) { 
     2550               currentItem = $( event.target ); 
     2551          } 
     2552 
     2553          if ( !currentItem ) { 
    23042554               return false; 
    23052555          } 
    2306           if(this.options.handle && !overrideHandle) { 
    2307                $(this.options.handle, currentItem).find("*").addBack().each(function() { 
    2308                     if(this === event.target) { 
     2556          if ( this.options.handle && !overrideHandle ) { 
     2557               $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() { 
     2558                    if ( this === event.target ) { 
    23092559                         validHandle = true; 
    23102560                    } 
    2311                }); 
    2312                if(!validHandle) { 
     2561               } ); 
     2562               if ( !validHandle ) { 
    23132563                    return false; 
    23142564               } 
     
    23212571     }, 
    23222572 
    2323      _mouseStart: function(event, overrideHandle, noActivation) { 
     2573     _mouseStart: function( event, overrideHandle, noActivation ) { 
    23242574 
    23252575          var i, body, 
     
    23282578          this.currentContainer = this; 
    23292579 
    2330           //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture 
     2580          //We only need to call refreshPositions, because the refreshItems call has been moved to 
     2581          // mouseCapture 
    23312582          this.refreshPositions(); 
    23322583 
    23332584          //Create and append the visible helper 
    2334           this.helper = this._createHelper(event); 
     2585          this.helper = this._createHelper( event ); 
    23352586 
    23362587          //Cache the helper size 
     
    23552606          }; 
    23562607 
    2357           $.extend(this.offset, { 
     2608          $.extend( this.offset, { 
    23582609               click: { //Where the click happened, relative to the element 
    23592610                    left: event.pageX - this.offset.left, 
     
    23612612               }, 
    23622613               parent: this._getParentOffset(), 
    2363                relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper 
    2364           }); 
     2614 
     2615               // This is a relative to absolute position minus the actual position calculation - 
     2616               // only used for relative positioned helper 
     2617               relative: this._getRelativeOffset() 
     2618          } ); 
    23652619 
    23662620          // Only after we got the offset, we can change the helper's position to absolute 
    23672621          // TODO: Still need to figure out a way to make relative sorting possible 
    2368           this.helper.css("position", "absolute"); 
    2369           this.cssPosition = this.helper.css("position"); 
     2622          this.helper.css( "position", "absolute" ); 
     2623          this.cssPosition = this.helper.css( "position" ); 
    23702624 
    23712625          //Generate the original position 
    2372           this.originalPosition = this._generatePosition(event); 
     2626          this.originalPosition = this._generatePosition( event ); 
    23732627          this.originalPageX = event.pageX; 
    23742628          this.originalPageY = event.pageY; 
    23752629 
    23762630          //Adjust the mouse offset relative to the helper if "cursorAt" is supplied 
    2377           (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); 
     2631          ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) ); 
    23782632 
    23792633          //Cache the former DOM position 
    2380           this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; 
    2381  
    2382           //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way 
    2383           if(this.helper[0] !== this.currentItem[0]) { 
     2634          this.domPosition = { 
     2635               prev: this.currentItem.prev()[ 0 ], 
     2636               parent: this.currentItem.parent()[ 0 ] 
     2637          }; 
     2638 
     2639          // If the helper is not the original, hide the original so it's not playing any role during 
     2640          // the drag, won't cause anything bad this way 
     2641          if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { 
    23842642               this.currentItem.hide(); 
    23852643          } 
     
    23892647 
    23902648          //Set a containment if given in the options 
    2391           if(o.containment) { 
     2649          if ( o.containment ) { 
    23922650               this._setContainment(); 
    23932651          } 
    23942652 
    2395           if( o.cursor && o.cursor !== "auto" ) { // cursor option 
     2653          if ( o.cursor && o.cursor !== "auto" ) { // cursor option 
    23962654               body = this.document.find( "body" ); 
    23972655 
    2398                // support: IE 
     2656               // Support: IE 
    23992657               this.storedCursor = body.css( "cursor" ); 
    24002658               body.css( "cursor", o.cursor ); 
    24012659 
    2402                this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body ); 
    2403           } 
    2404  
    2405           if(o.opacity) { // opacity option 
    2406                if (this.helper.css("opacity")) { 
    2407                     this._storedOpacity = this.helper.css("opacity"); 
    2408                } 
    2409                this.helper.css("opacity", o.opacity); 
    2410           } 
    2411  
    2412           if(o.zIndex) { // zIndex option 
    2413                if (this.helper.css("zIndex")) { 
    2414                     this._storedZIndex = this.helper.css("zIndex"); 
    2415                } 
    2416                this.helper.css("zIndex", o.zIndex); 
     2660               this.storedStylesheet = 
     2661                    $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body ); 
     2662          } 
     2663 
     2664          if ( o.opacity ) { // opacity option 
     2665               if ( this.helper.css( "opacity" ) ) { 
     2666                    this._storedOpacity = this.helper.css( "opacity" ); 
     2667               } 
     2668               this.helper.css( "opacity", o.opacity ); 
     2669          } 
     2670 
     2671          if ( o.zIndex ) { // zIndex option 
     2672               if ( this.helper.css( "zIndex" ) ) { 
     2673                    this._storedZIndex = this.helper.css( "zIndex" ); 
     2674               } 
     2675               this.helper.css( "zIndex", o.zIndex ); 
    24172676          } 
    24182677 
    24192678          //Prepare scrolling 
    2420           if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") { 
     2679          if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && 
     2680                    this.scrollParent[ 0 ].tagName !== "HTML" ) { 
    24212681               this.overflowOffset = this.scrollParent.offset(); 
    24222682          } 
    24232683 
    24242684          //Call callbacks 
    2425           this._trigger("start", event, this._uiHash()); 
     2685          this._trigger( "start", event, this._uiHash() ); 
    24262686 
    24272687          //Recache the helper size 
    2428           if(!this._preserveHelperProportions) { 
     2688          if ( !this._preserveHelperProportions ) { 
    24292689               this._cacheHelperProportions(); 
    24302690          } 
    24312691 
    2432  
    24332692          //Post "activate" events to possible containers 
    2434           if( !noActivation ) { 
     2693          if ( !noActivation ) { 
    24352694               for ( i = this.containers.length - 1; i >= 0; i-- ) { 
    24362695                    this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); 
     
    24392698 
    24402699          //Prepare possible droppables 
    2441           if($.ui.ddmanager) { 
     2700          if ( $.ui.ddmanager ) { 
    24422701               $.ui.ddmanager.current = this; 
    24432702          } 
    24442703 
    2445           if ($.ui.ddmanager && !o.dropBehaviour) { 
    2446                $.ui.ddmanager.prepareOffsets(this, event); 
     2704          if ( $.ui.ddmanager && !o.dropBehaviour ) { 
     2705               $.ui.ddmanager.prepareOffsets( this, event ); 
    24472706          } 
    24482707 
    24492708          this.dragging = true; 
    24502709 
    2451           this.helper.addClass("ui-sortable-helper"); 
    2452           this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position 
     2710          this._addClass( this.helper, "ui-sortable-helper" ); 
     2711 
     2712          // Execute the drag once - this causes the helper not to be visiblebefore getting its 
     2713          // correct position 
     2714          this._mouseDrag( event ); 
    24532715          return true; 
    24542716 
    24552717     }, 
    24562718 
    2457      _mouseDrag: function(event) { 
     2719     _mouseDrag: function( event ) { 
    24582720          var i, item, itemElement, intersection, 
    24592721               o = this.options, 
     
    24612723 
    24622724          //Compute the helpers position 
    2463           this.position = this._generatePosition(event); 
    2464           this.positionAbs = this._convertPositionTo("absolute"); 
    2465  
    2466           if (!this.lastPositionAbs) { 
     2725          this.position = this._generatePosition( event ); 
     2726          this.positionAbs = this._convertPositionTo( "absolute" ); 
     2727 
     2728          if ( !this.lastPositionAbs ) { 
    24672729               this.lastPositionAbs = this.positionAbs; 
    24682730          } 
    24692731 
    24702732          //Do scrolling 
    2471           if(this.options.scroll) { 
    2472                if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") { 
    2473  
    2474                     if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) { 
    2475                          this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; 
    2476                     } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) { 
    2477                          this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; 
    2478                     } 
    2479  
    2480                     if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) { 
    2481                          this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; 
    2482                     } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) { 
    2483                          this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; 
     2733          if ( this.options.scroll ) { 
     2734               if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && 
     2735                         this.scrollParent[ 0 ].tagName !== "HTML" ) { 
     2736 
     2737                    if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - 
     2738                              event.pageY < o.scrollSensitivity ) { 
     2739                         this.scrollParent[ 0 ].scrollTop = 
     2740                              scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; 
     2741                    } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { 
     2742                         this.scrollParent[ 0 ].scrollTop = 
     2743                              scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; 
     2744                    } 
     2745 
     2746                    if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - 
     2747                              event.pageX < o.scrollSensitivity ) { 
     2748                         this.scrollParent[ 0 ].scrollLeft = scrolled = 
     2749                              this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; 
     2750                    } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { 
     2751                         this.scrollParent[ 0 ].scrollLeft = scrolled = 
     2752                              this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; 
    24842753                    } 
    24852754 
    24862755               } else { 
    24872756 
    2488                     if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) { 
    2489                          scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed); 
    2490                     } else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) { 
    2491                          scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed); 
    2492                     } 
    2493  
    2494                     if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) { 
    2495                          scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed); 
    2496                     } else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) { 
    2497                          scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed); 
    2498                     } 
    2499  
    2500                } 
    2501  
    2502                if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { 
    2503                     $.ui.ddmanager.prepareOffsets(this, event); 
     2757                    if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { 
     2758                         scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); 
     2759                    } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < 
     2760                              o.scrollSensitivity ) { 
     2761                         scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); 
     2762                    } 
     2763 
     2764                    if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { 
     2765                         scrolled = this.document.scrollLeft( 
     2766                              this.document.scrollLeft() - o.scrollSpeed 
     2767                         ); 
     2768                    } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < 
     2769                              o.scrollSensitivity ) { 
     2770                         scrolled = this.document.scrollLeft( 
     2771                              this.document.scrollLeft() + o.scrollSpeed 
     2772                         ); 
     2773                    } 
     2774 
     2775               } 
     2776 
     2777               if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { 
     2778                    $.ui.ddmanager.prepareOffsets( this, event ); 
    25042779               } 
    25052780          } 
    25062781 
    25072782          //Regenerate the absolute position used for position checks 
    2508           this.positionAbs = this._convertPositionTo("absolute"); 
     2783          this.positionAbs = this._convertPositionTo( "absolute" ); 
    25092784 
    25102785          //Set the helper position 
    2511           if(!this.options.axis || this.options.axis !== "y") { 
    2512                this.helper[0].style.left = this.position.left+"px"; 
    2513           } 
    2514           if(!this.options.axis || this.options.axis !== "x") { 
    2515                this.helper[0].style.top = this.position.top+"px"; 
     2786          if ( !this.options.axis || this.options.axis !== "y" ) { 
     2787               this.helper[ 0 ].style.left = this.position.left + "px"; 
     2788          } 
     2789          if ( !this.options.axis || this.options.axis !== "x" ) { 
     2790               this.helper[ 0 ].style.top = this.position.top + "px"; 
    25162791          } 
    25172792 
    25182793          //Rearrange 
    2519           for (i = this.items.length - 1; i >= 0; i--) { 
     2794          for ( i = this.items.length - 1; i >= 0; i-- ) { 
    25202795 
    25212796               //Cache variables and intersection, continue if no intersection 
    2522                item = this.items[i]; 
    2523                itemElement = item.item[0]; 
    2524                intersection = this._intersectsWithPointer(item); 
    2525                if (!intersection) { 
     2797               item = this.items[ i ]; 
     2798               itemElement = item.item[ 0 ]; 
     2799               intersection = this._intersectsWithPointer( item ); 
     2800               if ( !intersection ) { 
    25262801                    continue; 
    25272802               } 
     
    25342809               // Without this, moving items in "sub-sortables" can cause 
    25352810               // the placeholder to jitter between the outer and inner container. 
    2536                if (item.instance !== this.currentContainer) { 
     2811               if ( item.instance !== this.currentContainer ) { 
    25372812                    continue; 
    25382813               } 
    25392814 
    2540                // cannot intersect with itself 
     2815               // Cannot intersect with itself 
    25412816               // no useless actions that have been done before 
    25422817               // no action if the item moved is the parent of the item checked 
    2543                if (itemElement !== this.currentItem[0] && 
    2544                     this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement && 
    2545                     !$.contains(this.placeholder[0], itemElement) && 
    2546                     (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true) 
     2818               if ( itemElement !== this.currentItem[ 0 ] && 
     2819                    this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement && 
     2820                    !$.contains( this.placeholder[ 0 ], itemElement ) && 
     2821                    ( this.options.type === "semi-dynamic" ? 
     2822                         !$.contains( this.element[ 0 ], itemElement ) : 
     2823                         true 
     2824                    ) 
    25472825               ) { 
    25482826 
    25492827                    this.direction = intersection === 1 ? "down" : "up"; 
    25502828 
    2551                     if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { 
    2552                          this._rearrange(event, item); 
     2829                    if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) { 
     2830                         this._rearrange( event, item ); 
    25532831                    } else { 
    25542832                         break; 
    25552833                    } 
    25562834 
    2557                     this._trigger("change", event, this._uiHash()); 
     2835                    this._trigger( "change", event, this._uiHash() ); 
    25582836                    break; 
    25592837               } 
     
    25612839 
    25622840          //Post events to containers 
    2563           this._contactContainers(event); 
     2841          this._contactContainers( event ); 
    25642842 
    25652843          //Interconnect with droppables 
    2566           if($.ui.ddmanager) { 
    2567                $.ui.ddmanager.drag(this, event); 
     2844          if ( $.ui.ddmanager ) { 
     2845               $.ui.ddmanager.drag( this, event ); 
    25682846          } 
    25692847 
    25702848          //Call callbacks 
    2571           this._trigger("sort", event, this._uiHash()); 
     2849          this._trigger( "sort", event, this._uiHash() ); 
    25722850 
    25732851          this.lastPositionAbs = this.positionAbs; 
     
    25762854     }, 
    25772855 
    2578      _mouseStop: function(event, noPropagation) { 
    2579  
    2580           if(!event) { 
     2856     _mouseStop: function( event, noPropagation ) { 
     2857 
     2858          if ( !event ) { 
    25812859               return; 
    25822860          } 
    25832861 
    25842862          //If we are using droppables, inform the manager about the drop 
    2585           if ($.ui.ddmanager && !this.options.dropBehaviour) { 
    2586                $.ui.ddmanager.drop(this, event); 
    2587           } 
    2588  
    2589           if(this.options.revert) { 
     2863          if ( $.ui.ddmanager && !this.options.dropBehaviour ) { 
     2864               $.ui.ddmanager.drop( this, event ); 
     2865          } 
     2866 
     2867          if ( this.options.revert ) { 
    25902868               var that = this, 
    25912869                    cur = this.placeholder.offset(), 
     
    25942872 
    25952873               if ( !axis || axis === "x" ) { 
    2596                     animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft); 
     2874                    animation.left = cur.left - this.offset.parent.left - this.margins.left + 
     2875                         ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 
     2876                              0 : 
     2877                              this.offsetParent[ 0 ].scrollLeft 
     2878                         ); 
    25972879               } 
    25982880               if ( !axis || axis === "y" ) { 
    2599                     animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop); 
     2881                    animation.top = cur.top - this.offset.parent.top - this.margins.top + 
     2882                         ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 
     2883                              0 : 
     2884                              this.offsetParent[ 0 ].scrollTop 
     2885                         ); 
    26002886               } 
    26012887               this.reverting = true; 
    2602                $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() { 
    2603                     that._clear(event); 
    2604                }); 
     2888               $( this.helper ).animate( 
     2889                    animation, 
     2890                    parseInt( this.options.revert, 10 ) || 500, 
     2891                    function() { 
     2892                         that._clear( event ); 
     2893                    } 
     2894               ); 
    26052895          } else { 
    2606                this._clear(event, noPropagation); 
     2896               this._clear( event, noPropagation ); 
    26072897          } 
    26082898 
     
    26132903     cancel: function() { 
    26142904 
    2615           if(this.dragging) { 
    2616  
    2617                this._mouseUp({ target: null }); 
    2618  
    2619                if(this.options.helper === "original") { 
    2620                     this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); 
     2905          if ( this.dragging ) { 
     2906 
     2907               this._mouseUp( new $.Event( "mouseup", { target: null } ) ); 
     2908 
     2909               if ( this.options.helper === "original" ) { 
     2910                    this.currentItem.css( this._storedCSS ); 
     2911                    this._removeClass( this.currentItem, "ui-sortable-helper" ); 
    26212912               } else { 
    26222913                    this.currentItem.show(); 
     
    26242915 
    26252916               //Post deactivating events to containers 
    2626                for (var i = this.containers.length - 1; i >= 0; i--){ 
    2627                     this.containers[i]._trigger("deactivate", null, this._uiHash(this)); 
    2628                     if(this.containers[i].containerCache.over) { 
    2629                          this.containers[i]._trigger("out", null, this._uiHash(this)); 
    2630                          this.containers[i].containerCache.over = 0; 
    2631                     } 
    2632                } 
    2633  
    2634           } 
    2635  
    2636           if (this.placeholder) { 
    2637                //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! 
    2638                if(this.placeholder[0].parentNode) { 
    2639                     this.placeholder[0].parentNode.removeChild(this.placeholder[0]); 
    2640                } 
    2641                if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) { 
     2917               for ( var i = this.containers.length - 1; i >= 0; i-- ) { 
     2918                    this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) ); 
     2919                    if ( this.containers[ i ].containerCache.over ) { 
     2920                         this.containers[ i ]._trigger( "out", null, this._uiHash( this ) ); 
     2921                         this.containers[ i ].containerCache.over = 0; 
     2922                    } 
     2923               } 
     2924 
     2925          } 
     2926 
     2927          if ( this.placeholder ) { 
     2928 
     2929               //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, 
     2930               // it unbinds ALL events from the original node! 
     2931               if ( this.placeholder[ 0 ].parentNode ) { 
     2932                    this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); 
     2933               } 
     2934               if ( this.options.helper !== "original" && this.helper && 
     2935                         this.helper[ 0 ].parentNode ) { 
    26422936                    this.helper.remove(); 
    26432937               } 
    26442938 
    2645                $.extend(this, { 
     2939               $.extend( this, { 
    26462940                    helper: null, 
    26472941                    dragging: false, 
    26482942                    reverting: false, 
    26492943                    _noFinalSort: null 
    2650                }); 
    2651  
    2652                if(this.domPosition.prev) { 
    2653                     $(this.domPosition.prev).after(this.currentItem); 
     2944               } ); 
     2945 
     2946               if ( this.domPosition.prev ) { 
     2947                    $( this.domPosition.prev ).after( this.currentItem ); 
    26542948               } else { 
    2655                     $(this.domPosition.parent).prepend(this.currentItem); 
     2949                    $( this.domPosition.parent ).prepend( this.currentItem ); 
    26562950               } 
    26572951          } 
     
    26612955     }, 
    26622956 
    2663      serialize: function(o) { 
    2664  
    2665           var items = this._getItemsAsjQuery(o && o.connected), 
     2957     serialize: function( o ) { 
     2958 
     2959          var items = this._getItemsAsjQuery( o && o.connected ), 
    26662960               str = []; 
    26672961          o = o || {}; 
    26682962 
    2669           $(items).each(function() { 
    2670                var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/)); 
    2671                if (res) { 
    2672                     str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2])); 
    2673                } 
    2674           }); 
    2675  
    2676           if(!str.length && o.key) { 
    2677                str.push(o.key + "="); 
    2678           } 
    2679  
    2680           return str.join("&"); 
    2681  
    2682      }, 
    2683  
    2684      toArray: function(o) { 
    2685  
    2686           var items = this._getItemsAsjQuery(o && o.connected), 
     2963          $( items ).each( function() { 
     2964               var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" ) 
     2965                    .match( o.expression || ( /(.+)[\-=_](.+)/ ) ); 
     2966               if ( res ) { 
     2967                    str.push( 
     2968                         ( o.key || res[ 1 ] + "[]" ) + 
     2969                         "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) ); 
     2970               } 
     2971          } ); 
     2972 
     2973          if ( !str.length && o.key ) { 
     2974               str.push( o.key + "=" ); 
     2975          } 
     2976 
     2977          return str.join( "&" ); 
     2978 
     2979     }, 
     2980 
     2981     toArray: function( o ) { 
     2982 
     2983          var items = this._getItemsAsjQuery( o && o.connected ), 
    26872984               ret = []; 
    26882985 
    26892986          o = o || {}; 
    26902987 
    2691           items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); }); 
     2988          items.each( function() { 
     2989               ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" ); 
     2990          } ); 
    26922991          return ret; 
    26932992 
     
    26952994 
    26962995     /* Be careful with the following core functions */ 
    2697      _intersectsWith: function(item) { 
     2996     _intersectsWith: function( item ) { 
    26982997 
    26992998          var x1 = this.positionAbs.left, 
     
    27073006               dyClick = this.offset.click.top, 
    27083007               dxClick = this.offset.click.left, 
    2709                isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ), 
    2710                isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ), 
     3008               isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && 
     3009                    ( y1 + dyClick ) < b ), 
     3010               isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && 
     3011                    ( x1 + dxClick ) < r ), 
    27113012               isOverElement = isOverElementHeight && isOverElementWidth; 
    27123013 
    27133014          if ( this.options.tolerance === "pointer" || 
    27143015               this.options.forcePointerForContainers || 
    2715                (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"]) 
     3016               ( this.options.tolerance !== "pointer" && 
     3017                    this.helperProportions[ this.floating ? "width" : "height" ] > 
     3018                    item[ this.floating ? "width" : "height" ] ) 
    27163019          ) { 
    27173020               return isOverElement; 
    27183021          } else { 
    27193022 
    2720                return (l < x1 + (this.helperProportions.width / 2) && // Right Half 
    2721                     x2 - (this.helperProportions.width / 2) < r && // Left Half 
    2722                     t < y1 + (this.helperProportions.height / 2) && // Bottom Half 
    2723                     y2 - (this.helperProportions.height / 2) < b ); // Top Half 
    2724  
    2725           } 
    2726      }, 
    2727  
    2728      _intersectsWithPointer: function(item) { 
    2729  
    2730           var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), 
    2731                isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), 
    2732                isOverElement = isOverElementHeight && isOverElementWidth, 
     3023               return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half 
     3024                    x2 - ( this.helperProportions.width / 2 ) < r && // Left Half 
     3025                    t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half 
     3026                    y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half 
     3027 
     3028          } 
     3029     }, 
     3030 
     3031     _intersectsWithPointer: function( item ) { 
     3032          var verticalDirection, horizontalDirection, 
     3033               isOverElementHeight = ( this.options.axis === "x" ) || 
     3034                    this._isOverAxis( 
     3035                         this.positionAbs.top + this.offset.click.top, item.top, item.height ), 
     3036               isOverElementWidth = ( this.options.axis === "y" ) || 
     3037                    this._isOverAxis( 
     3038                         this.positionAbs.left + this.offset.click.left, item.left, item.width ), 
     3039               isOverElement = isOverElementHeight && isOverElementWidth; 
     3040 
     3041          if ( !isOverElement ) { 
     3042               return false; 
     3043          } 
     3044 
     3045          verticalDirection = this._getDragVerticalDirection(); 
     3046          horizontalDirection = this._getDragHorizontalDirection(); 
     3047 
     3048          return this.floating ? 
     3049               ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) 
     3050               : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); 
     3051 
     3052     }, 
     3053 
     3054     _intersectsWithSides: function( item ) { 
     3055 
     3056          var isOverBottomHalf = this._isOverAxis( this.positionAbs.top + 
     3057                    this.offset.click.top, item.top + ( item.height / 2 ), item.height ), 
     3058               isOverRightHalf = this._isOverAxis( this.positionAbs.left + 
     3059                    this.offset.click.left, item.left + ( item.width / 2 ), item.width ), 
    27333060               verticalDirection = this._getDragVerticalDirection(), 
    27343061               horizontalDirection = this._getDragHorizontalDirection(); 
    27353062 
    2736           if (!isOverElement) { 
    2737                return false; 
    2738           } 
    2739  
    2740           return this.floating ? 
    2741                ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 ) 
    2742                : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) ); 
    2743  
    2744      }, 
    2745  
    2746      _intersectsWithSides: function(item) { 
    2747  
    2748           var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), 
    2749                isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), 
    2750                verticalDirection = this._getDragVerticalDirection(), 
    2751                horizontalDirection = this._getDragHorizontalDirection(); 
    2752  
    2753           if (this.floating && horizontalDirection) { 
    2754                return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf)); 
     3063          if ( this.floating && horizontalDirection ) { 
     3064               return ( ( horizontalDirection === "right" && isOverRightHalf ) || 
     3065                    ( horizontalDirection === "left" && !isOverRightHalf ) ); 
    27553066          } else { 
    2756                return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf)); 
     3067               return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) || 
     3068                    ( verticalDirection === "up" && !isOverBottomHalf ) ); 
    27573069          } 
    27583070 
     
    27613073     _getDragVerticalDirection: function() { 
    27623074          var delta = this.positionAbs.top - this.lastPositionAbs.top; 
    2763           return delta !== 0 && (delta > 0 ? "down" : "up"); 
     3075          return delta !== 0 && ( delta > 0 ? "down" : "up" ); 
    27643076     }, 
    27653077 
    27663078     _getDragHorizontalDirection: function() { 
    27673079          var delta = this.positionAbs.left - this.lastPositionAbs.left; 
    2768           return delta !== 0 && (delta > 0 ? "right" : "left"); 
    2769      }, 
    2770  
    2771      refresh: function(event) { 
    2772           this._refreshItems(event); 
     3080          return delta !== 0 && ( delta > 0 ? "right" : "left" ); 
     3081     }, 
     3082 
     3083     refresh: function( event ) { 
     3084          this._refreshItems( event ); 
    27733085          this._setHandleClassName(); 
    27743086          this.refreshPositions(); 
     
    27783090     _connectWith: function() { 
    27793091          var options = this.options; 
    2780           return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith; 
    2781      }, 
    2782  
    2783      _getItemsAsjQuery: function(connected) { 
     3092          return options.connectWith.constructor === String ? 
     3093               [ options.connectWith ] : 
     3094               options.connectWith; 
     3095     }, 
     3096 
     3097     _getItemsAsjQuery: function( connected ) { 
    27843098 
    27853099          var i, j, cur, inst, 
     
    27883102               connectWith = this._connectWith(); 
    27893103 
    2790           if(connectWith && connected) { 
    2791                for (i = connectWith.length - 1; i >= 0; i--){ 
    2792                     cur = $(connectWith[i], this.document[0]); 
    2793                     for ( j = cur.length - 1; j >= 0; j--){ 
    2794                          inst = $.data(cur[j], this.widgetFullName); 
    2795                          if(inst && inst !== this && !inst.options.disabled) { 
    2796                               queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]); 
     3104          if ( connectWith && connected ) { 
     3105               for ( i = connectWith.length - 1; i >= 0; i-- ) { 
     3106                    cur = $( connectWith[ i ], this.document[ 0 ] ); 
     3107                    for ( j = cur.length - 1; j >= 0; j-- ) { 
     3108                         inst = $.data( cur[ j ], this.widgetFullName ); 
     3109                         if ( inst && inst !== this && !inst.options.disabled ) { 
     3110                              queries.push( [ $.isFunction( inst.options.items ) ? 
     3111                                   inst.options.items.call( inst.element ) : 
     3112                                   $( inst.options.items, inst.element ) 
     3113                                        .not( ".ui-sortable-helper" ) 
     3114                                        .not( ".ui-sortable-placeholder" ), inst ] ); 
    27973115                         } 
    27983116                    } 
     
    28003118          } 
    28013119 
    2802           queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]); 
     3120          queries.push( [ $.isFunction( this.options.items ) ? 
     3121               this.options.items 
     3122                    .call( this.element, null, { options: this.options, item: this.currentItem } ) : 
     3123               $( this.options.items, this.element ) 
     3124                    .not( ".ui-sortable-helper" ) 
     3125                    .not( ".ui-sortable-placeholder" ), this ] ); 
    28033126 
    28043127          function addItems() { 
    28053128               items.push( this ); 
    28063129          } 
    2807           for (i = queries.length - 1; i >= 0; i--){ 
    2808                queries[i][0].each( addItems ); 
    2809           } 
    2810  
    2811           return $(items); 
     3130          for ( i = queries.length - 1; i >= 0; i-- ) { 
     3131               queries[ i ][ 0 ].each( addItems ); 
     3132          } 
     3133 
     3134          return $( items ); 
    28123135 
    28133136     }, 
     
    28153138     _removeCurrentsFromItems: function() { 
    28163139 
    2817           var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); 
    2818  
    2819           this.items = $.grep(this.items, function (item) { 
    2820                for (var j=0; j < list.length; j++) { 
    2821                     if(list[j] === item.item[0]) { 
     3140          var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" ); 
     3141 
     3142          this.items = $.grep( this.items, function( item ) { 
     3143               for ( var j = 0; j < list.length; j++ ) { 
     3144                    if ( list[ j ] === item.item[ 0 ] ) { 
    28223145                         return false; 
    28233146                    } 
    28243147               } 
    28253148               return true; 
    2826           }); 
    2827  
    2828      }, 
    2829  
    2830      _refreshItems: function(event) { 
     3149          } ); 
     3150 
     3151     }, 
     3152 
     3153     _refreshItems: function( event ) { 
    28313154 
    28323155          this.items = []; 
    2833           this.containers = [this]; 
     3156          this.containers = [ this ]; 
    28343157 
    28353158          var i, j, cur, inst, targetData, _queries, item, queriesLength, 
    28363159               items = this.items, 
    2837                queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]], 
     3160               queries = [ [ $.isFunction( this.options.items ) ? 
     3161                    this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : 
     3162                    $( this.options.items, this.element ), this ] ], 
    28383163               connectWith = this._connectWith(); 
    28393164 
    2840           if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down 
    2841                for (i = connectWith.length - 1; i >= 0; i--){ 
    2842                     cur = $(connectWith[i], this.document[0]); 
    2843                     for (j = cur.length - 1; j >= 0; j--){ 
    2844                          inst = $.data(cur[j], this.widgetFullName); 
    2845                          if(inst && inst !== this && !inst.options.disabled) { 
    2846                               queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); 
    2847                               this.containers.push(inst); 
     3165          //Shouldn't be run the first time through due to massive slow-down 
     3166          if ( connectWith && this.ready ) { 
     3167               for ( i = connectWith.length - 1; i >= 0; i-- ) { 
     3168                    cur = $( connectWith[ i ], this.document[ 0 ] ); 
     3169                    for ( j = cur.length - 1; j >= 0; j-- ) { 
     3170                         inst = $.data( cur[ j ], this.widgetFullName ); 
     3171                         if ( inst && inst !== this && !inst.options.disabled ) { 
     3172                              queries.push( [ $.isFunction( inst.options.items ) ? 
     3173                                   inst.options.items 
     3174                                        .call( inst.element[ 0 ], event, { item: this.currentItem } ) : 
     3175                                   $( inst.options.items, inst.element ), inst ] ); 
     3176                              this.containers.push( inst ); 
    28483177                         } 
    28493178                    } 
     
    28513180          } 
    28523181 
    2853           for (i = queries.length - 1; i >= 0; i--) { 
    2854                targetData = queries[i][1]; 
    2855                _queries = queries[i][0]; 
    2856  
    2857                for (j=0, queriesLength = _queries.length; j < queriesLength; j++) { 
    2858                     item = $(_queries[j]); 
    2859  
    2860                     item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager) 
    2861  
    2862                     items.push({ 
     3182          for ( i = queries.length - 1; i >= 0; i-- ) { 
     3183               targetData = queries[ i ][ 1 ]; 
     3184               _queries = queries[ i ][ 0 ]; 
     3185 
     3186               for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) { 
     3187                    item = $( _queries[ j ] ); 
     3188 
     3189                    // Data for target checking (mouse manager) 
     3190                    item.data( this.widgetName + "-item", targetData ); 
     3191 
     3192                    items.push( { 
    28633193                         item: item, 
    28643194                         instance: targetData, 
    28653195                         width: 0, height: 0, 
    28663196                         left: 0, top: 0 
    2867                     }); 
    2868                } 
    2869           } 
    2870  
    2871      }, 
    2872  
    2873      refreshPositions: function(fast) { 
     3197                    } ); 
     3198               } 
     3199          } 
     3200 
     3201     }, 
     3202 
     3203     refreshPositions: function( fast ) { 
    28743204 
    28753205          // Determine whether items are being displayed horizontally 
     
    28783208               false; 
    28793209 
    2880           //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change 
    2881           if(this.offsetParent && this.helper) { 
     3210          //This has to be redone because due to the item being moved out/into the offsetParent, 
     3211          // the offsetParent's position will change 
     3212          if ( this.offsetParent && this.helper ) { 
    28823213               this.offset.parent = this._getParentOffset(); 
    28833214          } 
     
    28853216          var i, item, t, p; 
    28863217 
    2887           for (i = this.items.length - 1; i >= 0; i--){ 
    2888                item = this.items[i]; 
     3218          for ( i = this.items.length - 1; i >= 0; i-- ) { 
     3219               item = this.items[ i ]; 
    28893220 
    28903221               //We ignore calculating positions of all connected containers when we're not over them 
    2891                if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) { 
     3222               if ( item.instance !== this.currentContainer && this.currentContainer && 
     3223                         item.item[ 0 ] !== this.currentItem[ 0 ] ) { 
    28923224                    continue; 
    28933225               } 
    28943226 
    2895                t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; 
    2896  
    2897                if (!fast) { 
     3227               t = this.options.toleranceElement ? 
     3228                    $( this.options.toleranceElement, item.item ) : 
     3229                    item.item; 
     3230 
     3231               if ( !fast ) { 
    28983232                    item.width = t.outerWidth(); 
    28993233                    item.height = t.outerHeight(); 
     
    29053239          } 
    29063240 
    2907           if(this.options.custom && this.options.custom.refreshContainers) { 
    2908                this.options.custom.refreshContainers.call(this); 
     3241          if ( this.options.custom && this.options.custom.refreshContainers ) { 
     3242               this.options.custom.refreshContainers.call( this ); 
    29093243          } else { 
    2910                for (i = this.containers.length - 1; i >= 0; i--){ 
    2911                     p = this.containers[i].element.offset(); 
    2912                     this.containers[i].containerCache.left = p.left; 
    2913                     this.containers[i].containerCache.top = p.top; 
    2914                     this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); 
    2915                     this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); 
     3244               for ( i = this.containers.length - 1; i >= 0; i-- ) { 
     3245                    p = this.containers[ i ].element.offset(); 
     3246                    this.containers[ i ].containerCache.left = p.left; 
     3247                    this.containers[ i ].containerCache.top = p.top; 
     3248                    this.containers[ i ].containerCache.width = 
     3249                         this.containers[ i ].element.outerWidth(); 
     3250                    this.containers[ i ].containerCache.height = 
     3251                         this.containers[ i ].element.outerHeight(); 
    29163252               } 
    29173253          } 
     
    29203256     }, 
    29213257 
    2922      _createPlaceholder: function(that) { 
     3258     _createPlaceholder: function( that ) { 
    29233259          that = that || this; 
    29243260          var className, 
    29253261               o = that.options; 
    29263262 
    2927           if(!o.placeholder || o.placeholder.constructor === String) { 
     3263          if ( !o.placeholder || o.placeholder.constructor === String ) { 
    29283264               className = o.placeholder; 
    29293265               o.placeholder = { 
    29303266                    element: function() { 
    29313267 
    2932                          var nodeName = that.currentItem[0].nodeName.toLowerCase(), 
    2933                               element = $( "<" + nodeName + ">", that.document[0] ) 
    2934                                    .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") 
    2935                                    .removeClass("ui-sortable-helper"); 
     3268                         var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(), 
     3269                              element = $( "<" + nodeName + ">", that.document[ 0 ] ); 
     3270 
     3271                              that._addClass( element, "ui-sortable-placeholder", 
     3272                                        className || that.currentItem[ 0 ].className ) 
     3273                                   ._removeClass( element, "ui-sortable-helper" ); 
    29363274 
    29373275                         if ( nodeName === "tbody" ) { 
     
    29523290                         return element; 
    29533291                    }, 
    2954                     update: function(container, p) { 
    2955  
    2956                          // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that 
    2957                          // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified 
    2958                          if(className && !o.forcePlaceholderSize) { 
     3292                    update: function( container, p ) { 
     3293 
     3294                         // 1. If a className is set as 'placeholder option, we don't force sizes - 
     3295                         // the class is responsible for that 
     3296                         // 2. The option 'forcePlaceholderSize can be enabled to force it even if a 
     3297                         // class name is specified 
     3298                         if ( className && !o.forcePlaceholderSize ) { 
    29593299                              return; 
    29603300                         } 
    29613301 
    2962                          //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item 
    2963                          if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); } 
    2964                          if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); } 
     3302                         //If the element doesn't have a actual height by itself (without styles coming 
     3303                         // from a stylesheet), it receives the inline height from the dragged item 
     3304                         if ( !p.height() ) { 
     3305                              p.height( 
     3306                                   that.currentItem.innerHeight() - 
     3307                                   parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - 
     3308                                   parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) ); 
     3309                         } 
     3310                         if ( !p.width() ) { 
     3311                              p.width( 
     3312                                   that.currentItem.innerWidth() - 
     3313                                   parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) - 
     3314                                   parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) ); 
     3315                         } 
    29653316                    } 
    29663317               }; 
     
    29683319 
    29693320          //Create the placeholder 
    2970           that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); 
     3321          that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) ); 
    29713322 
    29723323          //Append it after the actual current item 
    2973           that.currentItem.after(that.placeholder); 
     3324          that.currentItem.after( that.placeholder ); 
    29743325 
    29753326          //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) 
    2976           o.placeholder.update(that, that.placeholder); 
     3327          o.placeholder.update( that, that.placeholder ); 
    29773328 
    29783329     }, 
     
    29813332          var that = this; 
    29823333 
    2983           sourceTr.children().each(function() { 
     3334          sourceTr.children().each( function() { 
    29843335               $( "<td>&#160;</td>", that.document[ 0 ] ) 
    29853336                    .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) 
    29863337                    .appendTo( targetTr ); 
    2987           }); 
    2988      }, 
    2989  
    2990      _contactContainers: function(event) { 
    2991           var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis, 
     3338          } ); 
     3339     }, 
     3340 
     3341     _contactContainers: function( event ) { 
     3342          var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, 
     3343               floating, axis, 
    29923344               innermostContainer = null, 
    29933345               innermostIndex = null; 
    29943346 
    2995           // get innermost container that intersects with item 
    2996           for (i = this.containers.length - 1; i >= 0; i--) { 
    2997  
    2998                // never consider a container that's located within the item itself 
    2999                if($.contains(this.currentItem[0], this.containers[i].element[0])) { 
     3347          // Get innermost container that intersects with item 
     3348          for ( i = this.containers.length - 1; i >= 0; i-- ) { 
     3349 
     3350               // Never consider a container that's located within the item itself 
     3351               if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) { 
    30003352                    continue; 
    30013353               } 
    30023354 
    3003                if(this._intersectsWith(this.containers[i].containerCache)) { 
    3004  
    3005                     // if we've already found a container and it's more "inner" than this, then continue 
    3006                     if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) { 
     3355               if ( this._intersectsWith( this.containers[ i ].containerCache ) ) { 
     3356 
     3357                    // If we've already found a container and it's more "inner" than this, then continue 
     3358                    if ( innermostContainer && 
     3359                              $.contains( 
     3360                                   this.containers[ i ].element[ 0 ], 
     3361                                   innermostContainer.element[ 0 ] ) ) { 
    30073362                         continue; 
    30083363                    } 
    30093364 
    3010                     innermostContainer = this.containers[i]; 
     3365                    innermostContainer = this.containers[ i ]; 
    30113366                    innermostIndex = i; 
    30123367 
    30133368               } else { 
     3369 
    30143370                    // container doesn't intersect. trigger "out" event if necessary 
    3015                     if(this.containers[i].containerCache.over) { 
    3016                          this.containers[i]._trigger("out", event, this._uiHash(this)); 
    3017                          this.containers[i].containerCache.over = 0; 
    3018                     } 
    3019                } 
    3020  
    3021           } 
    3022  
    3023           // if no intersecting containers found, return 
    3024           if(!innermostContainer) { 
     3371                    if ( this.containers[ i ].containerCache.over ) { 
     3372                         this.containers[ i ]._trigger( "out", event, this._uiHash( this ) ); 
     3373                         this.containers[ i ].containerCache.over = 0; 
     3374                    } 
     3375               } 
     3376 
     3377          } 
     3378 
     3379          // If no intersecting containers found, return 
     3380          if ( !innermostContainer ) { 
    30253381               return; 
    30263382          } 
    30273383 
    3028           // move the item into the container if it's not there already 
    3029           if(this.containers.length === 1) { 
    3030                if (!this.containers[innermostIndex].containerCache.over) { 
    3031                     this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); 
    3032                     this.containers[innermostIndex].containerCache.over = 1; 
     3384          // Move the item into the container if it's not there already 
     3385          if ( this.containers.length === 1 ) { 
     3386               if ( !this.containers[ innermostIndex ].containerCache.over ) { 
     3387                    this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); 
     3388                    this.containers[ innermostIndex ].containerCache.over = 1; 
    30333389               } 
    30343390          } else { 
    30353391 
    3036                //When entering a new container, we will find the item with the least distance and append our item near it 
     3392               // When entering a new container, we will find the item with the least distance and 
     3393               // append our item near it 
    30373394               dist = 10000; 
    30383395               itemWithLeastDistance = null; 
    3039                floating = innermostContainer.floating || this._isFloating(this.currentItem); 
     3396               floating = innermostContainer.floating || this._isFloating( this.currentItem ); 
    30403397               posProperty = floating ? "left" : "top"; 
    30413398               sizeProperty = floating ? "width" : "height"; 
    3042                axis = floating ? "clientX" : "clientY"; 
    3043  
    3044                for (j = this.items.length - 1; j >= 0; j--) { 
    3045                     if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) { 
     3399               axis = floating ? "pageX" : "pageY"; 
     3400 
     3401               for ( j = this.items.length - 1; j >= 0; j-- ) { 
     3402                    if ( !$.contains( 
     3403                              this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) 
     3404                    ) { 
    30463405                         continue; 
    30473406                    } 
    3048                     if(this.items[j].item[0] === this.currentItem[0]) { 
     3407                    if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) { 
    30493408                         continue; 
    30503409                    } 
    30513410 
    3052                     cur = this.items[j].item.offset()[posProperty]; 
     3411                    cur = this.items[ j ].item.offset()[ posProperty ]; 
    30533412                    nearBottom = false; 
    30543413                    if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { 
     
    30593418                         dist = Math.abs( event[ axis ] - cur ); 
    30603419                         itemWithLeastDistance = this.items[ j ]; 
    3061                          this.direction = nearBottom ? "up": "down"; 
     3420                         this.direction = nearBottom ? "up" : "down"; 
    30623421                    } 
    30633422               } 
    30643423 
    30653424               //Check if dropOnEmpty is enabled 
    3066                if(!itemWithLeastDistance && !this.options.dropOnEmpty) { 
     3425               if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) { 
    30673426                    return; 
    30683427               } 
    30693428 
    3070                if(this.currentContainer === this.containers[innermostIndex]) { 
     3429               if ( this.currentContainer === this.containers[ innermostIndex ] ) { 
    30713430                    if ( !this.currentContainer.containerCache.over ) { 
    30723431                         this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() ); 
     
    30763435               } 
    30773436 
    3078                itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); 
    3079                this._trigger("change", event, this._uiHash()); 
    3080                this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); 
    3081                this.currentContainer = this.containers[innermostIndex]; 
     3437               itemWithLeastDistance ? 
     3438                    this._rearrange( event, itemWithLeastDistance, null, true ) : 
     3439                    this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); 
     3440               this._trigger( "change", event, this._uiHash() ); 
     3441               this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); 
     3442               this.currentContainer = this.containers[ innermostIndex ]; 
    30823443 
    30833444               //Update the placeholder 
    3084                this.options.placeholder.update(this.currentContainer, this.placeholder); 
    3085  
    3086                this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); 
    3087                this.containers[innermostIndex].containerCache.over = 1; 
    3088           } 
    3089  
    3090  
    3091      }, 
    3092  
    3093      _createHelper: function(event) { 
     3445               this.options.placeholder.update( this.currentContainer, this.placeholder ); 
     3446 
     3447               this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); 
     3448               this.containers[ innermostIndex ].containerCache.over = 1; 
     3449          } 
     3450 
     3451     }, 
     3452 
     3453     _createHelper: function( event ) { 
    30943454 
    30953455          var o = this.options, 
    3096                helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem); 
     3456               helper = $.isFunction( o.helper ) ? 
     3457                    $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : 
     3458                    ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); 
    30973459 
    30983460          //Add the helper to the DOM if that didn't happen already 
    3099           if(!helper.parents("body").length) { 
    3100                $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); 
    3101           } 
    3102  
    3103           if(helper[0] === this.currentItem[0]) { 
    3104                this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; 
    3105           } 
    3106  
    3107           if(!helper[0].style.width || o.forceHelperSize) { 
    3108                helper.width(this.currentItem.width()); 
    3109           } 
    3110           if(!helper[0].style.height || o.forceHelperSize) { 
    3111                helper.height(this.currentItem.height()); 
     3461          if ( !helper.parents( "body" ).length ) { 
     3462               $( o.appendTo !== "parent" ? 
     3463                    o.appendTo : 
     3464                    this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] ); 
     3465          } 
     3466 
     3467          if ( helper[ 0 ] === this.currentItem[ 0 ] ) { 
     3468               this._storedCSS = { 
     3469                    width: this.currentItem[ 0 ].style.width, 
     3470                    height: this.currentItem[ 0 ].style.height, 
     3471                    position: this.currentItem.css( "position" ), 
     3472                    top: this.currentItem.css( "top" ), 
     3473                    left: this.currentItem.css( "left" ) 
     3474               }; 
     3475          } 
     3476 
     3477          if ( !helper[ 0 ].style.width || o.forceHelperSize ) { 
     3478               helper.width( this.currentItem.width() ); 
     3479          } 
     3480          if ( !helper[ 0 ].style.height || o.forceHelperSize ) { 
     3481               helper.height( this.currentItem.height() ); 
    31123482          } 
    31133483 
     
    31163486     }, 
    31173487 
    3118      _adjustOffsetFromHelper: function(obj) { 
    3119           if (typeof obj === "string") { 
    3120                obj = obj.split(" "); 
    3121           } 
    3122           if ($.isArray(obj)) { 
    3123                obj = {left: +obj[0], top: +obj[1] || 0}; 
    3124           } 
    3125           if ("left" in obj) { 
     3488     _adjustOffsetFromHelper: function( obj ) { 
     3489          if ( typeof obj === "string" ) { 
     3490               obj = obj.split( " " ); 
     3491          } 
     3492          if ( $.isArray( obj ) ) { 
     3493               obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; 
     3494          } 
     3495          if ( "left" in obj ) { 
    31263496               this.offset.click.left = obj.left + this.margins.left; 
    31273497          } 
    3128           if ("right" in obj) { 
     3498          if ( "right" in obj ) { 
    31293499               this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; 
    31303500          } 
    3131           if ("top" in obj) { 
     3501          if ( "top" in obj ) { 
    31323502               this.offset.click.top = obj.top + this.margins.top; 
    31333503          } 
    3134           if ("bottom" in obj) { 
     3504          if ( "bottom" in obj ) { 
    31353505               this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; 
    31363506          } 
     
    31383508 
    31393509     _getParentOffset: function() { 
    3140  
    31413510 
    31423511          //Get the offsetParent and cache its position 
     
    31443513          var po = this.offsetParent.offset(); 
    31453514 
    3146           // This is a special case where we need to modify a offset calculated on start, since the following happened: 
    3147           // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent 
    3148           // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that 
    3149           //    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag 
    3150           if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) { 
     3515          // This is a special case where we need to modify a offset calculated on start, since the 
     3516          // following happened: 
     3517          // 1. The position of the helper is absolute, so it's position is calculated based on the 
     3518          // next positioned parent 
     3519          // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't 
     3520          // the document, which means that the scroll is included in the initial calculation of the 
     3521          // offset of the parent, and never recalculated upon drag 
     3522          if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] && 
     3523                    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { 
    31513524               po.left += this.scrollParent.scrollLeft(); 
    31523525               po.top += this.scrollParent.scrollTop(); 
    31533526          } 
    31543527 
    3155           // This needs to be actually done for all browsers, since pageX/pageY includes this information 
    3156           // with an ugly IE fix 
    3157           if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) { 
     3528          // This needs to be actually done for all browsers, since pageX/pageY includes this 
     3529          // information with an ugly IE fix 
     3530          if ( this.offsetParent[ 0 ] === this.document[ 0 ].body || 
     3531                    ( this.offsetParent[ 0 ].tagName && 
     3532                    this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) { 
    31583533               po = { top: 0, left: 0 }; 
    31593534          } 
    31603535 
    31613536          return { 
    3162                top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), 
    3163                left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) 
     3537               top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), 
     3538               left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) 
    31643539          }; 
    31653540 
     
    31683543     _getRelativeOffset: function() { 
    31693544 
    3170           if(this.cssPosition === "relative") { 
     3545          if ( this.cssPosition === "relative" ) { 
    31713546               var p = this.currentItem.position(); 
    31723547               return { 
    3173                     top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), 
    3174                     left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() 
     3548                    top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + 
     3549                         this.scrollParent.scrollTop(), 
     3550                    left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + 
     3551                         this.scrollParent.scrollLeft() 
    31753552               }; 
    31763553          } else { 
     
    31823559     _cacheMargins: function() { 
    31833560          this.margins = { 
    3184                left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), 
    3185                top: (parseInt(this.currentItem.css("marginTop"),10) || 0) 
     3561               left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ), 
     3562               top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 ) 
    31863563          }; 
    31873564     }, 
     
    31983575          var ce, co, over, 
    31993576               o = this.options; 
    3200           if(o.containment === "parent") { 
    3201                o.containment = this.helper[0].parentNode; 
    3202           } 
    3203           if(o.containment === "document" || o.containment === "window") { 
     3577          if ( o.containment === "parent" ) { 
     3578               o.containment = this.helper[ 0 ].parentNode; 
     3579          } 
     3580          if ( o.containment === "document" || o.containment === "window" ) { 
    32043581               this.containment = [ 
    32053582                    0 - this.offset.relative.left - this.offset.parent.left, 
    32063583                    0 - this.offset.relative.top - this.offset.parent.top, 
    3207                     o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, 
    3208                     (o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top 
     3584                    o.containment === "document" ? 
     3585                         this.document.width() : 
     3586                         this.window.width() - this.helperProportions.width - this.margins.left, 
     3587                    ( o.containment === "document" ? 
     3588                         ( this.document.height() || document.body.parentNode.scrollHeight ) : 
     3589                         this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight 
     3590                    ) - this.helperProportions.height - this.margins.top 
    32093591               ]; 
    32103592          } 
    32113593 
    3212           if(!(/^(document|window|parent)$/).test(o.containment)) { 
    3213                ce = $(o.containment)[0]; 
    3214                co = $(o.containment).offset(); 
    3215                over = ($(ce).css("overflow") !== "hidden"); 
     3594          if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) { 
     3595               ce = $( o.containment )[ 0 ]; 
     3596               co = $( o.containment ).offset(); 
     3597               over = ( $( ce ).css( "overflow" ) !== "hidden" ); 
    32163598 
    32173599               this.containment = [ 
    3218                     co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, 
    3219                     co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, 
    3220                     co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, 
    3221                     co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top 
     3600                    co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) + 
     3601                         ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left, 
     3602                    co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) + 
     3603                         ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top, 
     3604                    co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - 
     3605                         ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) - 
     3606                         ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) - 
     3607                         this.helperProportions.width - this.margins.left, 
     3608                    co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - 
     3609                         ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) - 
     3610                         ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) - 
     3611                         this.helperProportions.height - this.margins.top 
    32223612               ]; 
    32233613          } 
     
    32253615     }, 
    32263616 
    3227      _convertPositionTo: function(d, pos) { 
    3228  
    3229           if(!pos) { 
     3617     _convertPositionTo: function( d, pos ) { 
     3618 
     3619          if ( !pos ) { 
    32303620               pos = this.position; 
    32313621          } 
    32323622          var mod = d === "absolute" ? 1 : -1, 
    3233                scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, 
    3234                scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); 
     3623               scroll = this.cssPosition === "absolute" && 
     3624                    !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 
     3625                    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? 
     3626                         this.offsetParent : 
     3627                         this.scrollParent, 
     3628               scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); 
    32353629 
    32363630          return { 
    32373631               top: ( 
    3238                     pos.top   +                                                                               // The absolute mouse position 
    3239                     this.offset.relative.top * mod +                                                // Only for relative positioned nodes: Relative offset from element to offset parent 
    3240                     this.offset.parent.top * mod -                                                       // The offsetParent's offset without borders (offset + border) 
    3241                     ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) 
     3632 
     3633                    // The absolute mouse position 
     3634                    pos.top   + 
     3635 
     3636                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     3637                    this.offset.relative.top * mod + 
     3638 
     3639                    // The offsetParent's offset without borders (offset + border) 
     3640                    this.offset.parent.top * mod - 
     3641                    ( ( this.cssPosition === "fixed" ? 
     3642                         -this.scrollParent.scrollTop() : 
     3643                         ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ) 
    32423644               ), 
    32433645               left: ( 
    3244                     pos.left +                                                                                // The absolute mouse position 
    3245                     this.offset.relative.left * mod +                                               // Only for relative positioned nodes: Relative offset from element to offset parent 
    3246                     this.offset.parent.left * mod -                                                 // The offsetParent's offset without borders (offset + border) 
    3247                     ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) 
     3646 
     3647                    // The absolute mouse position 
     3648                    pos.left + 
     3649 
     3650                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     3651                    this.offset.relative.left * mod + 
     3652 
     3653                    // The offsetParent's offset without borders (offset + border) 
     3654                    this.offset.parent.left * mod - 
     3655                    ( ( this.cssPosition === "fixed" ? 
     3656                         -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : 
     3657                         scroll.scrollLeft() ) * mod ) 
    32483658               ) 
    32493659          }; 
     
    32513661     }, 
    32523662 
    3253      _generatePosition: function(event) { 
     3663     _generatePosition: function( event ) { 
    32543664 
    32553665          var top, left, 
     
    32573667               pageX = event.pageX, 
    32583668               pageY = event.pageY, 
    3259                scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); 
     3669               scroll = this.cssPosition === "absolute" && 
     3670                    !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 
     3671                    $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? 
     3672                         this.offsetParent : 
     3673                         this.scrollParent, 
     3674                    scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); 
    32603675 
    32613676          // This is another very weird special case that only happens for relative elements: 
     
    32633678          // 2. and the scroll parent is the document or similar to the offset parent 
    32643679          // we have to refresh the relative offset during the scroll so there are no jumps 
    3265           if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) { 
     3680          if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 
     3681                    this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) { 
    32663682               this.offset.relative = this._getRelativeOffset(); 
    32673683          } 
     
    32723688           */ 
    32733689 
    3274           if(this.originalPosition) { //If we are not dragging yet, we won't check for options 
    3275  
    3276                if(this.containment) { 
    3277                     if(event.pageX - this.offset.click.left < this.containment[0]) { 
    3278                          pageX = this.containment[0] + this.offset.click.left; 
    3279                     } 
    3280                     if(event.pageY - this.offset.click.top < this.containment[1]) { 
    3281                          pageY = this.containment[1] + this.offset.click.top; 
    3282                     } 
    3283                     if(event.pageX - this.offset.click.left > this.containment[2]) { 
    3284                          pageX = this.containment[2] + this.offset.click.left; 
    3285                     } 
    3286                     if(event.pageY - this.offset.click.top > this.containment[3]) { 
    3287                          pageY = this.containment[3] + this.offset.click.top; 
    3288                     } 
    3289                } 
    3290  
    3291                if(o.grid) { 
    3292                     top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; 
    3293                     pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; 
    3294  
    3295                     left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; 
    3296                     pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; 
     3690          if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options 
     3691 
     3692               if ( this.containment ) { 
     3693                    if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) { 
     3694                         pageX = this.containment[ 0 ] + this.offset.click.left; 
     3695                    } 
     3696                    if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) { 
     3697                         pageY = this.containment[ 1 ] + this.offset.click.top; 
     3698                    } 
     3699                    if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) { 
     3700                         pageX = this.containment[ 2 ] + this.offset.click.left; 
     3701                    } 
     3702                    if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) { 
     3703                         pageY = this.containment[ 3 ] + this.offset.click.top; 
     3704                    } 
     3705               } 
     3706 
     3707               if ( o.grid ) { 
     3708                    top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) / 
     3709                         o.grid[ 1 ] ) * o.grid[ 1 ]; 
     3710                    pageY = this.containment ? 
     3711                         ( ( top - this.offset.click.top >= this.containment[ 1 ] && 
     3712                              top - this.offset.click.top <= this.containment[ 3 ] ) ? 
     3713                                   top : 
     3714                                   ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ? 
     3715                                        top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : 
     3716                                        top; 
     3717 
     3718                    left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) / 
     3719                         o.grid[ 0 ] ) * o.grid[ 0 ]; 
     3720                    pageX = this.containment ? 
     3721                         ( ( left - this.offset.click.left >= this.containment[ 0 ] && 
     3722                              left - this.offset.click.left <= this.containment[ 2 ] ) ? 
     3723                                   left : 
     3724                                   ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ? 
     3725                                        left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : 
     3726                                        left; 
    32973727               } 
    32983728 
     
    33013731          return { 
    33023732               top: ( 
    3303                     pageY -                                                                              // The absolute mouse position 
    3304                     this.offset.click.top -                                                              // Click offset (relative to the element) 
    3305                     this.offset.relative.top -                                                      // Only for relative positioned nodes: Relative offset from element to offset parent 
    3306                     this.offset.parent.top +                                                        // The offsetParent's offset without borders (offset + border) 
    3307                     ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) 
     3733 
     3734                    // The absolute mouse position 
     3735                    pageY - 
     3736 
     3737                    // Click offset (relative to the element) 
     3738                    this.offset.click.top - 
     3739 
     3740                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     3741                    this.offset.relative.top - 
     3742 
     3743                    // The offsetParent's offset without borders (offset + border) 
     3744                    this.offset.parent.top + 
     3745                    ( ( this.cssPosition === "fixed" ? 
     3746                         -this.scrollParent.scrollTop() : 
     3747                         ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) ) 
    33083748               ), 
    33093749               left: ( 
    3310                     pageX -                                                                              // The absolute mouse position 
    3311                     this.offset.click.left -                                                        // Click offset (relative to the element) 
    3312                     this.offset.relative.left     -                                                      // Only for relative positioned nodes: Relative offset from element to offset parent 
    3313                     this.offset.parent.left +                                                            // The offsetParent's offset without borders (offset + border) 
    3314                     ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) 
     3750 
     3751                    // The absolute mouse position 
     3752                    pageX - 
     3753 
     3754                    // Click offset (relative to the element) 
     3755                    this.offset.click.left - 
     3756 
     3757                    // Only for relative positioned nodes: Relative offset from element to offset parent 
     3758                    this.offset.relative.left - 
     3759 
     3760                    // The offsetParent's offset without borders (offset + border) 
     3761                    this.offset.parent.left + 
     3762                    ( ( this.cssPosition === "fixed" ? 
     3763                         -this.scrollParent.scrollLeft() : 
     3764                         scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) 
    33153765               ) 
    33163766          }; 
     
    33183768     }, 
    33193769 
    3320      _rearrange: function(event, i, a, hardRefresh) { 
    3321  
    3322           a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling)); 
     3770     _rearrange: function( event, i, a, hardRefresh ) { 
     3771 
     3772          a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) : 
     3773               i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], 
     3774                    ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); 
    33233775 
    33243776          //Various things done here to improve the performance: 
    33253777          // 1. we create a setTimeout, that calls refreshPositions 
    33263778          // 2. on the instance, we have a counter variable, that get's higher after every append 
    3327           // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same 
     3779          // 3. on the local scope, we copy the counter variable, and check in the timeout, 
     3780          // if it's still the same 
    33283781          // 4. this lets only the last addition to the timeout stack through 
    33293782          this.counter = this.counter ? ++this.counter : 1; 
    33303783          var counter = this.counter; 
    33313784 
    3332           this._delay(function() { 
    3333                if(counter === this.counter) { 
    3334                     this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove 
    3335                } 
    3336           }); 
    3337  
    3338      }, 
    3339  
    3340      _clear: function(event, noPropagation) { 
     3785          this._delay( function() { 
     3786               if ( counter === this.counter ) { 
     3787 
     3788                    //Precompute after each DOM insertion, NOT on mousemove 
     3789                    this.refreshPositions( !hardRefresh ); 
     3790               } 
     3791          } ); 
     3792 
     3793     }, 
     3794 
     3795     _clear: function( event, noPropagation ) { 
    33413796 
    33423797          this.reverting = false; 
    3343           // We delay all events that have to be triggered to after the point where the placeholder has been removed and 
    3344           // everything else normalized again 
     3798 
     3799          // We delay all events that have to be triggered to after the point where the placeholder 
     3800          // has been removed and everything else normalized again 
    33453801          var i, 
    33463802               delayedTriggers = []; 
    33473803 
    33483804          // We first have to update the dom position of the actual currentItem 
    3349           // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) 
    3350           if(!this._noFinalSort && this.currentItem.parent().length) { 
    3351                this.placeholder.before(this.currentItem); 
     3805          // Note: don't do it if the current item is already removed (by a user), or it gets 
     3806          // reappended (see #4088) 
     3807          if ( !this._noFinalSort && this.currentItem.parent().length ) { 
     3808               this.placeholder.before( this.currentItem ); 
    33523809          } 
    33533810          this._noFinalSort = null; 
    33543811 
    3355           if(this.helper[0] === this.currentItem[0]) { 
    3356                for(i in this._storedCSS) { 
    3357                     if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") { 
    3358                          this._storedCSS[i] = ""; 
    3359                     } 
    3360                } 
    3361                this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); 
     3812          if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) { 
     3813               for ( i in this._storedCSS ) { 
     3814                    if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) { 
     3815                         this._storedCSS[ i ] = ""; 
     3816                    } 
     3817               } 
     3818               this.currentItem.css( this._storedCSS ); 
     3819               this._removeClass( this.currentItem, "ui-sortable-helper" ); 
    33623820          } else { 
    33633821               this.currentItem.show(); 
    33643822          } 
    33653823 
    3366           if(this.fromOutside && !noPropagation) { 
    3367                delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); 
    3368           } 
    3369           if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) { 
    3370                delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed 
     3824          if ( this.fromOutside && !noPropagation ) { 
     3825               delayedTriggers.push( function( event ) { 
     3826                    this._trigger( "receive", event, this._uiHash( this.fromOutside ) ); 
     3827               } ); 
     3828          } 
     3829          if ( ( this.fromOutside || 
     3830                    this.domPosition.prev !== 
     3831                    this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] || 
     3832                    this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) { 
     3833 
     3834               // Trigger update callback if the DOM position has changed 
     3835               delayedTriggers.push( function( event ) { 
     3836                    this._trigger( "update", event, this._uiHash() ); 
     3837               } ); 
    33713838          } 
    33723839 
    33733840          // Check if the items Container has Changed and trigger appropriate 
    33743841          // events. 
    3375           if (this !== this.currentContainer) { 
    3376                if(!noPropagation) { 
    3377                     delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); 
    3378                     delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer)); 
    3379                     delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer)); 
    3380                } 
    3381           } 
    3382  
     3842          if ( this !== this.currentContainer ) { 
     3843               if ( !noPropagation ) { 
     3844                    delayedTriggers.push( function( event ) { 
     3845                         this._trigger( "remove", event, this._uiHash() ); 
     3846                    } ); 
     3847                    delayedTriggers.push( ( function( c ) { 
     3848                         return function( event ) { 
     3849                              c._trigger( "receive", event, this._uiHash( this ) ); 
     3850                         }; 
     3851                    } ).call( this, this.currentContainer ) ); 
     3852                    delayedTriggers.push( ( function( c ) { 
     3853                         return function( event ) { 
     3854                              c._trigger( "update", event, this._uiHash( this ) ); 
     3855                         }; 
     3856                    } ).call( this, this.currentContainer ) ); 
     3857               } 
     3858          } 
    33833859 
    33843860          //Post events to containers 
     
    33883864               }; 
    33893865          } 
    3390           for (i = this.containers.length - 1; i >= 0; i--){ 
    3391                if (!noPropagation) { 
     3866          for ( i = this.containers.length - 1; i >= 0; i-- ) { 
     3867               if ( !noPropagation ) { 
    33923868                    delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); 
    33933869               } 
    3394                if(this.containers[i].containerCache.over) { 
     3870               if ( this.containers[ i ].containerCache.over ) { 
    33953871                    delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); 
    3396                     this.containers[i].containerCache.over = 0; 
     3872                    this.containers[ i ].containerCache.over = 0; 
    33973873               } 
    33983874          } 
     
    34033879               this.storedStylesheet.remove(); 
    34043880          } 
    3405           if(this._storedOpacity) { 
    3406                this.helper.css("opacity", this._storedOpacity); 
    3407           } 
    3408           if(this._storedZIndex) { 
    3409                this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex); 
     3881          if ( this._storedOpacity ) { 
     3882               this.helper.css( "opacity", this._storedOpacity ); 
     3883          } 
     3884          if ( this._storedZIndex ) { 
     3885               this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex ); 
    34103886          } 
    34113887 
    34123888          this.dragging = false; 
    34133889 
    3414           if(!noPropagation) { 
    3415                this._trigger("beforeStop", event, this._uiHash()); 
    3416           } 
    3417  
    3418           //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! 
    3419           this.placeholder[0].parentNode.removeChild(this.placeholder[0]); 
     3890          if ( !noPropagation ) { 
     3891               this._trigger( "beforeStop", event, this._uiHash() ); 
     3892          } 
     3893 
     3894          //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, 
     3895          // it unbinds ALL events from the original node! 
     3896          this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); 
    34203897 
    34213898          if ( !this.cancelHelperRemoval ) { 
     
    34263903          } 
    34273904 
    3428           if(!noPropagation) { 
    3429                for (i=0; i < delayedTriggers.length; i++) { 
    3430                     delayedTriggers[i].call(this, event); 
    3431                } //Trigger all delayed events 
    3432                this._trigger("stop", event, this._uiHash()); 
     3905          if ( !noPropagation ) { 
     3906               for ( i = 0; i < delayedTriggers.length; i++ ) { 
     3907 
     3908                    // Trigger all delayed events 
     3909                    delayedTriggers[ i ].call( this, event ); 
     3910               } 
     3911               this._trigger( "stop", event, this._uiHash() ); 
    34333912          } 
    34343913 
     
    34393918 
    34403919     _trigger: function() { 
    3441           if ($.Widget.prototype._trigger.apply(this, arguments) === false) { 
     3920          if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) { 
    34423921               this.cancel(); 
    34433922          } 
    34443923     }, 
    34453924 
    3446      _uiHash: function(_inst) { 
     3925     _uiHash: function( _inst ) { 
    34473926          var inst = _inst || this; 
    34483927          return { 
    34493928               helper: inst.helper, 
    3450                placeholder: inst.placeholder || $([]), 
     3929               placeholder: inst.placeholder || $( [] ), 
    34513930               position: inst.position, 
    34523931               originalPosition: inst.originalPosition, 
     
    34573936     } 
    34583937 
    3459 }); 
     3938} ); 
    34603939 
    34613940 
    34623941/*! 
    3463  * jQuery UI Accordion 1.11.4 
     3942 * jQuery UI Accordion 1.12.1 
    34643943 * http://jqueryui.com 
    34653944 * 
     
    34673946 * Released under the MIT license. 
    34683947 * http://jquery.org/license 
    3469  * 
    3470  * http://api.jqueryui.com/accordion/ 
    34713948 */ 
    34723949 
    3473  
    3474 var accordion = $.widget( "ui.accordion", { 
    3475      version: "1.11.4", 
     3950//>>label: Accordion 
     3951//>>group: Widgets 
     3952// jscs:disable maximumLineLength 
     3953//>>description: Displays collapsible content panels for presenting information in a limited amount of space. 
     3954// jscs:enable maximumLineLength 
     3955//>>docs: http://api.jqueryui.com/accordion/ 
     3956//>>demos: http://jqueryui.com/accordion/ 
     3957//>>css.structure: ../../themes/base/core.css 
     3958//>>css.structure: ../../themes/base/accordion.css 
     3959//>>css.theme: ../../themes/base/theme.css 
     3960 
     3961 
     3962 
     3963var widgetsAccordion = $.widget( "ui.accordion", { 
     3964     version: "1.12.1", 
    34763965     options: { 
    34773966          active: 0, 
    34783967          animate: {}, 
     3968          classes: { 
     3969               "ui-accordion-header": "ui-corner-top", 
     3970               "ui-accordion-header-collapsed": "ui-corner-all", 
     3971               "ui-accordion-content": "ui-corner-bottom" 
     3972          }, 
    34793973          collapsible: false, 
    34803974          event: "click", 
    3481           header: "> li > :first-child,> :not(li):even", 
     3975          header: "> li > :first-child, > :not(li):even", 
    34823976          heightStyle: "auto", 
    34833977          icons: { 
     
    34863980          }, 
    34873981 
    3488           // callbacks 
     3982          // Callbacks 
    34893983          activate: null, 
    34903984          beforeActivate: null 
     
    35094003     _create: function() { 
    35104004          var options = this.options; 
     4005 
    35114006          this.prevShow = this.prevHide = $(); 
    3512           this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ) 
    3513                // ARIA 
    3514                .attr( "role", "tablist" ); 
    3515  
    3516           // don't allow collapsible: false and active: false / null 
    3517           if ( !options.collapsible && (options.active === false || options.active == null) ) { 
     4007          this._addClass( "ui-accordion", "ui-widget ui-helper-reset" ); 
     4008          this.element.attr( "role", "tablist" ); 
     4009 
     4010          // Don't allow collapsible: false and active: false / null 
     4011          if ( !options.collapsible && ( options.active === false || options.active == null ) ) { 
    35184012               options.active = 0; 
    35194013          } 
    35204014 
    35214015          this._processPanels(); 
     4016 
    35224017          // handle negative values 
    35234018          if ( options.active < 0 ) { 
     
    35354030 
    35364031     _createIcons: function() { 
    3537           var icons = this.options.icons; 
     4032          var icon, children, 
     4033               icons = this.options.icons; 
     4034 
    35384035          if ( icons ) { 
    3539                $( "<span>" ) 
    3540                     .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) 
    3541                     .prependTo( this.headers ); 
    3542                this.active.children( ".ui-accordion-header-icon" ) 
    3543                     .removeClass( icons.header ) 
    3544                     .addClass( icons.activeHeader ); 
    3545                this.headers.addClass( "ui-accordion-icons" ); 
     4036               icon = $( "<span>" ); 
     4037               this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header ); 
     4038               icon.prependTo( this.headers ); 
     4039               children = this.active.children( ".ui-accordion-header-icon" ); 
     4040               this._removeClass( children, icons.header ) 
     4041                    ._addClass( children, null, icons.activeHeader ) 
     4042                    ._addClass( this.headers, "ui-accordion-icons" ); 
    35464043          } 
    35474044     }, 
    35484045 
    35494046     _destroyIcons: function() { 
    3550           this.headers 
    3551                .removeClass( "ui-accordion-icons" ) 
    3552                .children( ".ui-accordion-header-icon" ) 
    3553                     .remove(); 
     4047          this._removeClass( this.headers, "ui-accordion-icons" ); 
     4048          this.headers.children( ".ui-accordion-header-icon" ).remove(); 
    35544049     }, 
    35554050 
     
    35574052          var contents; 
    35584053 
    3559           // clean up main element 
    3560           this.element 
    3561                .removeClass( "ui-accordion ui-widget ui-helper-reset" ) 
    3562                .removeAttr( "role" ); 
    3563  
    3564           // clean up headers 
     4054          // Clean up main element 
     4055          this.element.removeAttr( "role" ); 
     4056 
     4057          // Clean up headers 
    35654058          this.headers 
    3566                .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " + 
    3567                     "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) 
    3568                .removeAttr( "role" ) 
    3569                .removeAttr( "aria-expanded" ) 
    3570                .removeAttr( "aria-selected" ) 
    3571                .removeAttr( "aria-controls" ) 
    3572                .removeAttr( "tabIndex" ) 
     4059               .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" ) 
    35734060               .removeUniqueId(); 
    35744061 
    35754062          this._destroyIcons(); 
    35764063 
    3577           // clean up content panels 
     4064          // Clean up content panels 
    35784065          contents = this.headers.next() 
    3579                .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " + 
    3580                     "ui-accordion-content ui-accordion-content-active ui-state-disabled" ) 
    35814066               .css( "display", "" ) 
    3582                .removeAttr( "role" ) 
    3583                .removeAttr( "aria-hidden" ) 
    3584                .removeAttr( "aria-labelledby" ) 
     4067               .removeAttr( "role aria-hidden aria-labelledby" ) 
    35854068               .removeUniqueId(); 
    35864069 
     
    35924075     _setOption: function( key, value ) { 
    35934076          if ( key === "active" ) { 
     4077 
    35944078               // _activate() will handle invalid values and update this.options 
    35954079               this._activate( value ); 
     
    36064090          this._super( key, value ); 
    36074091 
    3608           // setting collapsible: false while collapsed; open first panel 
     4092          // Setting collapsible: false while collapsed; open first panel 
    36094093          if ( key === "collapsible" && !value && this.options.active === false ) { 
    36104094               this._activate( 0 ); 
     
    36174101               } 
    36184102          } 
    3619  
    3620           // #5332 - opacity doesn't cascade to positioned elements in IE 
     4103     }, 
     4104 
     4105     _setOptionDisabled: function( value ) { 
     4106          this._super( value ); 
     4107 
     4108          this.element.attr( "aria-disabled", value ); 
     4109 
     4110          // Support: IE8 Only 
     4111          // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE 
    36214112          // so we need to add the disabled class to the headers and panels 
    3622           if ( key === "disabled" ) { 
    3623                this.element 
    3624                     .toggleClass( "ui-state-disabled", !!value ) 
    3625                     .attr( "aria-disabled", value ); 
    3626                this.headers.add( this.headers.next() ) 
    3627                     .toggleClass( "ui-state-disabled", !!value ); 
    3628           } 
     4113          this._toggleClass( null, "ui-state-disabled", !!value ); 
     4114          this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled", 
     4115               !!value ); 
    36294116     }, 
    36304117 
     
    36404127 
    36414128          switch ( event.keyCode ) { 
    3642                case keyCode.RIGHT: 
    3643                case keyCode.DOWN: 
    3644                     toFocus = this.headers[ ( currentIndex + 1 ) % length ]; 
    3645                     break; 
    3646                case keyCode.LEFT: 
    3647                case keyCode.UP: 
    3648                     toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; 
    3649                     break; 
    3650                case keyCode.SPACE: 
    3651                case keyCode.ENTER: 
    3652                     this._eventHandler( event ); 
    3653                     break; 
    3654                case keyCode.HOME: 
    3655                     toFocus = this.headers[ 0 ]; 
    3656                     break; 
    3657                case keyCode.END: 
    3658                     toFocus = this.headers[ length - 1 ]; 
    3659                     break; 
     4129          case keyCode.RIGHT: 
     4130          case keyCode.DOWN: 
     4131               toFocus = this.headers[ ( currentIndex + 1 ) % length ]; 
     4132               break; 
     4133          case keyCode.LEFT: 
     4134          case keyCode.UP: 
     4135               toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; 
     4136               break; 
     4137          case keyCode.SPACE: 
     4138          case keyCode.ENTER: 
     4139               this._eventHandler( event ); 
     4140               break; 
     4141          case keyCode.HOME: 
     4142               toFocus = this.headers[ 0 ]; 
     4143               break; 
     4144          case keyCode.END: 
     4145               toFocus = this.headers[ length - 1 ]; 
     4146               break; 
    36604147          } 
    36614148 
     
    36634150               $( event.target ).attr( "tabIndex", -1 ); 
    36644151               $( toFocus ).attr( "tabIndex", 0 ); 
    3665                toFocus.focus(); 
     4152               $( toFocus ).trigger( "focus" ); 
    36664153               event.preventDefault(); 
    36674154          } 
     
    36704157     _panelKeyDown: function( event ) { 
    36714158          if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { 
    3672                $( event.currentTarget ).prev().focus(); 
     4159               $( event.currentTarget ).prev().trigger( "focus" ); 
    36734160          } 
    36744161     }, 
     
    36784165          this._processPanels(); 
    36794166 
    3680           // was collapsed or no panel 
    3681           if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) { 
     4167          // Was collapsed or no panel 
     4168          if ( ( options.active === false && options.collapsible === true ) || 
     4169                    !this.headers.length ) { 
    36824170               options.active = false; 
    36834171               this.active = $(); 
     4172 
    36844173          // active false only when collapsible is true 
    36854174          } else if ( options.active === false ) { 
    36864175               this._activate( 0 ); 
     4176 
    36874177          // was active, but active panel is gone 
    36884178          } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { 
     4179 
    36894180               // all remaining panel are disabled 
    3690                if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) { 
     4181               if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) { 
    36914182                    options.active = false; 
    36924183                    this.active = $(); 
     4184 
    36934185               // activate previous panel 
    36944186               } else { 
    36954187                    this._activate( Math.max( 0, options.active - 1 ) ); 
    36964188               } 
     4189 
    36974190          // was active, active panel still exists 
    36984191          } else { 
     4192 
    36994193               // make sure active index is correct 
    37004194               options.active = this.headers.index( this.active ); 
     
    37104204               prevPanels = this.panels; 
    37114205 
    3712           this.headers = this.element.find( this.options.header ) 
    3713                .addClass( "ui-accordion-header ui-state-default ui-corner-all" ); 
    3714  
    3715           this.panels = this.headers.next() 
    3716                .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) 
    3717                .filter( ":not(.ui-accordion-content-active)" ) 
    3718                .hide(); 
     4206          this.headers = this.element.find( this.options.header ); 
     4207          this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed", 
     4208               "ui-state-default" ); 
     4209 
     4210          this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide(); 
     4211          this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" ); 
    37194212 
    37204213          // Avoid memory leaks (#10056) 
     
    37314224               parent = this.element.parent(); 
    37324225 
    3733           this.active = this._findActive( options.active ) 
    3734                .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) 
    3735                .removeClass( "ui-corner-all" ); 
    3736           this.active.next() 
    3737                .addClass( "ui-accordion-content-active" ) 
    3738                .show(); 
     4226          this.active = this._findActive( options.active ); 
     4227          this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" ) 
     4228               ._removeClass( this.active, "ui-accordion-header-collapsed" ); 
     4229          this._addClass( this.active.next(), "ui-accordion-content-active" ); 
     4230          this.active.next().show(); 
    37394231 
    37404232          this.headers 
    37414233               .attr( "role", "tab" ) 
    3742                .each(function() { 
     4234               .each( function() { 
    37434235                    var header = $( this ), 
    37444236                         headerId = header.uniqueId().attr( "id" ), 
     
    37474239                    header.attr( "aria-controls", panelId ); 
    37484240                    panel.attr( "aria-labelledby", headerId ); 
    3749                }) 
     4241               } ) 
    37504242               .next() 
    37514243                    .attr( "role", "tabpanel" ); 
     
    37534245          this.headers 
    37544246               .not( this.active ) 
    3755                .attr({ 
    3756                     "aria-selected": "false", 
    3757                     "aria-expanded": "false", 
    3758                     tabIndex: -1 
    3759                }) 
    3760                .next() 
    3761                     .attr({ 
    3762                          "aria-hidden": "true" 
    3763                     }) 
    3764                     .hide(); 
    3765  
    3766           // make sure at least one header is in the tab order 
     4247                    .attr( { 
     4248                         "aria-selected": "false", 
     4249                         "aria-expanded": "false", 
     4250                         tabIndex: -1 
     4251                    } ) 
     4252                    .next() 
     4253                         .attr( { 
     4254                              "aria-hidden": "true" 
     4255                         } ) 
     4256                         .hide(); 
     4257 
     4258          // Make sure at least one header is in the tab order 
    37674259          if ( !this.active.length ) { 
    37684260               this.headers.eq( 0 ).attr( "tabIndex", 0 ); 
    37694261          } else { 
    3770                this.active.attr({ 
     4262               this.active.attr( { 
    37714263                    "aria-selected": "true", 
    37724264                    "aria-expanded": "true", 
    37734265                    tabIndex: 0 
    3774                }) 
    3775                .next() 
    3776                     .attr({ 
    3777                          "aria-hidden": "false" 
    3778                     }); 
     4266               } ) 
     4267                    .next() 
     4268                         .attr( { 
     4269                              "aria-hidden": "false" 
     4270                         } ); 
    37794271          } 
    37804272 
     
    37854277          if ( heightStyle === "fill" ) { 
    37864278               maxHeight = parent.height(); 
    3787                this.element.siblings( ":visible" ).each(function() { 
     4279               this.element.siblings( ":visible" ).each( function() { 
    37884280                    var elem = $( this ), 
    37894281                         position = elem.css( "position" ); 
     
    37934285                    } 
    37944286                    maxHeight -= elem.outerHeight( true ); 
    3795                }); 
    3796  
    3797                this.headers.each(function() { 
     4287               } ); 
     4288 
     4289               this.headers.each( function() { 
    37984290                    maxHeight -= $( this ).outerHeight( true ); 
    3799                }); 
     4291               } ); 
    38004292 
    38014293               this.headers.next() 
    3802                     .each(function() { 
     4294                    .each( function() { 
    38034295                         $( this ).height( Math.max( 0, maxHeight - 
    38044296                              $( this ).innerHeight() + $( this ).height() ) ); 
    3805                     }) 
     4297                    } ) 
    38064298                    .css( "overflow", "auto" ); 
    38074299          } else if ( heightStyle === "auto" ) { 
    38084300               maxHeight = 0; 
    38094301               this.headers.next() 
    3810                     .each(function() { 
     4302                    .each( function() { 
     4303                         var isVisible = $( this ).is( ":visible" ); 
     4304                         if ( !isVisible ) { 
     4305                              $( this ).show(); 
     4306                         } 
    38114307                         maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); 
    3812                     }) 
     4308                         if ( !isVisible ) { 
     4309                              $( this ).hide(); 
     4310                         } 
     4311                    } ) 
    38134312                    .height( maxHeight ); 
    38144313          } 
     
    38184317          var active = this._findActive( index )[ 0 ]; 
    38194318 
    3820           // trying to activate the already active panel 
     4319          // Trying to activate the already active panel 
    38214320          if ( active === this.active[ 0 ] ) { 
    38224321               return; 
    38234322          } 
    38244323 
    3825           // trying to collapse, simulate a click on the currently active header 
     4324          // Trying to collapse, simulate a click on the currently active header 
    38264325          active = active || this.active[ 0 ]; 
    38274326 
    3828           this._eventHandler({ 
     4327          this._eventHandler( { 
    38294328               target: active, 
    38304329               currentTarget: active, 
    38314330               preventDefault: $.noop 
    3832           }); 
     4331          } ); 
    38334332     }, 
    38344333 
     
    38444343               $.each( event.split( " " ), function( index, eventName ) { 
    38454344                    events[ eventName ] = "_eventHandler"; 
    3846                }); 
     4345               } ); 
    38474346          } 
    38484347 
    38494348          this._off( this.headers.add( this.headers.next() ) ); 
    38504349          this._on( this.headers, events ); 
    3851           this._on( this.headers.next(), { keydown: "_panelKeyDown" }); 
     4350          this._on( this.headers.next(), { keydown: "_panelKeyDown" } ); 
    38524351          this._hoverable( this.headers ); 
    38534352          this._focusable( this.headers ); 
     
    38554354 
    38564355     _eventHandler: function( event ) { 
    3857           var options = this.options, 
     4356          var activeChildren, clickedChildren, 
     4357               options = this.options, 
    38584358               active = this.active, 
    38594359               clicked = $( event.currentTarget ), 
     
    38724372 
    38734373          if ( 
     4374 
    38744375                    // click on active header, but not collapsible 
    38754376                    ( clickedIsActive && !options.collapsible ) || 
     4377 
    38764378                    // allow canceling activation 
    38774379                    ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { 
     
    38814383          options.active = collapsing ? false : this.headers.index( clicked ); 
    38824384 
    3883           // when the call to ._toggle() comes after the class changes 
     4385          // When the call to ._toggle() comes after the class changes 
    38844386          // it causes a very odd bug in IE 8 (see #6720) 
    38854387          this.active = clickedIsActive ? $() : clicked; 
    38864388          this._toggle( eventData ); 
    38874389 
    3888           // switch classes 
     4390          // Switch classes 
    38894391          // corner classes on the previously active header stay after the animation 
    3890           active.removeClass( "ui-accordion-header-active ui-state-active" ); 
     4392          this._removeClass( active, "ui-accordion-header-active", "ui-state-active" ); 
    38914393          if ( options.icons ) { 
    3892                active.children( ".ui-accordion-header-icon" ) 
    3893                     .removeClass( options.icons.activeHeader ) 
    3894                     .addClass( options.icons.header ); 
     4394               activeChildren = active.children( ".ui-accordion-header-icon" ); 
     4395               this._removeClass( activeChildren, null, options.icons.activeHeader ) 
     4396                    ._addClass( activeChildren, null, options.icons.header ); 
    38954397          } 
    38964398 
    38974399          if ( !clickedIsActive ) { 
    3898                clicked 
    3899                     .removeClass( "ui-corner-all" ) 
    3900                     .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); 
     4400               this._removeClass( clicked, "ui-accordion-header-collapsed" ) 
     4401                    ._addClass( clicked, "ui-accordion-header-active", "ui-state-active" ); 
    39014402               if ( options.icons ) { 
    3902                     clicked.children( ".ui-accordion-header-icon" ) 
    3903                          .removeClass( options.icons.header ) 
    3904                          .addClass( options.icons.activeHeader ); 
    3905                } 
    3906  
    3907                clicked 
    3908                     .next() 
    3909                     .addClass( "ui-accordion-content-active" ); 
     4403                    clickedChildren = clicked.children( ".ui-accordion-header-icon" ); 
     4404                    this._removeClass( clickedChildren, null, options.icons.header ) 
     4405                         ._addClass( clickedChildren, null, options.icons.activeHeader ); 
     4406               } 
     4407 
     4408               this._addClass( clicked.next(), "ui-accordion-content-active" ); 
    39104409          } 
    39114410     }, 
     
    39154414               toHide = this.prevShow.length ? this.prevShow : data.oldPanel; 
    39164415 
    3917           // handle activating a panel during the animation for another activation 
     4416          // Handle activating a panel during the animation for another activation 
    39184417          this.prevShow.add( this.prevHide ).stop( true, true ); 
    39194418          this.prevShow = toShow; 
     
    39284427          } 
    39294428 
    3930           toHide.attr({ 
     4429          toHide.attr( { 
    39314430               "aria-hidden": "true" 
    3932           }); 
    3933           toHide.prev().attr({ 
     4431          } ); 
     4432          toHide.prev().attr( { 
    39344433               "aria-selected": "false", 
    39354434               "aria-expanded": "false" 
    3936           }); 
     4435          } ); 
     4436 
    39374437          // if we're switching panels, remove the old header from the tab order 
    39384438          // if we're opening from collapsed state, remove the previous header from the tab order 
    39394439          // if we're collapsing, then keep the collapsing header in the tab order 
    39404440          if ( toShow.length && toHide.length ) { 
    3941                toHide.prev().attr({ 
     4441               toHide.prev().attr( { 
    39424442                    "tabIndex": -1, 
    39434443                    "aria-expanded": "false" 
    3944                }); 
     4444               } ); 
    39454445          } else if ( toShow.length ) { 
    3946                this.headers.filter(function() { 
     4446               this.headers.filter( function() { 
    39474447                    return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; 
    3948                }) 
    3949                .attr( "tabIndex", -1 ); 
     4448               } ) 
     4449                    .attr( "tabIndex", -1 ); 
    39504450          } 
    39514451 
     
    39534453               .attr( "aria-hidden", "false" ) 
    39544454               .prev() 
    3955                     .attr({ 
     4455                    .attr( { 
    39564456                         "aria-selected": "true", 
    39574457                         "aria-expanded": "true", 
    39584458                         tabIndex: 0 
    3959                     }); 
     4459                    } ); 
    39604460     }, 
    39614461 
     
    39794479               easing = options; 
    39804480          } 
     4481 
    39814482          // fall back from options to animation in case of partial down settings 
    39824483          easing = easing || options.easing || animate.easing; 
     
    39974498                    fx.now = Math.round( now ); 
    39984499               } 
    3999           }); 
     4500          } ); 
    40004501          toShow 
    40014502               .hide() 
     
    40154516                         } 
    40164517                    } 
    4017                }); 
     4518               } ); 
    40184519     }, 
    40194520 
    40204521     _toggleComplete: function( data ) { 
    4021           var toHide = data.oldPanel; 
    4022  
    4023           toHide 
    4024                .removeClass( "ui-accordion-content-active" ) 
    4025                .prev() 
    4026                     .removeClass( "ui-corner-top" ) 
    4027                     .addClass( "ui-corner-all" ); 
     4522          var toHide = data.oldPanel, 
     4523               prev = toHide.prev(); 
     4524 
     4525          this._removeClass( toHide, "ui-accordion-content-active" ); 
     4526          this._removeClass( prev, "ui-accordion-header-active" ) 
     4527               ._addClass( prev, "ui-accordion-header-collapsed" ); 
    40284528 
    40294529          // Work around for rendering bug in IE (#5421) 
     
    40334533          this._trigger( "activate", null, data ); 
    40344534     } 
    4035 }); 
     4535} ); 
     4536 
    40364537 
    40374538 
Note: See TracChangeset for help on using the changeset viewer.

Sites map