| @@ -0,0 +1,205 @@ | ||
| define([ | ||
| "./core", | ||
| "./var/rnotwhite" | ||
| ], function( jQuery, rnotwhite ) { | ||
|
|
||
| // String to Object options format cache | ||
| var optionsCache = {}; | ||
|
|
||
| // Convert String-formatted options into Object-formatted ones and store in cache | ||
| function createOptions( options ) { | ||
| var object = optionsCache[ options ] = {}; | ||
| jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { | ||
| object[ flag ] = true; | ||
| }); | ||
| return object; | ||
| } | ||
|
|
||
| /* | ||
| * Create a callback list using the following parameters: | ||
| * | ||
| * options: an optional list of space-separated options that will change how | ||
| * the callback list behaves or a more traditional option object | ||
| * | ||
| * By default a callback list will act like an event callback list and can be | ||
| * "fired" multiple times. | ||
| * | ||
| * Possible options: | ||
| * | ||
| * once: will ensure the callback list can only be fired once (like a Deferred) | ||
| * | ||
| * memory: will keep track of previous values and will call any callback added | ||
| * after the list has been fired right away with the latest "memorized" | ||
| * values (like a Deferred) | ||
| * | ||
| * unique: will ensure a callback can only be added once (no duplicate in the list) | ||
| * | ||
| * stopOnFalse: interrupt callings when a callback returns false | ||
| * | ||
| */ | ||
| jQuery.Callbacks = function( options ) { | ||
|
|
||
| // Convert options from String-formatted to Object-formatted if needed | ||
| // (we check in cache first) | ||
| options = typeof options === "string" ? | ||
| ( optionsCache[ options ] || createOptions( options ) ) : | ||
| jQuery.extend( {}, options ); | ||
|
|
||
| var // Last fire value (for non-forgettable lists) | ||
| memory, | ||
| // Flag to know if list was already fired | ||
| fired, | ||
| // Flag to know if list is currently firing | ||
| firing, | ||
| // First callback to fire (used internally by add and fireWith) | ||
| firingStart, | ||
| // End of the loop when firing | ||
| firingLength, | ||
| // Index of currently firing callback (modified by remove if needed) | ||
| firingIndex, | ||
| // Actual callback list | ||
| list = [], | ||
| // Stack of fire calls for repeatable lists | ||
| stack = !options.once && [], | ||
| // Fire callbacks | ||
| fire = function( data ) { | ||
| memory = options.memory && data; | ||
| fired = true; | ||
| firingIndex = firingStart || 0; | ||
| firingStart = 0; | ||
| firingLength = list.length; | ||
| firing = true; | ||
| for ( ; list && firingIndex < firingLength; firingIndex++ ) { | ||
| if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { | ||
| memory = false; // To prevent further calls using add | ||
| break; | ||
| } | ||
| } | ||
| firing = false; | ||
| if ( list ) { | ||
| if ( stack ) { | ||
| if ( stack.length ) { | ||
| fire( stack.shift() ); | ||
| } | ||
| } else if ( memory ) { | ||
| list = []; | ||
| } else { | ||
| self.disable(); | ||
| } | ||
| } | ||
| }, | ||
| // Actual Callbacks object | ||
| self = { | ||
| // Add a callback or a collection of callbacks to the list | ||
| add: function() { | ||
| if ( list ) { | ||
| // First, we save the current length | ||
| var start = list.length; | ||
| (function add( args ) { | ||
| jQuery.each( args, function( _, arg ) { | ||
| var type = jQuery.type( arg ); | ||
| if ( type === "function" ) { | ||
| if ( !options.unique || !self.has( arg ) ) { | ||
| list.push( arg ); | ||
| } | ||
| } else if ( arg && arg.length && type !== "string" ) { | ||
| // Inspect recursively | ||
| add( arg ); | ||
| } | ||
| }); | ||
| })( arguments ); | ||
| // Do we need to add the callbacks to the | ||
| // current firing batch? | ||
| if ( firing ) { | ||
| firingLength = list.length; | ||
| // With memory, if we're not firing then | ||
| // we should call right away | ||
| } else if ( memory ) { | ||
| firingStart = start; | ||
| fire( memory ); | ||
| } | ||
| } | ||
| return this; | ||
| }, | ||
| // Remove a callback from the list | ||
| remove: function() { | ||
| if ( list ) { | ||
| jQuery.each( arguments, function( _, arg ) { | ||
| var index; | ||
| while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { | ||
| list.splice( index, 1 ); | ||
| // Handle firing indexes | ||
| if ( firing ) { | ||
| if ( index <= firingLength ) { | ||
| firingLength--; | ||
| } | ||
| if ( index <= firingIndex ) { | ||
| firingIndex--; | ||
| } | ||
| } | ||
| } | ||
| }); | ||
| } | ||
| return this; | ||
| }, | ||
| // Check if a given callback is in the list. | ||
| // If no argument is given, return whether or not list has callbacks attached. | ||
| has: function( fn ) { | ||
| return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); | ||
| }, | ||
| // Remove all callbacks from the list | ||
| empty: function() { | ||
| list = []; | ||
| firingLength = 0; | ||
| return this; | ||
| }, | ||
| // Have the list do nothing anymore | ||
| disable: function() { | ||
| list = stack = memory = undefined; | ||
| return this; | ||
| }, | ||
| // Is it disabled? | ||
| disabled: function() { | ||
| return !list; | ||
| }, | ||
| // Lock the list in its current state | ||
| lock: function() { | ||
| stack = undefined; | ||
| if ( !memory ) { | ||
| self.disable(); | ||
| } | ||
| return this; | ||
| }, | ||
| // Is it locked? | ||
| locked: function() { | ||
| return !stack; | ||
| }, | ||
| // Call all callbacks with the given context and arguments | ||
| fireWith: function( context, args ) { | ||
| if ( list && ( !fired || stack ) ) { | ||
| args = args || []; | ||
| args = [ context, args.slice ? args.slice() : args ]; | ||
| if ( firing ) { | ||
| stack.push( args ); | ||
| } else { | ||
| fire( args ); | ||
| } | ||
| } | ||
| return this; | ||
| }, | ||
| // Call all the callbacks with the given arguments | ||
| fire: function() { | ||
| self.fireWith( this, arguments ); | ||
| return this; | ||
| }, | ||
| // To know if the callbacks have already been called at least once | ||
| fired: function() { | ||
| return !!fired; | ||
| } | ||
| }; | ||
|
|
||
| return self; | ||
| }; | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1,60 @@ | ||
| define([ | ||
| "../core" | ||
| ], function( jQuery ) { | ||
|
|
||
| // Multifunctional method to get and set values of a collection | ||
| // The value/s can optionally be executed if it's a function | ||
| var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { | ||
| var i = 0, | ||
| len = elems.length, | ||
| bulk = key == null; | ||
|
|
||
| // Sets many values | ||
| if ( jQuery.type( key ) === "object" ) { | ||
| chainable = true; | ||
| for ( i in key ) { | ||
| jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); | ||
| } | ||
|
|
||
| // Sets one value | ||
| } else if ( value !== undefined ) { | ||
| chainable = true; | ||
|
|
||
| if ( !jQuery.isFunction( value ) ) { | ||
| raw = true; | ||
| } | ||
|
|
||
| if ( bulk ) { | ||
| // Bulk operations run against the entire set | ||
| if ( raw ) { | ||
| fn.call( elems, value ); | ||
| fn = null; | ||
|
|
||
| // ...except when executing function values | ||
| } else { | ||
| bulk = fn; | ||
| fn = function( elem, key, value ) { | ||
| return bulk.call( jQuery( elem ), value ); | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| if ( fn ) { | ||
| for ( ; i < len; i++ ) { | ||
| fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return chainable ? | ||
| elems : | ||
|
|
||
| // Gets | ||
| bulk ? | ||
| fn.call( elems ) : | ||
| len ? fn( elems[0], key ) : emptyGet; | ||
| }; | ||
|
|
||
| return access; | ||
|
|
||
| }); |
| @@ -0,0 +1,123 @@ | ||
| // Initialize a jQuery object | ||
| define([ | ||
| "../core", | ||
| "./var/rsingleTag", | ||
| "../traversing/findFilter" | ||
| ], function( jQuery, rsingleTag ) { | ||
|
|
||
| // A central reference to the root jQuery(document) | ||
| var rootjQuery, | ||
|
|
||
| // A simple way to check for HTML strings | ||
| // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) | ||
| // Strict HTML recognition (#11290: must start with <) | ||
| rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, | ||
|
|
||
| init = jQuery.fn.init = function( selector, context ) { | ||
| var match, elem; | ||
|
|
||
| // HANDLE: $(""), $(null), $(undefined), $(false) | ||
| if ( !selector ) { | ||
| return this; | ||
| } | ||
|
|
||
| // Handle HTML strings | ||
| if ( typeof selector === "string" ) { | ||
| if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { | ||
| // Assume that strings that start and end with <> are HTML and skip the regex check | ||
| match = [ null, selector, null ]; | ||
|
|
||
| } else { | ||
| match = rquickExpr.exec( selector ); | ||
| } | ||
|
|
||
| // Match html or make sure no context is specified for #id | ||
| if ( match && (match[1] || !context) ) { | ||
|
|
||
| // HANDLE: $(html) -> $(array) | ||
| if ( match[1] ) { | ||
| context = context instanceof jQuery ? context[0] : context; | ||
|
|
||
| // Option to run scripts is true for back-compat | ||
| // Intentionally let the error be thrown if parseHTML is not present | ||
| jQuery.merge( this, jQuery.parseHTML( | ||
| match[1], | ||
| context && context.nodeType ? context.ownerDocument || context : document, | ||
| true | ||
| ) ); | ||
|
|
||
| // HANDLE: $(html, props) | ||
| if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { | ||
| for ( match in context ) { | ||
| // Properties of context are called as methods if possible | ||
| if ( jQuery.isFunction( this[ match ] ) ) { | ||
| this[ match ]( context[ match ] ); | ||
|
|
||
| // ...and otherwise set as attributes | ||
| } else { | ||
| this.attr( match, context[ match ] ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return this; | ||
|
|
||
| // HANDLE: $(#id) | ||
| } else { | ||
| elem = document.getElementById( match[2] ); | ||
|
|
||
| // Support: Blackberry 4.6 | ||
| // gEBID returns nodes no longer in the document (#6963) | ||
| if ( elem && elem.parentNode ) { | ||
| // Inject the element directly into the jQuery object | ||
| this.length = 1; | ||
| this[0] = elem; | ||
| } | ||
|
|
||
| this.context = document; | ||
| this.selector = selector; | ||
| return this; | ||
| } | ||
|
|
||
| // HANDLE: $(expr, $(...)) | ||
| } else if ( !context || context.jquery ) { | ||
| return ( context || rootjQuery ).find( selector ); | ||
|
|
||
| // HANDLE: $(expr, context) | ||
| // (which is just equivalent to: $(context).find(expr) | ||
| } else { | ||
| return this.constructor( context ).find( selector ); | ||
| } | ||
|
|
||
| // HANDLE: $(DOMElement) | ||
| } else if ( selector.nodeType ) { | ||
| this.context = this[0] = selector; | ||
| this.length = 1; | ||
| return this; | ||
|
|
||
| // HANDLE: $(function) | ||
| // Shortcut for document ready | ||
| } else if ( jQuery.isFunction( selector ) ) { | ||
| return typeof rootjQuery.ready !== "undefined" ? | ||
| rootjQuery.ready( selector ) : | ||
| // Execute immediately if ready is not present | ||
| selector( jQuery ); | ||
| } | ||
|
|
||
| if ( selector.selector !== undefined ) { | ||
| this.selector = selector.selector; | ||
| this.context = selector.context; | ||
| } | ||
|
|
||
| return jQuery.makeArray( selector, this ); | ||
| }; | ||
|
|
||
| // Give the init function the jQuery prototype for later instantiation | ||
| init.prototype = jQuery.fn; | ||
|
|
||
| // Initialize central reference | ||
| rootjQuery = jQuery( document ); | ||
|
|
||
| return init; | ||
|
|
||
| }); |
| @@ -0,0 +1,39 @@ | ||
| define([ | ||
| "../core", | ||
| "./var/rsingleTag", | ||
| "../manipulation" // buildFragment | ||
| ], function( jQuery, rsingleTag ) { | ||
|
|
||
| // data: string of html | ||
| // context (optional): If specified, the fragment will be created in this context, defaults to document | ||
| // keepScripts (optional): If true, will include scripts passed in the html string | ||
| jQuery.parseHTML = function( data, context, keepScripts ) { | ||
| if ( !data || typeof data !== "string" ) { | ||
| return null; | ||
| } | ||
| if ( typeof context === "boolean" ) { | ||
| keepScripts = context; | ||
| context = false; | ||
| } | ||
| context = context || document; | ||
|
|
||
| var parsed = rsingleTag.exec( data ), | ||
| scripts = !keepScripts && []; | ||
|
|
||
| // Single tag | ||
| if ( parsed ) { | ||
| return [ context.createElement( parsed[1] ) ]; | ||
| } | ||
|
|
||
| parsed = jQuery.buildFragment( [ data ], context, scripts ); | ||
|
|
||
| if ( scripts && scripts.length ) { | ||
| jQuery( scripts ).remove(); | ||
| } | ||
|
|
||
| return jQuery.merge( [], parsed.childNodes ); | ||
| }; | ||
|
|
||
| return jQuery.parseHTML; | ||
|
|
||
| }); |
| @@ -0,0 +1,97 @@ | ||
| define([ | ||
| "../core", | ||
| "../core/init", | ||
| "../deferred" | ||
| ], function( jQuery ) { | ||
|
|
||
| // The deferred used on DOM ready | ||
| var readyList; | ||
|
|
||
| jQuery.fn.ready = function( fn ) { | ||
| // Add the callback | ||
| jQuery.ready.promise().done( fn ); | ||
|
|
||
| return this; | ||
| }; | ||
|
|
||
| jQuery.extend({ | ||
| // Is the DOM ready to be used? Set to true once it occurs. | ||
| isReady: false, | ||
|
|
||
| // A counter to track how many items to wait for before | ||
| // the ready event fires. See #6781 | ||
| readyWait: 1, | ||
|
|
||
| // Hold (or release) the ready event | ||
| holdReady: function( hold ) { | ||
| if ( hold ) { | ||
| jQuery.readyWait++; | ||
| } else { | ||
| jQuery.ready( true ); | ||
| } | ||
| }, | ||
|
|
||
| // Handle when the DOM is ready | ||
| ready: function( wait ) { | ||
|
|
||
| // Abort if there are pending holds or we're already ready | ||
| if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { | ||
| return; | ||
| } | ||
|
|
||
| // Remember that the DOM is ready | ||
| jQuery.isReady = true; | ||
|
|
||
| // If a normal DOM Ready event fired, decrement, and wait if need be | ||
| if ( wait !== true && --jQuery.readyWait > 0 ) { | ||
| return; | ||
| } | ||
|
|
||
| // If there are functions bound, to execute | ||
| readyList.resolveWith( document, [ jQuery ] ); | ||
|
|
||
| // Trigger any bound ready events | ||
| if ( jQuery.fn.triggerHandler ) { | ||
| jQuery( document ).triggerHandler( "ready" ); | ||
| jQuery( document ).off( "ready" ); | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| /** | ||
| * The ready event handler and self cleanup method | ||
| */ | ||
| function completed() { | ||
| document.removeEventListener( "DOMContentLoaded", completed, false ); | ||
| window.removeEventListener( "load", completed, false ); | ||
| jQuery.ready(); | ||
| } | ||
|
|
||
| jQuery.ready.promise = function( obj ) { | ||
| if ( !readyList ) { | ||
|
|
||
| readyList = jQuery.Deferred(); | ||
|
|
||
| // Catch cases where $(document).ready() is called after the browser event has already occurred. | ||
| // We once tried to use readyState "interactive" here, but it caused issues like the one | ||
| // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 | ||
| if ( document.readyState === "complete" ) { | ||
| // Handle it asynchronously to allow scripts the opportunity to delay ready | ||
| setTimeout( jQuery.ready ); | ||
|
|
||
| } else { | ||
|
|
||
| // Use the handy event callback | ||
| document.addEventListener( "DOMContentLoaded", completed, false ); | ||
|
|
||
| // A fallback to window.onload, that will always work | ||
| window.addEventListener( "load", completed, false ); | ||
| } | ||
| } | ||
| return readyList.promise( obj ); | ||
| }; | ||
|
|
||
| // Kick off the DOM ready check even if the user does not | ||
| jQuery.ready.promise(); | ||
|
|
||
| }); |
| @@ -0,0 +1,4 @@ | ||
| define(function() { | ||
| // Match a standalone tag | ||
| return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); | ||
| }); |
| @@ -0,0 +1,22 @@ | ||
| define(function() { | ||
|
|
||
| function addGetHookIf( conditionFn, hookFn ) { | ||
| // Define the hook, we'll check on the first run if it's really needed. | ||
| return { | ||
| get: function() { | ||
| if ( conditionFn() ) { | ||
| // Hook not needed (or it's not possible to use it due | ||
| // to missing dependency), remove it. | ||
| delete this.get; | ||
| return; | ||
| } | ||
|
|
||
| // Hook needed; redefine it so that the support test is not executed again. | ||
| return (this.get = hookFn).apply( this, arguments ); | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| return addGetHookIf; | ||
|
|
||
| }); |
| @@ -0,0 +1,57 @@ | ||
| define([ | ||
| "../core", | ||
| "./var/rnumnonpx", | ||
| "./var/rmargin", | ||
| "./var/getStyles", | ||
| "../selector" // contains | ||
| ], function( jQuery, rnumnonpx, rmargin, getStyles ) { | ||
|
|
||
| function curCSS( elem, name, computed ) { | ||
| var width, minWidth, maxWidth, ret, | ||
| style = elem.style; | ||
|
|
||
| computed = computed || getStyles( elem ); | ||
|
|
||
| // Support: IE9 | ||
| // getPropertyValue is only needed for .css('filter') (#12537) | ||
| if ( computed ) { | ||
| ret = computed.getPropertyValue( name ) || computed[ name ]; | ||
| } | ||
|
|
||
| if ( computed ) { | ||
|
|
||
| if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { | ||
| ret = jQuery.style( elem, name ); | ||
| } | ||
|
|
||
| // Support: iOS < 6 | ||
| // A tribute to the "awesome hack by Dean Edwards" | ||
| // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels | ||
| // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values | ||
| if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { | ||
|
|
||
| // Remember the original values | ||
| width = style.width; | ||
| minWidth = style.minWidth; | ||
| maxWidth = style.maxWidth; | ||
|
|
||
| // Put in the new values to get a computed value out | ||
| style.minWidth = style.maxWidth = style.width = ret; | ||
| ret = computed.width; | ||
|
|
||
| // Revert the changed values | ||
| style.width = width; | ||
| style.minWidth = minWidth; | ||
| style.maxWidth = maxWidth; | ||
| } | ||
| } | ||
|
|
||
| return ret !== undefined ? | ||
| // Support: IE | ||
| // IE returns zIndex value as an integer. | ||
| ret + "" : | ||
| ret; | ||
| } | ||
|
|
||
| return curCSS; | ||
| }); |
| @@ -0,0 +1,70 @@ | ||
| define([ | ||
| "../core", | ||
| "../manipulation" // appendTo | ||
| ], function( jQuery ) { | ||
|
|
||
| var iframe, | ||
| elemdisplay = {}; | ||
|
|
||
| /** | ||
| * Retrieve the actual display of a element | ||
| * @param {String} name nodeName of the element | ||
| * @param {Object} doc Document object | ||
| */ | ||
| // Called only from within defaultDisplay | ||
| function actualDisplay( name, doc ) { | ||
| var style, | ||
| elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), | ||
|
|
||
| // getDefaultComputedStyle might be reliably used only on attached element | ||
| display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? | ||
|
|
||
| // Use of this method is a temporary fix (more like optimization) until something better comes along, | ||
| // since it was removed from specification and supported only in FF | ||
| style.display : jQuery.css( elem[ 0 ], "display" ); | ||
|
|
||
| // We don't have any data stored on the element, | ||
| // so use "detach" method as fast way to get rid of the element | ||
| elem.detach(); | ||
|
|
||
| return display; | ||
| } | ||
|
|
||
| /** | ||
| * Try to determine the default display value of an element | ||
| * @param {String} nodeName | ||
| */ | ||
| function defaultDisplay( nodeName ) { | ||
| var doc = document, | ||
| display = elemdisplay[ nodeName ]; | ||
|
|
||
| if ( !display ) { | ||
| display = actualDisplay( nodeName, doc ); | ||
|
|
||
| // If the simple way fails, read from inside an iframe | ||
| if ( display === "none" || !display ) { | ||
|
|
||
| // Use the already-created iframe if possible | ||
| iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); | ||
|
|
||
| // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse | ||
| doc = iframe[ 0 ].contentDocument; | ||
|
|
||
| // Support: IE | ||
| doc.write(); | ||
| doc.close(); | ||
|
|
||
| display = actualDisplay( nodeName, doc ); | ||
| iframe.detach(); | ||
| } | ||
|
|
||
| // Store the correct default display | ||
| elemdisplay[ nodeName ] = display; | ||
| } | ||
|
|
||
| return display; | ||
| } | ||
|
|
||
| return defaultDisplay; | ||
|
|
||
| }); |
| @@ -0,0 +1,15 @@ | ||
| define([ | ||
| "../core", | ||
| "../selector" | ||
| ], function( jQuery ) { | ||
|
|
||
| jQuery.expr.filters.hidden = function( elem ) { | ||
| // Support: Opera <= 12.12 | ||
| // Opera reports offsetWidths and offsetHeights less than zero on some elements | ||
| return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; | ||
| }; | ||
| jQuery.expr.filters.visible = function( elem ) { | ||
| return !jQuery.expr.filters.hidden( elem ); | ||
| }; | ||
|
|
||
| }); |
| @@ -0,0 +1,96 @@ | ||
| define([ | ||
| "../core", | ||
| "../var/support" | ||
| ], function( jQuery, support ) { | ||
|
|
||
| (function() { | ||
| var pixelPositionVal, boxSizingReliableVal, | ||
| docElem = document.documentElement, | ||
| container = document.createElement( "div" ), | ||
| div = document.createElement( "div" ); | ||
|
|
||
| if ( !div.style ) { | ||
| return; | ||
| } | ||
|
|
||
| // Support: IE9-11+ | ||
| // Style of cloned element affects source element cloned (#8908) | ||
| div.style.backgroundClip = "content-box"; | ||
| div.cloneNode( true ).style.backgroundClip = ""; | ||
| support.clearCloneStyle = div.style.backgroundClip === "content-box"; | ||
|
|
||
| container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" + | ||
| "position:absolute"; | ||
| container.appendChild( div ); | ||
|
|
||
| // Executing both pixelPosition & boxSizingReliable tests require only one layout | ||
| // so they're executed at the same time to save the second computation. | ||
| function computePixelPositionAndBoxSizingReliable() { | ||
| div.style.cssText = | ||
| // Support: Firefox<29, Android 2.3 | ||
| // Vendor-prefix box-sizing | ||
| "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + | ||
| "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + | ||
| "border:1px;padding:1px;width:4px;position:absolute"; | ||
| div.innerHTML = ""; | ||
| docElem.appendChild( container ); | ||
|
|
||
| var divStyle = window.getComputedStyle( div, null ); | ||
| pixelPositionVal = divStyle.top !== "1%"; | ||
| boxSizingReliableVal = divStyle.width === "4px"; | ||
|
|
||
| docElem.removeChild( container ); | ||
| } | ||
|
|
||
| // Support: node.js jsdom | ||
| // Don't assume that getComputedStyle is a property of the global object | ||
| if ( window.getComputedStyle ) { | ||
| jQuery.extend( support, { | ||
| pixelPosition: function() { | ||
|
|
||
| // This test is executed only once but we still do memoizing | ||
| // since we can use the boxSizingReliable pre-computing. | ||
| // No need to check if the test was already performed, though. | ||
| computePixelPositionAndBoxSizingReliable(); | ||
| return pixelPositionVal; | ||
| }, | ||
| boxSizingReliable: function() { | ||
| if ( boxSizingReliableVal == null ) { | ||
| computePixelPositionAndBoxSizingReliable(); | ||
| } | ||
| return boxSizingReliableVal; | ||
| }, | ||
| reliableMarginRight: function() { | ||
|
|
||
| // Support: Android 2.3 | ||
| // Check if div with explicit width and no margin-right incorrectly | ||
| // gets computed margin-right based on width of container. (#3333) | ||
| // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right | ||
| // This support function is only executed once so no memoizing is needed. | ||
| var ret, | ||
| marginDiv = div.appendChild( document.createElement( "div" ) ); | ||
|
|
||
| // Reset CSS: box-sizing; display; margin; border; padding | ||
| marginDiv.style.cssText = div.style.cssText = | ||
| // Support: Firefox<29, Android 2.3 | ||
| // Vendor-prefix box-sizing | ||
| "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + | ||
| "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; | ||
| marginDiv.style.marginRight = marginDiv.style.width = "0"; | ||
| div.style.width = "1px"; | ||
| docElem.appendChild( container ); | ||
|
|
||
| ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight ); | ||
|
|
||
| docElem.removeChild( container ); | ||
| div.removeChild( marginDiv ); | ||
|
|
||
| return ret; | ||
| } | ||
| }); | ||
| } | ||
| })(); | ||
|
|
||
| return support; | ||
|
|
||
| }); |
| @@ -0,0 +1,28 @@ | ||
| define([ | ||
| "../core" | ||
| ], function( jQuery ) { | ||
|
|
||
| // A method for quickly swapping in/out CSS properties to get correct calculations. | ||
| jQuery.swap = function( elem, options, callback, args ) { | ||
| var ret, name, | ||
| old = {}; | ||
|
|
||
| // Remember the old values, and insert the new ones | ||
| for ( name in options ) { | ||
| old[ name ] = elem.style[ name ]; | ||
| elem.style[ name ] = options[ name ]; | ||
| } | ||
|
|
||
| ret = callback.apply( elem, args || [] ); | ||
|
|
||
| // Revert the old values | ||
| for ( name in options ) { | ||
| elem.style[ name ] = old[ name ]; | ||
| } | ||
|
|
||
| return ret; | ||
| }; | ||
|
|
||
| return jQuery.swap; | ||
|
|
||
| }); |
| @@ -0,0 +1,3 @@ | ||
| define(function() { | ||
| return [ "Top", "Right", "Bottom", "Left" ]; | ||
| }); |
| @@ -0,0 +1,12 @@ | ||
| define(function() { | ||
| return function( elem ) { | ||
| // Support: IE<=11+, Firefox<=30+ (#15098, #14150) | ||
| // IE throws on elements created in popups | ||
| // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" | ||
| if ( elem.ownerDocument.defaultView.opener ) { | ||
| return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); | ||
| } | ||
|
|
||
| return window.getComputedStyle( elem, null ); | ||
| }; | ||
| }); |
| @@ -0,0 +1,13 @@ | ||
| define([ | ||
| "../../core", | ||
| "../../selector" | ||
| // css is assumed | ||
| ], function( jQuery ) { | ||
|
|
||
| return function( elem, el ) { | ||
| // isHidden might be called from jQuery#filter function; | ||
| // in that case, element will be second argument | ||
| elem = el || elem; | ||
| return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); | ||
| }; | ||
| }); |
| @@ -0,0 +1,3 @@ | ||
| define(function() { | ||
| return (/^margin/); | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "../../var/pnum" | ||
| ], function( pnum ) { | ||
| return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); | ||
| }); |
| @@ -0,0 +1,178 @@ | ||
| define([ | ||
| "./core", | ||
| "./var/rnotwhite", | ||
| "./core/access", | ||
| "./data/var/data_priv", | ||
| "./data/var/data_user" | ||
| ], function( jQuery, rnotwhite, access, data_priv, data_user ) { | ||
|
|
||
| // Implementation Summary | ||
| // | ||
| // 1. Enforce API surface and semantic compatibility with 1.9.x branch | ||
| // 2. Improve the module's maintainability by reducing the storage | ||
| // paths to a single mechanism. | ||
| // 3. Use the same single mechanism to support "private" and "user" data. | ||
| // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) | ||
| // 5. Avoid exposing implementation details on user objects (eg. expando properties) | ||
| // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 | ||
|
|
||
| var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, | ||
| rmultiDash = /([A-Z])/g; | ||
|
|
||
| function dataAttr( elem, key, data ) { | ||
| var name; | ||
|
|
||
| // If nothing was found internally, try to fetch any | ||
| // data from the HTML5 data-* attribute | ||
| if ( data === undefined && elem.nodeType === 1 ) { | ||
| name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); | ||
| data = elem.getAttribute( name ); | ||
|
|
||
| if ( typeof data === "string" ) { | ||
| try { | ||
| data = data === "true" ? true : | ||
| data === "false" ? false : | ||
| data === "null" ? null : | ||
| // Only convert to a number if it doesn't change the string | ||
| +data + "" === data ? +data : | ||
| rbrace.test( data ) ? jQuery.parseJSON( data ) : | ||
| data; | ||
| } catch( e ) {} | ||
|
|
||
| // Make sure we set the data so it isn't changed later | ||
| data_user.set( elem, key, data ); | ||
| } else { | ||
| data = undefined; | ||
| } | ||
| } | ||
| return data; | ||
| } | ||
|
|
||
| jQuery.extend({ | ||
| hasData: function( elem ) { | ||
| return data_user.hasData( elem ) || data_priv.hasData( elem ); | ||
| }, | ||
|
|
||
| data: function( elem, name, data ) { | ||
| return data_user.access( elem, name, data ); | ||
| }, | ||
|
|
||
| removeData: function( elem, name ) { | ||
| data_user.remove( elem, name ); | ||
| }, | ||
|
|
||
| // TODO: Now that all calls to _data and _removeData have been replaced | ||
| // with direct calls to data_priv methods, these can be deprecated. | ||
| _data: function( elem, name, data ) { | ||
| return data_priv.access( elem, name, data ); | ||
| }, | ||
|
|
||
| _removeData: function( elem, name ) { | ||
| data_priv.remove( elem, name ); | ||
| } | ||
| }); | ||
|
|
||
| jQuery.fn.extend({ | ||
| data: function( key, value ) { | ||
| var i, name, data, | ||
| elem = this[ 0 ], | ||
| attrs = elem && elem.attributes; | ||
|
|
||
| // Gets all values | ||
| if ( key === undefined ) { | ||
| if ( this.length ) { | ||
| data = data_user.get( elem ); | ||
|
|
||
| if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { | ||
| i = attrs.length; | ||
| while ( i-- ) { | ||
|
|
||
| // Support: IE11+ | ||
| // The attrs elements can be null (#14894) | ||
| if ( attrs[ i ] ) { | ||
| name = attrs[ i ].name; | ||
| if ( name.indexOf( "data-" ) === 0 ) { | ||
| name = jQuery.camelCase( name.slice(5) ); | ||
| dataAttr( elem, name, data[ name ] ); | ||
| } | ||
| } | ||
| } | ||
| data_priv.set( elem, "hasDataAttrs", true ); | ||
| } | ||
| } | ||
|
|
||
| return data; | ||
| } | ||
|
|
||
| // Sets multiple values | ||
| if ( typeof key === "object" ) { | ||
| return this.each(function() { | ||
| data_user.set( this, key ); | ||
| }); | ||
| } | ||
|
|
||
| return access( this, function( value ) { | ||
| var data, | ||
| camelKey = jQuery.camelCase( key ); | ||
|
|
||
| // The calling jQuery object (element matches) is not empty | ||
| // (and therefore has an element appears at this[ 0 ]) and the | ||
| // `value` parameter was not undefined. An empty jQuery object | ||
| // will result in `undefined` for elem = this[ 0 ] which will | ||
| // throw an exception if an attempt to read a data cache is made. | ||
| if ( elem && value === undefined ) { | ||
| // Attempt to get data from the cache | ||
| // with the key as-is | ||
| data = data_user.get( elem, key ); | ||
| if ( data !== undefined ) { | ||
| return data; | ||
| } | ||
|
|
||
| // Attempt to get data from the cache | ||
| // with the key camelized | ||
| data = data_user.get( elem, camelKey ); | ||
| if ( data !== undefined ) { | ||
| return data; | ||
| } | ||
|
|
||
| // Attempt to "discover" the data in | ||
| // HTML5 custom data-* attrs | ||
| data = dataAttr( elem, camelKey, undefined ); | ||
| if ( data !== undefined ) { | ||
| return data; | ||
| } | ||
|
|
||
| // We tried really hard, but the data doesn't exist. | ||
| return; | ||
| } | ||
|
|
||
| // Set the data... | ||
| this.each(function() { | ||
| // First, attempt to store a copy or reference of any | ||
| // data that might've been store with a camelCased key. | ||
| var data = data_user.get( this, camelKey ); | ||
|
|
||
| // For HTML5 data-* attribute interop, we have to | ||
| // store property names with dashes in a camelCase form. | ||
| // This might not apply to all properties...* | ||
| data_user.set( this, camelKey, value ); | ||
|
|
||
| // *... In the case of properties that might _actually_ | ||
| // have dashes, we need to also store a copy of that | ||
| // unchanged property. | ||
| if ( key.indexOf("-") !== -1 && data !== undefined ) { | ||
| data_user.set( this, key, value ); | ||
| } | ||
| }); | ||
| }, null, value, arguments.length > 1, null, true ); | ||
| }, | ||
|
|
||
| removeData: function( key ) { | ||
| return this.each(function() { | ||
| data_user.remove( this, key ); | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1,181 @@ | ||
| define([ | ||
| "../core", | ||
| "../var/rnotwhite", | ||
| "./accepts" | ||
| ], function( jQuery, rnotwhite ) { | ||
|
|
||
| function Data() { | ||
| // Support: Android<4, | ||
| // Old WebKit does not have Object.preventExtensions/freeze method, | ||
| // return new empty object instead with no [[set]] accessor | ||
| Object.defineProperty( this.cache = {}, 0, { | ||
| get: function() { | ||
| return {}; | ||
| } | ||
| }); | ||
|
|
||
| this.expando = jQuery.expando + Data.uid++; | ||
| } | ||
|
|
||
| Data.uid = 1; | ||
| Data.accepts = jQuery.acceptData; | ||
|
|
||
| Data.prototype = { | ||
| key: function( owner ) { | ||
| // We can accept data for non-element nodes in modern browsers, | ||
| // but we should not, see #8335. | ||
| // Always return the key for a frozen object. | ||
| if ( !Data.accepts( owner ) ) { | ||
| return 0; | ||
| } | ||
|
|
||
| var descriptor = {}, | ||
| // Check if the owner object already has a cache key | ||
| unlock = owner[ this.expando ]; | ||
|
|
||
| // If not, create one | ||
| if ( !unlock ) { | ||
| unlock = Data.uid++; | ||
|
|
||
| // Secure it in a non-enumerable, non-writable property | ||
| try { | ||
| descriptor[ this.expando ] = { value: unlock }; | ||
| Object.defineProperties( owner, descriptor ); | ||
|
|
||
| // Support: Android<4 | ||
| // Fallback to a less secure definition | ||
| } catch ( e ) { | ||
| descriptor[ this.expando ] = unlock; | ||
| jQuery.extend( owner, descriptor ); | ||
| } | ||
| } | ||
|
|
||
| // Ensure the cache object | ||
| if ( !this.cache[ unlock ] ) { | ||
| this.cache[ unlock ] = {}; | ||
| } | ||
|
|
||
| return unlock; | ||
| }, | ||
| set: function( owner, data, value ) { | ||
| var prop, | ||
| // There may be an unlock assigned to this node, | ||
| // if there is no entry for this "owner", create one inline | ||
| // and set the unlock as though an owner entry had always existed | ||
| unlock = this.key( owner ), | ||
| cache = this.cache[ unlock ]; | ||
|
|
||
| // Handle: [ owner, key, value ] args | ||
| if ( typeof data === "string" ) { | ||
| cache[ data ] = value; | ||
|
|
||
| // Handle: [ owner, { properties } ] args | ||
| } else { | ||
| // Fresh assignments by object are shallow copied | ||
| if ( jQuery.isEmptyObject( cache ) ) { | ||
| jQuery.extend( this.cache[ unlock ], data ); | ||
| // Otherwise, copy the properties one-by-one to the cache object | ||
| } else { | ||
| for ( prop in data ) { | ||
| cache[ prop ] = data[ prop ]; | ||
| } | ||
| } | ||
| } | ||
| return cache; | ||
| }, | ||
| get: function( owner, key ) { | ||
| // Either a valid cache is found, or will be created. | ||
| // New caches will be created and the unlock returned, | ||
| // allowing direct access to the newly created | ||
| // empty data object. A valid owner object must be provided. | ||
| var cache = this.cache[ this.key( owner ) ]; | ||
|
|
||
| return key === undefined ? | ||
| cache : cache[ key ]; | ||
| }, | ||
| access: function( owner, key, value ) { | ||
| var stored; | ||
| // In cases where either: | ||
| // | ||
| // 1. No key was specified | ||
| // 2. A string key was specified, but no value provided | ||
| // | ||
| // Take the "read" path and allow the get method to determine | ||
| // which value to return, respectively either: | ||
| // | ||
| // 1. The entire cache object | ||
| // 2. The data stored at the key | ||
| // | ||
| if ( key === undefined || | ||
| ((key && typeof key === "string") && value === undefined) ) { | ||
|
|
||
| stored = this.get( owner, key ); | ||
|
|
||
| return stored !== undefined ? | ||
| stored : this.get( owner, jQuery.camelCase(key) ); | ||
| } | ||
|
|
||
| // [*]When the key is not a string, or both a key and value | ||
| // are specified, set or extend (existing objects) with either: | ||
| // | ||
| // 1. An object of properties | ||
| // 2. A key and value | ||
| // | ||
| this.set( owner, key, value ); | ||
|
|
||
| // Since the "set" path can have two possible entry points | ||
| // return the expected data based on which path was taken[*] | ||
| return value !== undefined ? value : key; | ||
| }, | ||
| remove: function( owner, key ) { | ||
| var i, name, camel, | ||
| unlock = this.key( owner ), | ||
| cache = this.cache[ unlock ]; | ||
|
|
||
| if ( key === undefined ) { | ||
| this.cache[ unlock ] = {}; | ||
|
|
||
| } else { | ||
| // Support array or space separated string of keys | ||
| if ( jQuery.isArray( key ) ) { | ||
| // If "name" is an array of keys... | ||
| // When data is initially created, via ("key", "val") signature, | ||
| // keys will be converted to camelCase. | ||
| // Since there is no way to tell _how_ a key was added, remove | ||
| // both plain key and camelCase key. #12786 | ||
| // This will only penalize the array argument path. | ||
| name = key.concat( key.map( jQuery.camelCase ) ); | ||
| } else { | ||
| camel = jQuery.camelCase( key ); | ||
| // Try the string as a key before any manipulation | ||
| if ( key in cache ) { | ||
| name = [ key, camel ]; | ||
| } else { | ||
| // If a key with the spaces exists, use it. | ||
| // Otherwise, create an array by matching non-whitespace | ||
| name = camel; | ||
| name = name in cache ? | ||
| [ name ] : ( name.match( rnotwhite ) || [] ); | ||
| } | ||
| } | ||
|
|
||
| i = name.length; | ||
| while ( i-- ) { | ||
| delete cache[ name[ i ] ]; | ||
| } | ||
| } | ||
| }, | ||
| hasData: function( owner ) { | ||
| return !jQuery.isEmptyObject( | ||
| this.cache[ owner[ this.expando ] ] || {} | ||
| ); | ||
| }, | ||
| discard: function( owner ) { | ||
| if ( owner[ this.expando ] ) { | ||
| delete this.cache[ owner[ this.expando ] ]; | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| return Data; | ||
| }); |
| @@ -0,0 +1,20 @@ | ||
| define([ | ||
| "../core" | ||
| ], function( jQuery ) { | ||
|
|
||
| /** | ||
| * Determines whether an object can have data | ||
| */ | ||
| jQuery.acceptData = function( owner ) { | ||
| // Accepts only: | ||
| // - Node | ||
| // - Node.ELEMENT_NODE | ||
| // - Node.DOCUMENT_NODE | ||
| // - Object | ||
| // - Any | ||
| /* jshint -W018 */ | ||
| return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); | ||
| }; | ||
|
|
||
| return jQuery.acceptData; | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "../Data" | ||
| ], function( Data ) { | ||
| return new Data(); | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "../Data" | ||
| ], function( Data ) { | ||
| return new Data(); | ||
| }); |
| @@ -0,0 +1,149 @@ | ||
| define([ | ||
| "./core", | ||
| "./var/slice", | ||
| "./callbacks" | ||
| ], function( jQuery, slice ) { | ||
|
|
||
| jQuery.extend({ | ||
|
|
||
| Deferred: function( func ) { | ||
| var tuples = [ | ||
| // action, add listener, listener list, final state | ||
| [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], | ||
| [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], | ||
| [ "notify", "progress", jQuery.Callbacks("memory") ] | ||
| ], | ||
| state = "pending", | ||
| promise = { | ||
| state: function() { | ||
| return state; | ||
| }, | ||
| always: function() { | ||
| deferred.done( arguments ).fail( arguments ); | ||
| return this; | ||
| }, | ||
| then: function( /* fnDone, fnFail, fnProgress */ ) { | ||
| var fns = arguments; | ||
| return jQuery.Deferred(function( newDefer ) { | ||
| jQuery.each( tuples, function( i, tuple ) { | ||
| var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; | ||
| // deferred[ done | fail | progress ] for forwarding actions to newDefer | ||
| deferred[ tuple[1] ](function() { | ||
| var returned = fn && fn.apply( this, arguments ); | ||
| if ( returned && jQuery.isFunction( returned.promise ) ) { | ||
| returned.promise() | ||
| .done( newDefer.resolve ) | ||
| .fail( newDefer.reject ) | ||
| .progress( newDefer.notify ); | ||
| } else { | ||
| newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); | ||
| } | ||
| }); | ||
| }); | ||
| fns = null; | ||
| }).promise(); | ||
| }, | ||
| // Get a promise for this deferred | ||
| // If obj is provided, the promise aspect is added to the object | ||
| promise: function( obj ) { | ||
| return obj != null ? jQuery.extend( obj, promise ) : promise; | ||
| } | ||
| }, | ||
| deferred = {}; | ||
|
|
||
| // Keep pipe for back-compat | ||
| promise.pipe = promise.then; | ||
|
|
||
| // Add list-specific methods | ||
| jQuery.each( tuples, function( i, tuple ) { | ||
| var list = tuple[ 2 ], | ||
| stateString = tuple[ 3 ]; | ||
|
|
||
| // promise[ done | fail | progress ] = list.add | ||
| promise[ tuple[1] ] = list.add; | ||
|
|
||
| // Handle state | ||
| if ( stateString ) { | ||
| list.add(function() { | ||
| // state = [ resolved | rejected ] | ||
| state = stateString; | ||
|
|
||
| // [ reject_list | resolve_list ].disable; progress_list.lock | ||
| }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); | ||
| } | ||
|
|
||
| // deferred[ resolve | reject | notify ] | ||
| deferred[ tuple[0] ] = function() { | ||
| deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); | ||
| return this; | ||
| }; | ||
| deferred[ tuple[0] + "With" ] = list.fireWith; | ||
| }); | ||
|
|
||
| // Make the deferred a promise | ||
| promise.promise( deferred ); | ||
|
|
||
| // Call given func if any | ||
| if ( func ) { | ||
| func.call( deferred, deferred ); | ||
| } | ||
|
|
||
| // All done! | ||
| return deferred; | ||
| }, | ||
|
|
||
| // Deferred helper | ||
| when: function( subordinate /* , ..., subordinateN */ ) { | ||
| var i = 0, | ||
| resolveValues = slice.call( arguments ), | ||
| length = resolveValues.length, | ||
|
|
||
| // the count of uncompleted subordinates | ||
| remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, | ||
|
|
||
| // the master Deferred. If resolveValues consist of only a single Deferred, just use that. | ||
| deferred = remaining === 1 ? subordinate : jQuery.Deferred(), | ||
|
|
||
| // Update function for both resolve and progress values | ||
| updateFunc = function( i, contexts, values ) { | ||
| return function( value ) { | ||
| contexts[ i ] = this; | ||
| values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; | ||
| if ( values === progressValues ) { | ||
| deferred.notifyWith( contexts, values ); | ||
| } else if ( !( --remaining ) ) { | ||
| deferred.resolveWith( contexts, values ); | ||
| } | ||
| }; | ||
| }, | ||
|
|
||
| progressValues, progressContexts, resolveContexts; | ||
|
|
||
| // Add listeners to Deferred subordinates; treat others as resolved | ||
| if ( length > 1 ) { | ||
| progressValues = new Array( length ); | ||
| progressContexts = new Array( length ); | ||
| resolveContexts = new Array( length ); | ||
| for ( ; i < length; i++ ) { | ||
| if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { | ||
| resolveValues[ i ].promise() | ||
| .done( updateFunc( i, resolveContexts, resolveValues ) ) | ||
| .fail( deferred.reject ) | ||
| .progress( updateFunc( i, progressContexts, progressValues ) ); | ||
| } else { | ||
| --remaining; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // If we're not waiting on anything, resolve the master | ||
| if ( !remaining ) { | ||
| deferred.resolveWith( resolveContexts, resolveValues ); | ||
| } | ||
|
|
||
| return deferred.promise(); | ||
| } | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1,13 @@ | ||
| define([ | ||
| "./core", | ||
| "./traversing" | ||
| ], function( jQuery ) { | ||
|
|
||
| // The number of elements contained in the matched element set | ||
| jQuery.fn.size = function() { | ||
| return this.length; | ||
| }; | ||
|
|
||
| jQuery.fn.andSelf = jQuery.fn.addBack; | ||
|
|
||
| }); |
| @@ -0,0 +1,50 @@ | ||
| define([ | ||
| "./core", | ||
| "./core/access", | ||
| "./css" | ||
| ], function( jQuery, access ) { | ||
|
|
||
| // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods | ||
| jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { | ||
| jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { | ||
| // Margin is only for outerHeight, outerWidth | ||
| jQuery.fn[ funcName ] = function( margin, value ) { | ||
| var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), | ||
| extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); | ||
|
|
||
| return access( this, function( elem, type, value ) { | ||
| var doc; | ||
|
|
||
| if ( jQuery.isWindow( elem ) ) { | ||
| // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there | ||
| // isn't a whole lot we can do. See pull request at this URL for discussion: | ||
| // https://github.com/jquery/jquery/pull/764 | ||
| return elem.document.documentElement[ "client" + name ]; | ||
| } | ||
|
|
||
| // Get document width or height | ||
| if ( elem.nodeType === 9 ) { | ||
| doc = elem.documentElement; | ||
|
|
||
| // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], | ||
| // whichever is greatest | ||
| return Math.max( | ||
| elem.body[ "scroll" + name ], doc[ "scroll" + name ], | ||
| elem.body[ "offset" + name ], doc[ "offset" + name ], | ||
| doc[ "client" + name ] | ||
| ); | ||
| } | ||
|
|
||
| return value === undefined ? | ||
| // Get width or height on the element, requesting but not forcing parseFloat | ||
| jQuery.css( elem, type, extra ) : | ||
|
|
||
| // Set width or height on the element | ||
| jQuery.style( elem, type, value, extra ); | ||
| }, type, chainable ? margin : undefined, chainable, null ); | ||
| }; | ||
| }); | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1,114 @@ | ||
| define([ | ||
| "../core", | ||
| "../css" | ||
| ], function( jQuery ) { | ||
|
|
||
| function Tween( elem, options, prop, end, easing ) { | ||
| return new Tween.prototype.init( elem, options, prop, end, easing ); | ||
| } | ||
| jQuery.Tween = Tween; | ||
|
|
||
| Tween.prototype = { | ||
| constructor: Tween, | ||
| init: function( elem, options, prop, end, easing, unit ) { | ||
| this.elem = elem; | ||
| this.prop = prop; | ||
| this.easing = easing || "swing"; | ||
| this.options = options; | ||
| this.start = this.now = this.cur(); | ||
| this.end = end; | ||
| this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); | ||
| }, | ||
| cur: function() { | ||
| var hooks = Tween.propHooks[ this.prop ]; | ||
|
|
||
| return hooks && hooks.get ? | ||
| hooks.get( this ) : | ||
| Tween.propHooks._default.get( this ); | ||
| }, | ||
| run: function( percent ) { | ||
| var eased, | ||
| hooks = Tween.propHooks[ this.prop ]; | ||
|
|
||
| if ( this.options.duration ) { | ||
| this.pos = eased = jQuery.easing[ this.easing ]( | ||
| percent, this.options.duration * percent, 0, 1, this.options.duration | ||
| ); | ||
| } else { | ||
| this.pos = eased = percent; | ||
| } | ||
| this.now = ( this.end - this.start ) * eased + this.start; | ||
|
|
||
| if ( this.options.step ) { | ||
| this.options.step.call( this.elem, this.now, this ); | ||
| } | ||
|
|
||
| if ( hooks && hooks.set ) { | ||
| hooks.set( this ); | ||
| } else { | ||
| Tween.propHooks._default.set( this ); | ||
| } | ||
| return this; | ||
| } | ||
| }; | ||
|
|
||
| Tween.prototype.init.prototype = Tween.prototype; | ||
|
|
||
| Tween.propHooks = { | ||
| _default: { | ||
| get: function( tween ) { | ||
| var result; | ||
|
|
||
| if ( tween.elem[ tween.prop ] != null && | ||
| (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { | ||
| return tween.elem[ tween.prop ]; | ||
| } | ||
|
|
||
| // Passing an empty string as a 3rd parameter to .css will automatically | ||
| // attempt a parseFloat and fallback to a string if the parse fails. | ||
| // Simple values such as "10px" are parsed to Float; | ||
| // complex values such as "rotate(1rad)" are returned as-is. | ||
| result = jQuery.css( tween.elem, tween.prop, "" ); | ||
| // Empty strings, null, undefined and "auto" are converted to 0. | ||
| return !result || result === "auto" ? 0 : result; | ||
| }, | ||
| set: function( tween ) { | ||
| // Use step hook for back compat. | ||
| // Use cssHook if its there. | ||
| // Use .style if available and use plain properties where available. | ||
| if ( jQuery.fx.step[ tween.prop ] ) { | ||
| jQuery.fx.step[ tween.prop ]( tween ); | ||
| } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { | ||
| jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); | ||
| } else { | ||
| tween.elem[ tween.prop ] = tween.now; | ||
| } | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| // Support: IE9 | ||
| // Panic based approach to setting things on disconnected nodes | ||
| Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { | ||
| set: function( tween ) { | ||
| if ( tween.elem.nodeType && tween.elem.parentNode ) { | ||
| tween.elem[ tween.prop ] = tween.now; | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| jQuery.easing = { | ||
| linear: function( p ) { | ||
| return p; | ||
| }, | ||
| swing: function( p ) { | ||
| return 0.5 - Math.cos( p * Math.PI ) / 2; | ||
| } | ||
| }; | ||
|
|
||
| jQuery.fx = Tween.prototype.init; | ||
|
|
||
| // Back Compat <1.8 extension point | ||
| jQuery.fx.step = {}; | ||
|
|
||
| }); |
| @@ -0,0 +1,13 @@ | ||
| define([ | ||
| "../core", | ||
| "../selector", | ||
| "../effects" | ||
| ], function( jQuery ) { | ||
|
|
||
| jQuery.expr.filters.animated = function( elem ) { | ||
| return jQuery.grep(jQuery.timers, function( fn ) { | ||
| return elem === fn.elem; | ||
| }).length; | ||
| }; | ||
|
|
||
| }); |
| @@ -0,0 +1,13 @@ | ||
| define([ | ||
| "../core", | ||
| "../event" | ||
| ], function( jQuery ) { | ||
|
|
||
| // Attach a bunch of functions for handling common AJAX events | ||
| jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { | ||
| jQuery.fn[ type ] = function( fn ) { | ||
| return this.on( type, fn ); | ||
| }; | ||
| }); | ||
|
|
||
| }); |
| @@ -0,0 +1,39 @@ | ||
| define([ | ||
| "../core", | ||
| "../event" | ||
| ], function( jQuery ) { | ||
|
|
||
| jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + | ||
| "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + | ||
| "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { | ||
|
|
||
| // Handle event binding | ||
| jQuery.fn[ name ] = function( data, fn ) { | ||
| return arguments.length > 0 ? | ||
| this.on( name, null, data, fn ) : | ||
| this.trigger( name ); | ||
| }; | ||
| }); | ||
|
|
||
| jQuery.fn.extend({ | ||
| hover: function( fnOver, fnOut ) { | ||
| return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); | ||
| }, | ||
|
|
||
| bind: function( types, data, fn ) { | ||
| return this.on( types, null, data, fn ); | ||
| }, | ||
| unbind: function( types, fn ) { | ||
| return this.off( types, null, fn ); | ||
| }, | ||
|
|
||
| delegate: function( selector, types, data, fn ) { | ||
| return this.on( types, selector, data, fn ); | ||
| }, | ||
| undelegate: function( selector, types, fn ) { | ||
| // ( namespace ) or ( selector, types [, fn] ) | ||
| return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); | ||
| } | ||
| }); | ||
|
|
||
| }); |
| @@ -0,0 +1,9 @@ | ||
| define([ | ||
| "../var/support" | ||
| ], function( support ) { | ||
|
|
||
| support.focusinBubbles = "onfocusin" in window; | ||
|
|
||
| return support; | ||
|
|
||
| }); |
| @@ -0,0 +1,24 @@ | ||
| define([ | ||
| "../core" | ||
| ], function( jQuery ) { | ||
|
|
||
| // Register as a named AMD module, since jQuery can be concatenated with other | ||
| // files that may use define, but not via a proper concatenation script that | ||
| // understands anonymous AMD modules. A named AMD is safest and most robust | ||
| // way to register. Lowercase jquery is used because AMD module names are | ||
| // derived from file names, and jQuery is normally delivered in a lowercase | ||
| // file name. Do this after creating the global so that if an AMD module wants | ||
| // to call noConflict to hide this version of jQuery, it will work. | ||
|
|
||
| // Note that for maximum portability, libraries that are not jQuery should | ||
| // declare themselves as anonymous modules, and avoid setting a global if an | ||
| // AMD loader is present. jQuery is a special case. For more information, see | ||
| // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon | ||
|
|
||
| if ( typeof define === "function" && define.amd ) { | ||
| define( "jquery", [], function() { | ||
| return jQuery; | ||
| }); | ||
| } | ||
|
|
||
| }); |
| @@ -0,0 +1,32 @@ | ||
| define([ | ||
| "../core", | ||
| "../var/strundefined" | ||
| ], function( jQuery, strundefined ) { | ||
|
|
||
| var | ||
| // Map over jQuery in case of overwrite | ||
| _jQuery = window.jQuery, | ||
|
|
||
| // Map over the $ in case of overwrite | ||
| _$ = window.$; | ||
|
|
||
| jQuery.noConflict = function( deep ) { | ||
| if ( window.$ === jQuery ) { | ||
| window.$ = _$; | ||
| } | ||
|
|
||
| if ( deep && window.jQuery === jQuery ) { | ||
| window.jQuery = _jQuery; | ||
| } | ||
|
|
||
| return jQuery; | ||
| }; | ||
|
|
||
| // Expose jQuery and $ identifiers, even in AMD | ||
| // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) | ||
| // and CommonJS for browser emulators (#13566) | ||
| if ( typeof noGlobal === strundefined ) { | ||
| window.jQuery = window.$ = jQuery; | ||
| } | ||
|
|
||
| }); |
| @@ -0,0 +1,44 @@ | ||
| /*! | ||
| * jQuery JavaScript Library v@VERSION | ||
| * http://jquery.com/ | ||
| * | ||
| * Includes Sizzle.js | ||
| * http://sizzlejs.com/ | ||
| * | ||
| * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors | ||
| * Released under the MIT license | ||
| * http://jquery.org/license | ||
| * | ||
| * Date: @DATE | ||
| */ | ||
|
|
||
| (function( global, factory ) { | ||
|
|
||
| if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
| // For CommonJS and CommonJS-like environments where a proper `window` | ||
| // is present, execute the factory and get jQuery. | ||
| // For environments that do not have a `window` with a `document` | ||
| // (such as Node.js), expose a factory as module.exports. | ||
| // This accentuates the need for the creation of a real `window`. | ||
| // e.g. var jQuery = require("jquery")(window); | ||
| // See ticket #14549 for more info. | ||
| module.exports = global.document ? | ||
| factory( global, true ) : | ||
| function( w ) { | ||
| if ( !w.document ) { | ||
| throw new Error( "jQuery requires a window with a document" ); | ||
| } | ||
| return factory( w ); | ||
| }; | ||
| } else { | ||
| factory( global ); | ||
| } | ||
|
|
||
| // Pass this if window is not defined yet | ||
| }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | ||
|
|
||
| // Support: Firefox 18+ | ||
| // Can't be in strict mode, several libs including ASP.NET trace | ||
| // the stack via arguments.caller.callee and Firefox dies if | ||
| // you try to trace through "use strict" call chains. (#13335) | ||
| //"use strict"; |
| @@ -0,0 +1,37 @@ | ||
| define([ | ||
| "./core", | ||
| "./selector", | ||
| "./traversing", | ||
| "./callbacks", | ||
| "./deferred", | ||
| "./core/ready", | ||
| "./data", | ||
| "./queue", | ||
| "./queue/delay", | ||
| "./attributes", | ||
| "./event", | ||
| "./event/alias", | ||
| "./manipulation", | ||
| "./manipulation/_evalUrl", | ||
| "./wrap", | ||
| "./css", | ||
| "./css/hiddenVisibleSelectors", | ||
| "./serialize", | ||
| "./ajax", | ||
| "./ajax/xhr", | ||
| "./ajax/script", | ||
| "./ajax/jsonp", | ||
| "./ajax/load", | ||
| "./event/ajax", | ||
| "./effects", | ||
| "./effects/animatedSelector", | ||
| "./offset", | ||
| "./dimensions", | ||
| "./deprecated", | ||
| "./exports/amd", | ||
| "./exports/global" | ||
| ], function( jQuery ) { | ||
|
|
||
| return jQuery; | ||
|
|
||
| }); |
| @@ -0,0 +1,18 @@ | ||
| define([ | ||
| "../ajax" | ||
| ], function( jQuery ) { | ||
|
|
||
| jQuery._evalUrl = function( url ) { | ||
| return jQuery.ajax({ | ||
| url: url, | ||
| type: "GET", | ||
| dataType: "script", | ||
| async: false, | ||
| global: false, | ||
| "throws": true | ||
| }); | ||
| }; | ||
|
|
||
| return jQuery._evalUrl; | ||
|
|
||
| }); |
| @@ -0,0 +1,32 @@ | ||
| define([ | ||
| "../var/support" | ||
| ], function( support ) { | ||
|
|
||
| (function() { | ||
| var fragment = document.createDocumentFragment(), | ||
| div = fragment.appendChild( document.createElement( "div" ) ), | ||
| input = document.createElement( "input" ); | ||
|
|
||
| // Support: Safari<=5.1 | ||
| // Check state lost if the name is set (#11217) | ||
| // Support: Windows Web Apps (WWA) | ||
| // `name` and `type` must use .setAttribute for WWA (#14901) | ||
| input.setAttribute( "type", "radio" ); | ||
| input.setAttribute( "checked", "checked" ); | ||
| input.setAttribute( "name", "t" ); | ||
|
|
||
| div.appendChild( input ); | ||
|
|
||
| // Support: Safari<=5.1, Android<4.2 | ||
| // Older WebKit doesn't clone checked state correctly in fragments | ||
| support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; | ||
|
|
||
| // Support: IE<=11+ | ||
| // Make sure textarea (and checkbox) defaultValue is properly cloned | ||
| div.innerHTML = "<textarea>x</textarea>"; | ||
| support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; | ||
| })(); | ||
|
|
||
| return support; | ||
|
|
||
| }); |
| @@ -0,0 +1,3 @@ | ||
| define(function() { | ||
| return (/^(?:checkbox|radio)$/i); | ||
| }); |
| @@ -0,0 +1,207 @@ | ||
| define([ | ||
| "./core", | ||
| "./var/strundefined", | ||
| "./core/access", | ||
| "./css/var/rnumnonpx", | ||
| "./css/curCSS", | ||
| "./css/addGetHookIf", | ||
| "./css/support", | ||
|
|
||
| "./core/init", | ||
| "./css", | ||
| "./selector" // contains | ||
| ], function( jQuery, strundefined, access, rnumnonpx, curCSS, addGetHookIf, support ) { | ||
|
|
||
| var docElem = window.document.documentElement; | ||
|
|
||
| /** | ||
| * Gets a window from an element | ||
| */ | ||
| function getWindow( elem ) { | ||
| return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; | ||
| } | ||
|
|
||
| jQuery.offset = { | ||
| setOffset: function( elem, options, i ) { | ||
| var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, | ||
| position = jQuery.css( elem, "position" ), | ||
| curElem = jQuery( elem ), | ||
| props = {}; | ||
|
|
||
| // Set position first, in-case top/left are set even on static elem | ||
| if ( position === "static" ) { | ||
| elem.style.position = "relative"; | ||
| } | ||
|
|
||
| curOffset = curElem.offset(); | ||
| curCSSTop = jQuery.css( elem, "top" ); | ||
| curCSSLeft = jQuery.css( elem, "left" ); | ||
| calculatePosition = ( position === "absolute" || position === "fixed" ) && | ||
| ( curCSSTop + curCSSLeft ).indexOf("auto") > -1; | ||
|
|
||
| // Need to be able to calculate position if either | ||
| // top or left is auto and position is either absolute or fixed | ||
| if ( calculatePosition ) { | ||
| curPosition = curElem.position(); | ||
| curTop = curPosition.top; | ||
| curLeft = curPosition.left; | ||
|
|
||
| } else { | ||
| curTop = parseFloat( curCSSTop ) || 0; | ||
| curLeft = parseFloat( curCSSLeft ) || 0; | ||
| } | ||
|
|
||
| if ( jQuery.isFunction( options ) ) { | ||
| options = options.call( elem, i, curOffset ); | ||
| } | ||
|
|
||
| if ( options.top != null ) { | ||
| props.top = ( options.top - curOffset.top ) + curTop; | ||
| } | ||
| if ( options.left != null ) { | ||
| props.left = ( options.left - curOffset.left ) + curLeft; | ||
| } | ||
|
|
||
| if ( "using" in options ) { | ||
| options.using.call( elem, props ); | ||
|
|
||
| } else { | ||
| curElem.css( props ); | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| jQuery.fn.extend({ | ||
| offset: function( options ) { | ||
| if ( arguments.length ) { | ||
| return options === undefined ? | ||
| this : | ||
| this.each(function( i ) { | ||
| jQuery.offset.setOffset( this, options, i ); | ||
| }); | ||
| } | ||
|
|
||
| var docElem, win, | ||
| elem = this[ 0 ], | ||
| box = { top: 0, left: 0 }, | ||
| doc = elem && elem.ownerDocument; | ||
|
|
||
| if ( !doc ) { | ||
| return; | ||
| } | ||
|
|
||
| docElem = doc.documentElement; | ||
|
|
||
| // Make sure it's not a disconnected DOM node | ||
| if ( !jQuery.contains( docElem, elem ) ) { | ||
| return box; | ||
| } | ||
|
|
||
| // Support: BlackBerry 5, iOS 3 (original iPhone) | ||
| // If we don't have gBCR, just use 0,0 rather than error | ||
| if ( typeof elem.getBoundingClientRect !== strundefined ) { | ||
| box = elem.getBoundingClientRect(); | ||
| } | ||
| win = getWindow( doc ); | ||
| return { | ||
| top: box.top + win.pageYOffset - docElem.clientTop, | ||
| left: box.left + win.pageXOffset - docElem.clientLeft | ||
| }; | ||
| }, | ||
|
|
||
| position: function() { | ||
| if ( !this[ 0 ] ) { | ||
| return; | ||
| } | ||
|
|
||
| var offsetParent, offset, | ||
| elem = this[ 0 ], | ||
| parentOffset = { top: 0, left: 0 }; | ||
|
|
||
| // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent | ||
| if ( jQuery.css( elem, "position" ) === "fixed" ) { | ||
| // Assume getBoundingClientRect is there when computed position is fixed | ||
| offset = elem.getBoundingClientRect(); | ||
|
|
||
| } else { | ||
| // Get *real* offsetParent | ||
| offsetParent = this.offsetParent(); | ||
|
|
||
| // Get correct offsets | ||
| offset = this.offset(); | ||
| if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { | ||
| parentOffset = offsetParent.offset(); | ||
| } | ||
|
|
||
| // Add offsetParent borders | ||
| parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); | ||
| parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); | ||
| } | ||
|
|
||
| // Subtract parent offsets and element margins | ||
| return { | ||
| top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), | ||
| left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) | ||
| }; | ||
| }, | ||
|
|
||
| offsetParent: function() { | ||
| return this.map(function() { | ||
| var offsetParent = this.offsetParent || docElem; | ||
|
|
||
| while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { | ||
| offsetParent = offsetParent.offsetParent; | ||
| } | ||
|
|
||
| return offsetParent || docElem; | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| // Create scrollLeft and scrollTop methods | ||
| jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { | ||
| var top = "pageYOffset" === prop; | ||
|
|
||
| jQuery.fn[ method ] = function( val ) { | ||
| return access( this, function( elem, method, val ) { | ||
| var win = getWindow( elem ); | ||
|
|
||
| if ( val === undefined ) { | ||
| return win ? win[ prop ] : elem[ method ]; | ||
| } | ||
|
|
||
| if ( win ) { | ||
| win.scrollTo( | ||
| !top ? val : window.pageXOffset, | ||
| top ? val : window.pageYOffset | ||
| ); | ||
|
|
||
| } else { | ||
| elem[ method ] = val; | ||
| } | ||
| }, method, val, arguments.length, null ); | ||
| }; | ||
| }); | ||
|
|
||
| // Support: Safari<7+, Chrome<37+ | ||
| // Add the top/left cssHooks using jQuery.fn.position | ||
| // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 | ||
| // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280 | ||
| // getComputedStyle returns percent when specified for top/left/bottom/right; | ||
| // rather than make the css module depend on the offset module, just check for it here | ||
| jQuery.each( [ "top", "left" ], function( i, prop ) { | ||
| jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, | ||
| function( elem, computed ) { | ||
| if ( computed ) { | ||
| computed = curCSS( elem, prop ); | ||
| // If curCSS returns percentage, fallback to offset | ||
| return rnumnonpx.test( computed ) ? | ||
| jQuery( elem ).position()[ prop ] + "px" : | ||
| computed; | ||
| } | ||
| } | ||
| ); | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1 @@ | ||
| })); |
| @@ -0,0 +1,142 @@ | ||
| define([ | ||
| "./core", | ||
| "./data/var/data_priv", | ||
| "./deferred", | ||
| "./callbacks" | ||
| ], function( jQuery, data_priv ) { | ||
|
|
||
| jQuery.extend({ | ||
| queue: function( elem, type, data ) { | ||
| var queue; | ||
|
|
||
| if ( elem ) { | ||
| type = ( type || "fx" ) + "queue"; | ||
| queue = data_priv.get( elem, type ); | ||
|
|
||
| // Speed up dequeue by getting out quickly if this is just a lookup | ||
| if ( data ) { | ||
| if ( !queue || jQuery.isArray( data ) ) { | ||
| queue = data_priv.access( elem, type, jQuery.makeArray(data) ); | ||
| } else { | ||
| queue.push( data ); | ||
| } | ||
| } | ||
| return queue || []; | ||
| } | ||
| }, | ||
|
|
||
| dequeue: function( elem, type ) { | ||
| type = type || "fx"; | ||
|
|
||
| var queue = jQuery.queue( elem, type ), | ||
| startLength = queue.length, | ||
| fn = queue.shift(), | ||
| hooks = jQuery._queueHooks( elem, type ), | ||
| next = function() { | ||
| jQuery.dequeue( elem, type ); | ||
| }; | ||
|
|
||
| // If the fx queue is dequeued, always remove the progress sentinel | ||
| if ( fn === "inprogress" ) { | ||
| fn = queue.shift(); | ||
| startLength--; | ||
| } | ||
|
|
||
| if ( fn ) { | ||
|
|
||
| // Add a progress sentinel to prevent the fx queue from being | ||
| // automatically dequeued | ||
| if ( type === "fx" ) { | ||
| queue.unshift( "inprogress" ); | ||
| } | ||
|
|
||
| // Clear up the last queue stop function | ||
| delete hooks.stop; | ||
| fn.call( elem, next, hooks ); | ||
| } | ||
|
|
||
| if ( !startLength && hooks ) { | ||
| hooks.empty.fire(); | ||
| } | ||
| }, | ||
|
|
||
| // Not public - generate a queueHooks object, or return the current one | ||
| _queueHooks: function( elem, type ) { | ||
| var key = type + "queueHooks"; | ||
| return data_priv.get( elem, key ) || data_priv.access( elem, key, { | ||
| empty: jQuery.Callbacks("once memory").add(function() { | ||
| data_priv.remove( elem, [ type + "queue", key ] ); | ||
| }) | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| jQuery.fn.extend({ | ||
| queue: function( type, data ) { | ||
| var setter = 2; | ||
|
|
||
| if ( typeof type !== "string" ) { | ||
| data = type; | ||
| type = "fx"; | ||
| setter--; | ||
| } | ||
|
|
||
| if ( arguments.length < setter ) { | ||
| return jQuery.queue( this[0], type ); | ||
| } | ||
|
|
||
| return data === undefined ? | ||
| this : | ||
| this.each(function() { | ||
| var queue = jQuery.queue( this, type, data ); | ||
|
|
||
| // Ensure a hooks for this queue | ||
| jQuery._queueHooks( this, type ); | ||
|
|
||
| if ( type === "fx" && queue[0] !== "inprogress" ) { | ||
| jQuery.dequeue( this, type ); | ||
| } | ||
| }); | ||
| }, | ||
| dequeue: function( type ) { | ||
| return this.each(function() { | ||
| jQuery.dequeue( this, type ); | ||
| }); | ||
| }, | ||
| clearQueue: function( type ) { | ||
| return this.queue( type || "fx", [] ); | ||
| }, | ||
| // Get a promise resolved when queues of a certain type | ||
| // are emptied (fx is the type by default) | ||
| promise: function( type, obj ) { | ||
| var tmp, | ||
| count = 1, | ||
| defer = jQuery.Deferred(), | ||
| elements = this, | ||
| i = this.length, | ||
| resolve = function() { | ||
| if ( !( --count ) ) { | ||
| defer.resolveWith( elements, [ elements ] ); | ||
| } | ||
| }; | ||
|
|
||
| if ( typeof type !== "string" ) { | ||
| obj = type; | ||
| type = undefined; | ||
| } | ||
| type = type || "fx"; | ||
|
|
||
| while ( i-- ) { | ||
| tmp = data_priv.get( elements[ i ], type + "queueHooks" ); | ||
| if ( tmp && tmp.empty ) { | ||
| count++; | ||
| tmp.empty.add( resolve ); | ||
| } | ||
| } | ||
| resolve(); | ||
| return defer.promise( obj ); | ||
| } | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1,22 @@ | ||
| define([ | ||
| "../core", | ||
| "../queue", | ||
| "../effects" // Delay is optional because of this dependency | ||
| ], function( jQuery ) { | ||
|
|
||
| // Based off of the plugin by Clint Helfers, with permission. | ||
| // http://blindsignals.com/index.php/2009/07/jquery-delay/ | ||
| jQuery.fn.delay = function( time, type ) { | ||
| time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; | ||
| type = type || "fx"; | ||
|
|
||
| return this.queue( type, function( next, hooks ) { | ||
| var timeout = setTimeout( next, time ); | ||
| hooks.stop = function() { | ||
| clearTimeout( timeout ); | ||
| }; | ||
| }); | ||
| }; | ||
|
|
||
| return jQuery.fn.delay; | ||
| }); |
| @@ -0,0 +1,172 @@ | ||
| define([ | ||
| "./core" | ||
| ], function( jQuery ) { | ||
|
|
||
| /* | ||
| * Optional (non-Sizzle) selector module for custom builds. | ||
| * | ||
| * Note that this DOES NOT SUPPORT many documented jQuery | ||
| * features in exchange for its smaller size: | ||
| * | ||
| * Attribute not equal selector | ||
| * Positional selectors (:first; :eq(n); :odd; etc.) | ||
| * Type selectors (:input; :checkbox; :button; etc.) | ||
| * State-based selectors (:animated; :visible; :hidden; etc.) | ||
| * :has(selector) | ||
| * :not(complex selector) | ||
| * custom selectors via Sizzle extensions | ||
| * Leading combinators (e.g., $collection.find("> *")) | ||
| * Reliable functionality on XML fragments | ||
| * Requiring all parts of a selector to match elements under context | ||
| * (e.g., $div.find("div > *") now matches children of $div) | ||
| * Matching against non-elements | ||
| * Reliable sorting of disconnected nodes | ||
| * querySelectorAll bug fixes (e.g., unreliable :focus on WebKit) | ||
| * | ||
| * If any of these are unacceptable tradeoffs, either use Sizzle or | ||
| * customize this stub for the project's specific needs. | ||
| */ | ||
|
|
||
| var docElem = window.document.documentElement, | ||
| selector_hasDuplicate, | ||
| matches = docElem.matches || | ||
| docElem.webkitMatchesSelector || | ||
| docElem.mozMatchesSelector || | ||
| docElem.oMatchesSelector || | ||
| docElem.msMatchesSelector, | ||
| selector_sortOrder = function( a, b ) { | ||
| // Flag for duplicate removal | ||
| if ( a === b ) { | ||
| selector_hasDuplicate = true; | ||
| return 0; | ||
| } | ||
|
|
||
| var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); | ||
|
|
||
| if ( compare ) { | ||
| // Disconnected nodes | ||
| if ( compare & 1 ) { | ||
|
|
||
| // Choose the first element that is related to our document | ||
| if ( a === document || jQuery.contains(document, a) ) { | ||
| return -1; | ||
| } | ||
| if ( b === document || jQuery.contains(document, b) ) { | ||
| return 1; | ||
| } | ||
|
|
||
| // Maintain original order | ||
| return 0; | ||
| } | ||
|
|
||
| return compare & 4 ? -1 : 1; | ||
| } | ||
|
|
||
| // Not directly comparable, sort on existence of method | ||
| return a.compareDocumentPosition ? -1 : 1; | ||
| }; | ||
|
|
||
| jQuery.extend({ | ||
| find: function( selector, context, results, seed ) { | ||
| var elem, nodeType, | ||
| i = 0; | ||
|
|
||
| results = results || []; | ||
| context = context || document; | ||
|
|
||
| // Same basic safeguard as Sizzle | ||
| if ( !selector || typeof selector !== "string" ) { | ||
| return results; | ||
| } | ||
|
|
||
| // Early return if context is not an element or document | ||
| if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { | ||
| return []; | ||
| } | ||
|
|
||
| if ( seed ) { | ||
| while ( (elem = seed[i++]) ) { | ||
| if ( jQuery.find.matchesSelector(elem, selector) ) { | ||
| results.push( elem ); | ||
| } | ||
| } | ||
| } else { | ||
| jQuery.merge( results, context.querySelectorAll(selector) ); | ||
| } | ||
|
|
||
| return results; | ||
| }, | ||
| unique: function( results ) { | ||
| var elem, | ||
| duplicates = [], | ||
| i = 0, | ||
| j = 0; | ||
|
|
||
| selector_hasDuplicate = false; | ||
| results.sort( selector_sortOrder ); | ||
|
|
||
| if ( selector_hasDuplicate ) { | ||
| while ( (elem = results[i++]) ) { | ||
| if ( elem === results[ i ] ) { | ||
| j = duplicates.push( i ); | ||
| } | ||
| } | ||
| while ( j-- ) { | ||
| results.splice( duplicates[ j ], 1 ); | ||
| } | ||
| } | ||
|
|
||
| return results; | ||
| }, | ||
| text: function( elem ) { | ||
| var node, | ||
| ret = "", | ||
| i = 0, | ||
| nodeType = elem.nodeType; | ||
|
|
||
| if ( !nodeType ) { | ||
| // If no nodeType, this is expected to be an array | ||
| while ( (node = elem[i++]) ) { | ||
| // Do not traverse comment nodes | ||
| ret += jQuery.text( node ); | ||
| } | ||
| } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { | ||
| // Use textContent for elements | ||
| return elem.textContent; | ||
| } else if ( nodeType === 3 || nodeType === 4 ) { | ||
| return elem.nodeValue; | ||
| } | ||
| // Do not include comment or processing instruction nodes | ||
|
|
||
| return ret; | ||
| }, | ||
| contains: function( a, b ) { | ||
| var adown = a.nodeType === 9 ? a.documentElement : a, | ||
| bup = b && b.parentNode; | ||
| return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) ); | ||
| }, | ||
| isXMLDoc: function( elem ) { | ||
| return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML"; | ||
| }, | ||
| expr: { | ||
| attrHandle: {}, | ||
| match: { | ||
| bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i, | ||
| needsContext: /^[\x20\t\r\n\f]*[>+~]/ | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| jQuery.extend( jQuery.find, { | ||
| matches: function( expr, elements ) { | ||
| return jQuery.find( expr, null, null, elements ); | ||
| }, | ||
| matchesSelector: function( elem, expr ) { | ||
| return matches.call( elem, expr ); | ||
| }, | ||
| attr: function( elem, name ) { | ||
| return elem.getAttribute( name ); | ||
| } | ||
| }); | ||
|
|
||
| }); |
| @@ -0,0 +1,14 @@ | ||
| define([ | ||
| "./core", | ||
| "sizzle" | ||
| ], function( jQuery, Sizzle ) { | ||
|
|
||
| jQuery.find = Sizzle; | ||
| jQuery.expr = Sizzle.selectors; | ||
| jQuery.expr[":"] = jQuery.expr.pseudos; | ||
| jQuery.unique = Sizzle.uniqueSort; | ||
| jQuery.text = Sizzle.getText; | ||
| jQuery.isXMLDoc = Sizzle.isXML; | ||
| jQuery.contains = Sizzle.contains; | ||
|
|
||
| }); |
| @@ -0,0 +1 @@ | ||
| define([ "./selector-sizzle" ]); |
| @@ -0,0 +1,111 @@ | ||
| define([ | ||
| "./core", | ||
| "./manipulation/var/rcheckableType", | ||
| "./core/init", | ||
| "./traversing", // filter | ||
| "./attributes/prop" | ||
| ], function( jQuery, rcheckableType ) { | ||
|
|
||
| var r20 = /%20/g, | ||
| rbracket = /\[\]$/, | ||
| rCRLF = /\r?\n/g, | ||
| rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, | ||
| rsubmittable = /^(?:input|select|textarea|keygen)/i; | ||
|
|
||
| function buildParams( prefix, obj, traditional, add ) { | ||
| var name; | ||
|
|
||
| if ( jQuery.isArray( obj ) ) { | ||
| // Serialize array item. | ||
| jQuery.each( obj, function( i, v ) { | ||
| if ( traditional || rbracket.test( prefix ) ) { | ||
| // Treat each array item as a scalar. | ||
| add( prefix, v ); | ||
|
|
||
| } else { | ||
| // Item is non-scalar (array or object), encode its numeric index. | ||
| buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); | ||
| } | ||
| }); | ||
|
|
||
| } else if ( !traditional && jQuery.type( obj ) === "object" ) { | ||
| // Serialize object item. | ||
| for ( name in obj ) { | ||
| buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); | ||
| } | ||
|
|
||
| } else { | ||
| // Serialize scalar item. | ||
| add( prefix, obj ); | ||
| } | ||
| } | ||
|
|
||
| // Serialize an array of form elements or a set of | ||
| // key/values into a query string | ||
| jQuery.param = function( a, traditional ) { | ||
| var prefix, | ||
| s = [], | ||
| add = function( key, value ) { | ||
| // If value is a function, invoke it and return its value | ||
| value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); | ||
| s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); | ||
| }; | ||
|
|
||
| // Set traditional to true for jQuery <= 1.3.2 behavior. | ||
| if ( traditional === undefined ) { | ||
| traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; | ||
| } | ||
|
|
||
| // If an array was passed in, assume that it is an array of form elements. | ||
| if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { | ||
| // Serialize the form elements | ||
| jQuery.each( a, function() { | ||
| add( this.name, this.value ); | ||
| }); | ||
|
|
||
| } else { | ||
| // If traditional, encode the "old" way (the way 1.3.2 or older | ||
| // did it), otherwise encode params recursively. | ||
| for ( prefix in a ) { | ||
| buildParams( prefix, a[ prefix ], traditional, add ); | ||
| } | ||
| } | ||
|
|
||
| // Return the resulting serialization | ||
| return s.join( "&" ).replace( r20, "+" ); | ||
| }; | ||
|
|
||
| jQuery.fn.extend({ | ||
| serialize: function() { | ||
| return jQuery.param( this.serializeArray() ); | ||
| }, | ||
| serializeArray: function() { | ||
| return this.map(function() { | ||
| // Can add propHook for "elements" to filter or add form elements | ||
| var elements = jQuery.prop( this, "elements" ); | ||
| return elements ? jQuery.makeArray( elements ) : this; | ||
| }) | ||
| .filter(function() { | ||
| var type = this.type; | ||
|
|
||
| // Use .is( ":disabled" ) so that fieldset[disabled] works | ||
| return this.name && !jQuery( this ).is( ":disabled" ) && | ||
| rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && | ||
| ( this.checked || !rcheckableType.test( type ) ); | ||
| }) | ||
| .map(function( i, elem ) { | ||
| var val = jQuery( this ).val(); | ||
|
|
||
| return val == null ? | ||
| null : | ||
| jQuery.isArray( val ) ? | ||
| jQuery.map( val, function( val ) { | ||
| return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; | ||
| }) : | ||
| { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; | ||
| }).get(); | ||
| } | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1,199 @@ | ||
| define([ | ||
| "./core", | ||
| "./var/indexOf", | ||
| "./traversing/var/rneedsContext", | ||
| "./core/init", | ||
| "./traversing/findFilter", | ||
| "./selector" | ||
| ], function( jQuery, indexOf, rneedsContext ) { | ||
|
|
||
| var rparentsprev = /^(?:parents|prev(?:Until|All))/, | ||
| // Methods guaranteed to produce a unique set when starting from a unique set | ||
| guaranteedUnique = { | ||
| children: true, | ||
| contents: true, | ||
| next: true, | ||
| prev: true | ||
| }; | ||
|
|
||
| jQuery.extend({ | ||
| dir: function( elem, dir, until ) { | ||
| var matched = [], | ||
| truncate = until !== undefined; | ||
|
|
||
| while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { | ||
| if ( elem.nodeType === 1 ) { | ||
| if ( truncate && jQuery( elem ).is( until ) ) { | ||
| break; | ||
| } | ||
| matched.push( elem ); | ||
| } | ||
| } | ||
| return matched; | ||
| }, | ||
|
|
||
| sibling: function( n, elem ) { | ||
| var matched = []; | ||
|
|
||
| for ( ; n; n = n.nextSibling ) { | ||
| if ( n.nodeType === 1 && n !== elem ) { | ||
| matched.push( n ); | ||
| } | ||
| } | ||
|
|
||
| return matched; | ||
| } | ||
| }); | ||
|
|
||
| jQuery.fn.extend({ | ||
| has: function( target ) { | ||
| var targets = jQuery( target, this ), | ||
| l = targets.length; | ||
|
|
||
| return this.filter(function() { | ||
| var i = 0; | ||
| for ( ; i < l; i++ ) { | ||
| if ( jQuery.contains( this, targets[i] ) ) { | ||
| return true; | ||
| } | ||
| } | ||
| }); | ||
| }, | ||
|
|
||
| closest: function( selectors, context ) { | ||
| var cur, | ||
| i = 0, | ||
| l = this.length, | ||
| matched = [], | ||
| pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? | ||
| jQuery( selectors, context || this.context ) : | ||
| 0; | ||
|
|
||
| for ( ; i < l; i++ ) { | ||
| for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { | ||
| // Always skip document fragments | ||
| if ( cur.nodeType < 11 && (pos ? | ||
| pos.index(cur) > -1 : | ||
|
|
||
| // Don't pass non-elements to Sizzle | ||
| cur.nodeType === 1 && | ||
| jQuery.find.matchesSelector(cur, selectors)) ) { | ||
|
|
||
| matched.push( cur ); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); | ||
| }, | ||
|
|
||
| // Determine the position of an element within the set | ||
| index: function( elem ) { | ||
|
|
||
| // No argument, return index in parent | ||
| if ( !elem ) { | ||
| return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; | ||
| } | ||
|
|
||
| // Index in selector | ||
| if ( typeof elem === "string" ) { | ||
| return indexOf.call( jQuery( elem ), this[ 0 ] ); | ||
| } | ||
|
|
||
| // Locate the position of the desired element | ||
| return indexOf.call( this, | ||
|
|
||
| // If it receives a jQuery object, the first element is used | ||
| elem.jquery ? elem[ 0 ] : elem | ||
| ); | ||
| }, | ||
|
|
||
| add: function( selector, context ) { | ||
| return this.pushStack( | ||
| jQuery.unique( | ||
| jQuery.merge( this.get(), jQuery( selector, context ) ) | ||
| ) | ||
| ); | ||
| }, | ||
|
|
||
| addBack: function( selector ) { | ||
| return this.add( selector == null ? | ||
| this.prevObject : this.prevObject.filter(selector) | ||
| ); | ||
| } | ||
| }); | ||
|
|
||
| function sibling( cur, dir ) { | ||
| while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} | ||
| return cur; | ||
| } | ||
|
|
||
| jQuery.each({ | ||
| parent: function( elem ) { | ||
| var parent = elem.parentNode; | ||
| return parent && parent.nodeType !== 11 ? parent : null; | ||
| }, | ||
| parents: function( elem ) { | ||
| return jQuery.dir( elem, "parentNode" ); | ||
| }, | ||
| parentsUntil: function( elem, i, until ) { | ||
| return jQuery.dir( elem, "parentNode", until ); | ||
| }, | ||
| next: function( elem ) { | ||
| return sibling( elem, "nextSibling" ); | ||
| }, | ||
| prev: function( elem ) { | ||
| return sibling( elem, "previousSibling" ); | ||
| }, | ||
| nextAll: function( elem ) { | ||
| return jQuery.dir( elem, "nextSibling" ); | ||
| }, | ||
| prevAll: function( elem ) { | ||
| return jQuery.dir( elem, "previousSibling" ); | ||
| }, | ||
| nextUntil: function( elem, i, until ) { | ||
| return jQuery.dir( elem, "nextSibling", until ); | ||
| }, | ||
| prevUntil: function( elem, i, until ) { | ||
| return jQuery.dir( elem, "previousSibling", until ); | ||
| }, | ||
| siblings: function( elem ) { | ||
| return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); | ||
| }, | ||
| children: function( elem ) { | ||
| return jQuery.sibling( elem.firstChild ); | ||
| }, | ||
| contents: function( elem ) { | ||
| return elem.contentDocument || jQuery.merge( [], elem.childNodes ); | ||
| } | ||
| }, function( name, fn ) { | ||
| jQuery.fn[ name ] = function( until, selector ) { | ||
| var matched = jQuery.map( this, fn, until ); | ||
|
|
||
| if ( name.slice( -5 ) !== "Until" ) { | ||
| selector = until; | ||
| } | ||
|
|
||
| if ( selector && typeof selector === "string" ) { | ||
| matched = jQuery.filter( selector, matched ); | ||
| } | ||
|
|
||
| if ( this.length > 1 ) { | ||
| // Remove duplicates | ||
| if ( !guaranteedUnique[ name ] ) { | ||
| jQuery.unique( matched ); | ||
| } | ||
|
|
||
| // Reverse order for parents* and prev-derivatives | ||
| if ( rparentsprev.test( name ) ) { | ||
| matched.reverse(); | ||
| } | ||
| } | ||
|
|
||
| return this.pushStack( matched ); | ||
| }; | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |
| @@ -0,0 +1,100 @@ | ||
| define([ | ||
| "../core", | ||
| "../var/indexOf", | ||
| "./var/rneedsContext", | ||
| "../selector" | ||
| ], function( jQuery, indexOf, rneedsContext ) { | ||
|
|
||
| var risSimple = /^.[^:#\[\.,]*$/; | ||
|
|
||
| // Implement the identical functionality for filter and not | ||
| function winnow( elements, qualifier, not ) { | ||
| if ( jQuery.isFunction( qualifier ) ) { | ||
| return jQuery.grep( elements, function( elem, i ) { | ||
| /* jshint -W018 */ | ||
| return !!qualifier.call( elem, i, elem ) !== not; | ||
| }); | ||
|
|
||
| } | ||
|
|
||
| if ( qualifier.nodeType ) { | ||
| return jQuery.grep( elements, function( elem ) { | ||
| return ( elem === qualifier ) !== not; | ||
| }); | ||
|
|
||
| } | ||
|
|
||
| if ( typeof qualifier === "string" ) { | ||
| if ( risSimple.test( qualifier ) ) { | ||
| return jQuery.filter( qualifier, elements, not ); | ||
| } | ||
|
|
||
| qualifier = jQuery.filter( qualifier, elements ); | ||
| } | ||
|
|
||
| return jQuery.grep( elements, function( elem ) { | ||
| return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; | ||
| }); | ||
| } | ||
|
|
||
| jQuery.filter = function( expr, elems, not ) { | ||
| var elem = elems[ 0 ]; | ||
|
|
||
| if ( not ) { | ||
| expr = ":not(" + expr + ")"; | ||
| } | ||
|
|
||
| return elems.length === 1 && elem.nodeType === 1 ? | ||
| jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : | ||
| jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { | ||
| return elem.nodeType === 1; | ||
| })); | ||
| }; | ||
|
|
||
| jQuery.fn.extend({ | ||
| find: function( selector ) { | ||
| var i, | ||
| len = this.length, | ||
| ret = [], | ||
| self = this; | ||
|
|
||
| if ( typeof selector !== "string" ) { | ||
| return this.pushStack( jQuery( selector ).filter(function() { | ||
| for ( i = 0; i < len; i++ ) { | ||
| if ( jQuery.contains( self[ i ], this ) ) { | ||
| return true; | ||
| } | ||
| } | ||
| }) ); | ||
| } | ||
|
|
||
| for ( i = 0; i < len; i++ ) { | ||
| jQuery.find( selector, self[ i ], ret ); | ||
| } | ||
|
|
||
| // Needed because $( selector, context ) becomes $( context ).find( selector ) | ||
| ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); | ||
| ret.selector = this.selector ? this.selector + " " + selector : selector; | ||
| return ret; | ||
| }, | ||
| filter: function( selector ) { | ||
| return this.pushStack( winnow(this, selector || [], false) ); | ||
| }, | ||
| not: function( selector ) { | ||
| return this.pushStack( winnow(this, selector || [], true) ); | ||
| }, | ||
| is: function( selector ) { | ||
| return !!winnow( | ||
| this, | ||
|
|
||
| // If this is a positional/relative selector, check membership in the returned set | ||
| // so $("p:first").is("p:last") won't return true for a doc with two "p". | ||
| typeof selector === "string" && rneedsContext.test( selector ) ? | ||
| jQuery( selector ) : | ||
| selector || [], | ||
| false | ||
| ).length; | ||
| } | ||
| }); | ||
|
|
||
| }); |
| @@ -0,0 +1,6 @@ | ||
| define([ | ||
| "../../core", | ||
| "../../selector" | ||
| ], function( jQuery ) { | ||
| return jQuery.expr.match.needsContext; | ||
| }); |
| @@ -0,0 +1,3 @@ | ||
| define(function() { | ||
| return []; | ||
| }); |
| @@ -0,0 +1,4 @@ | ||
| define(function() { | ||
| // [[Class]] -> type pairs | ||
| return {}; | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "./arr" | ||
| ], function( arr ) { | ||
| return arr.concat; | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "./class2type" | ||
| ], function( class2type ) { | ||
| return class2type.hasOwnProperty; | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "./arr" | ||
| ], function( arr ) { | ||
| return arr.indexOf; | ||
| }); |
| @@ -0,0 +1,3 @@ | ||
| define(function() { | ||
| return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "./arr" | ||
| ], function( arr ) { | ||
| return arr.push; | ||
| }); |
| @@ -0,0 +1,3 @@ | ||
| define(function() { | ||
| return (/\S+/g); | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "./arr" | ||
| ], function( arr ) { | ||
| return arr.slice; | ||
| }); |
| @@ -0,0 +1,3 @@ | ||
| define(function() { | ||
| return typeof undefined; | ||
| }); |
| @@ -0,0 +1,4 @@ | ||
| define(function() { | ||
| // All support tests are defined in their respective modules. | ||
| return {}; | ||
| }); |
| @@ -0,0 +1,5 @@ | ||
| define([ | ||
| "./class2type" | ||
| ], function( class2type ) { | ||
| return class2type.toString; | ||
| }); |
| @@ -0,0 +1,79 @@ | ||
| define([ | ||
| "./core", | ||
| "./core/init", | ||
| "./manipulation", // clone | ||
| "./traversing" // parent, contents | ||
| ], function( jQuery ) { | ||
|
|
||
| jQuery.fn.extend({ | ||
| wrapAll: function( html ) { | ||
| var wrap; | ||
|
|
||
| if ( jQuery.isFunction( html ) ) { | ||
| return this.each(function( i ) { | ||
| jQuery( this ).wrapAll( html.call(this, i) ); | ||
| }); | ||
| } | ||
|
|
||
| if ( this[ 0 ] ) { | ||
|
|
||
| // The elements to wrap the target around | ||
| wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); | ||
|
|
||
| if ( this[ 0 ].parentNode ) { | ||
| wrap.insertBefore( this[ 0 ] ); | ||
| } | ||
|
|
||
| wrap.map(function() { | ||
| var elem = this; | ||
|
|
||
| while ( elem.firstElementChild ) { | ||
| elem = elem.firstElementChild; | ||
| } | ||
|
|
||
| return elem; | ||
| }).append( this ); | ||
| } | ||
|
|
||
| return this; | ||
| }, | ||
|
|
||
| wrapInner: function( html ) { | ||
| if ( jQuery.isFunction( html ) ) { | ||
| return this.each(function( i ) { | ||
| jQuery( this ).wrapInner( html.call(this, i) ); | ||
| }); | ||
| } | ||
|
|
||
| return this.each(function() { | ||
| var self = jQuery( this ), | ||
| contents = self.contents(); | ||
|
|
||
| if ( contents.length ) { | ||
| contents.wrapAll( html ); | ||
|
|
||
| } else { | ||
| self.append( html ); | ||
| } | ||
| }); | ||
| }, | ||
|
|
||
| wrap: function( html ) { | ||
| var isFunction = jQuery.isFunction( html ); | ||
|
|
||
| return this.each(function( i ) { | ||
| jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); | ||
| }); | ||
| }, | ||
|
|
||
| unwrap: function() { | ||
| return this.parent().each(function() { | ||
| if ( !jQuery.nodeName( this, "body" ) ) { | ||
| jQuery( this ).replaceWith( this.childNodes ); | ||
| } | ||
| }).end(); | ||
| } | ||
| }); | ||
|
|
||
| return jQuery; | ||
| }); |