/bower_components/jquery/src/core/access.js |
@@ -1,10 +1,12 @@ |
define([ |
define( [ |
"../core" |
], function( jQuery ) { |
|
"use strict"; |
|
// 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 access = function( elems, fn, key, value, chainable, emptyGet, raw ) { |
var i = 0, |
len = elems.length, |
bulk = key == null; |
@@ -13,7 +15,7 @@ |
if ( jQuery.type( key ) === "object" ) { |
chainable = true; |
for ( i in key ) { |
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); |
access( elems, fn, i, key[ i ], true, emptyGet, raw ); |
} |
|
// Sets one value |
@@ -25,6 +27,7 @@ |
} |
|
if ( bulk ) { |
|
// Bulk operations run against the entire set |
if ( raw ) { |
fn.call( elems, value ); |
@@ -41,20 +44,27 @@ |
|
if ( fn ) { |
for ( ; i < len; i++ ) { |
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); |
fn( |
elems[ i ], key, raw ? |
value : |
value.call( elems[ i ], i, fn( elems[ i ], key ) ) |
); |
} |
} |
} |
|
return chainable ? |
elems : |
if ( chainable ) { |
return elems; |
} |
|
// Gets |
bulk ? |
fn.call( elems ) : |
len ? fn( elems[0], key ) : emptyGet; |
// Gets |
if ( bulk ) { |
return fn.call( elems ); |
} |
|
return len ? fn( elems[ 0 ], key ) : emptyGet; |
}; |
|
return access; |
|
}); |
} ); |
/bower_components/jquery/src/core/init.js |
@@ -1,10 +1,13 @@ |
// Initialize a jQuery object |
define([ |
define( [ |
"../core", |
"../var/document", |
"./var/rsingleTag", |
"../traversing/findFilter" |
], function( jQuery, rsingleTag ) { |
], function( jQuery, document, rsingleTag ) { |
|
"use strict"; |
|
// A central reference to the root jQuery(document) |
var rootjQuery, |
|
@@ -11,9 +14,10 @@ |
// 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-]*))$/, |
// Shortcut simple #id case for speed |
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, |
|
init = jQuery.fn.init = function( selector, context ) { |
init = jQuery.fn.init = function( selector, context, root ) { |
var match, elem; |
|
// HANDLE: $(""), $(null), $(undefined), $(false) |
@@ -21,9 +25,16 @@ |
return this; |
} |
|
// Method init() accepts an alternate rootjQuery |
// so migrate can support jQuery.sub (gh-2101) |
root = root || rootjQuery; |
|
// Handle HTML strings |
if ( typeof selector === "string" ) { |
if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { |
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 ]; |
|
@@ -32,23 +43,24 @@ |
} |
|
// Match html or make sure no context is specified for #id |
if ( match && (match[1] || !context) ) { |
if ( match && ( match[ 1 ] || !context ) ) { |
|
// HANDLE: $(html) -> $(array) |
if ( match[1] ) { |
context = context instanceof jQuery ? context[0] : context; |
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], |
match[ 1 ], |
context && context.nodeType ? context.ownerDocument || context : document, |
true |
) ); |
|
// HANDLE: $(html, props) |
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { |
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 ] ); |
@@ -64,24 +76,20 @@ |
|
// HANDLE: $(#id) |
} else { |
elem = document.getElementById( match[2] ); |
elem = document.getElementById( match[ 2 ] ); |
|
// Support: Blackberry 4.6 |
// gEBID returns nodes no longer in the document (#6963) |
if ( elem && elem.parentNode ) { |
if ( elem ) { |
|
// Inject the element directly into the jQuery object |
this[ 0 ] = elem; |
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 ); |
return ( context || root ).find( selector ); |
|
// HANDLE: $(expr, context) |
// (which is just equivalent to: $(context).find(expr) |
@@ -91,7 +99,7 @@ |
|
// HANDLE: $(DOMElement) |
} else if ( selector.nodeType ) { |
this.context = this[0] = selector; |
this[ 0 ] = selector; |
this.length = 1; |
return this; |
|
@@ -98,17 +106,13 @@ |
// HANDLE: $(function) |
// Shortcut for document ready |
} else if ( jQuery.isFunction( selector ) ) { |
return typeof rootjQuery.ready !== "undefined" ? |
rootjQuery.ready( selector ) : |
return root.ready !== undefined ? |
root.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 ); |
}; |
|
@@ -120,4 +124,4 @@ |
|
return init; |
|
}); |
} ); |
/bower_components/jquery/src/core/parseHTML.js |
@@ -1,31 +1,57 @@ |
define([ |
define( [ |
"../core", |
"../var/document", |
"./var/rsingleTag", |
"../manipulation" // buildFragment |
], function( jQuery, rsingleTag ) { |
"../manipulation/buildFragment", |
|
// data: string of html |
// context (optional): If specified, the fragment will be created in this context, defaults to document |
// This is the only module that needs core/support |
"./support" |
], function( jQuery, document, rsingleTag, buildFragment, support ) { |
|
"use strict"; |
|
// Argument "data" should be 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 data !== "string" ) { |
return []; |
} |
if ( typeof context === "boolean" ) { |
keepScripts = context; |
context = false; |
} |
context = context || document; |
|
var parsed = rsingleTag.exec( data ), |
scripts = !keepScripts && []; |
var base, parsed, scripts; |
|
if ( !context ) { |
|
// Stop scripts or inline event handlers from being executed immediately |
// by using document.implementation |
if ( support.createHTMLDocument ) { |
context = document.implementation.createHTMLDocument( "" ); |
|
// Set the base href for the created document |
// so any parsed elements with URLs |
// are based on the document's URL (gh-2965) |
base = context.createElement( "base" ); |
base.href = document.location.href; |
context.head.appendChild( base ); |
} else { |
context = document; |
} |
} |
|
parsed = rsingleTag.exec( data ); |
scripts = !keepScripts && []; |
|
// Single tag |
if ( parsed ) { |
return [ context.createElement( parsed[1] ) ]; |
return [ context.createElement( parsed[ 1 ] ) ]; |
} |
|
parsed = jQuery.buildFragment( [ data ], context, scripts ); |
parsed = buildFragment( [ data ], context, scripts ); |
|
if ( scripts && scripts.length ) { |
jQuery( scripts ).remove(); |
@@ -36,4 +62,4 @@ |
|
return jQuery.parseHTML; |
|
}); |
} ); |
/bower_components/jquery/src/core/ready.js |
@@ -1,20 +1,32 @@ |
define([ |
define( [ |
"../core", |
"../core/init", |
"../var/document", |
"../core/readyException", |
"../deferred" |
], function( jQuery ) { |
], function( jQuery, document ) { |
|
"use strict"; |
|
// The deferred used on DOM ready |
var readyList; |
var readyList = jQuery.Deferred(); |
|
jQuery.fn.ready = function( fn ) { |
// Add the callback |
jQuery.ready.promise().done( fn ); |
|
readyList |
.then( fn ) |
|
// Wrap jQuery.readyException in a function so that the lookup |
// happens at the time of error handling instead of callback |
// registration. |
.catch( function( error ) { |
jQuery.readyException( error ); |
} ); |
|
return this; |
}; |
|
jQuery.extend({ |
jQuery.extend( { |
|
// Is the DOM ready to be used? Set to true once it occurs. |
isReady: false, |
|
@@ -49,49 +61,35 @@ |
|
// 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 |
*/ |
jQuery.ready.then = readyList.then; |
|
// The ready event handler and self cleanup method |
function completed() { |
document.removeEventListener( "DOMContentLoaded", completed, false ); |
window.removeEventListener( "load", completed, false ); |
document.removeEventListener( "DOMContentLoaded", completed ); |
window.removeEventListener( "load", completed ); |
jQuery.ready(); |
} |
|
jQuery.ready.promise = function( obj ) { |
if ( !readyList ) { |
// Catch cases where $(document).ready() is called |
// after the browser event has already occurred. |
// Support: IE <=9 - 10 only |
// Older IE sometimes signals "interactive" too soon |
if ( document.readyState === "complete" || |
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { |
|
readyList = jQuery.Deferred(); |
// Handle it asynchronously to allow scripts the opportunity to delay ready |
window.setTimeout( jQuery.ready ); |
|
// 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 { |
|
} else { |
// Use the handy event callback |
document.addEventListener( "DOMContentLoaded", completed ); |
|
// Use the handy event callback |
document.addEventListener( "DOMContentLoaded", completed, false ); |
// A fallback to window.onload, that will always work |
window.addEventListener( "load", completed ); |
} |
|
// 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(); |
|
}); |
} ); |