scratch

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 58  →  ?path2? @ 125
/bower_components/jquery/src/core/access.js
@@ -1,12 +1,10 @@
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 = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
len = elems.length,
bulk = key == null;
@@ -15,7 +13,7 @@
if ( jQuery.type( key ) === "object" ) {
chainable = true;
for ( i in key ) {
access( elems, fn, i, key[ i ], true, emptyGet, raw );
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
}
 
// Sets one value
@@ -27,7 +25,6 @@
}
 
if ( bulk ) {
 
// Bulk operations run against the entire set
if ( raw ) {
fn.call( elems, value );
@@ -44,27 +41,20 @@
 
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 ) ) );
}
}
}
 
if ( chainable ) {
return elems;
}
return chainable ?
elems :
 
// Gets
if ( bulk ) {
return fn.call( elems );
}
 
return len ? fn( elems[ 0 ], key ) : emptyGet;
// Gets
bulk ?
fn.call( elems ) :
len ? fn( elems[0], key ) : emptyGet;
};
 
return access;
 
} );
});
/bower_components/jquery/src/core/init.js
@@ -1,13 +1,10 @@
// Initialize a jQuery object
define( [
define([
"../core",
"../var/document",
"./var/rsingleTag",
"../traversing/findFilter"
], function( jQuery, document, rsingleTag ) {
], function( jQuery, rsingleTag ) {
 
"use strict";
 
// A central reference to the root jQuery(document)
var rootjQuery,
 
@@ -14,10 +11,9 @@
// 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 <)
// Shortcut simple #id case for speed
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
 
init = jQuery.fn.init = function( selector, context, root ) {
init = jQuery.fn.init = function( selector, context ) {
var match, elem;
 
// HANDLE: $(""), $(null), $(undefined), $(false)
@@ -25,16 +21,9 @@
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 ];
 
@@ -43,24 +32,23 @@
}
 
// 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 ] );
@@ -76,20 +64,24 @@
 
// HANDLE: $(#id)
} else {
elem = document.getElementById( match[ 2 ] );
elem = document.getElementById( match[2] );
 
if ( elem ) {
 
// 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[ 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 || root ).find( selector );
return ( context || rootjQuery ).find( selector );
 
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
@@ -99,7 +91,7 @@
 
// HANDLE: $(DOMElement)
} else if ( selector.nodeType ) {
this[ 0 ] = selector;
this.context = this[0] = selector;
this.length = 1;
return this;
 
@@ -106,13 +98,17 @@
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return root.ready !== undefined ?
root.ready( 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 );
};
 
@@ -124,4 +120,4 @@
 
return init;
 
} );
});
/bower_components/jquery/src/core/parseHTML.js
@@ -1,57 +1,31 @@
define( [
define([
"../core",
"../var/document",
"./var/rsingleTag",
"../manipulation/buildFragment",
"../manipulation" // buildFragment
], function( jQuery, rsingleTag ) {
 
// 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
// 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 ( typeof data !== "string" ) {
return [];
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
context = context || document;
 
var base, parsed, scripts;
var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && [];
 
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 = buildFragment( [ data ], context, scripts );
parsed = jQuery.buildFragment( [ data ], context, scripts );
 
if ( scripts && scripts.length ) {
jQuery( scripts ).remove();
@@ -62,4 +36,4 @@
 
return jQuery.parseHTML;
 
} );
});
/bower_components/jquery/src/core/ready.js
@@ -1,32 +1,20 @@
define( [
define([
"../core",
"../var/document",
"../core/readyException",
"../core/init",
"../deferred"
], function( jQuery, document ) {
], function( jQuery ) {
 
"use strict";
 
// The deferred used on DOM ready
var readyList = jQuery.Deferred();
var readyList;
 
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,
 
@@ -61,35 +49,49 @@
 
// 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" );
}
}
} );
});
 
jQuery.ready.then = readyList.then;
 
// The ready event handler and self cleanup method
/**
* The ready event handler and self cleanup method
*/
function completed() {
document.removeEventListener( "DOMContentLoaded", completed );
window.removeEventListener( "load", completed );
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
jQuery.ready();
}
 
// 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 ) ) {
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
 
// Handle it asynchronously to allow scripts the opportunity to delay ready
window.setTimeout( jQuery.ready );
readyList = jQuery.Deferred();
 
} else {
// 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 );
 
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed );
} else {
 
// A fallback to window.onload, that will always work
window.addEventListener( "load", completed );
}
// 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();
 
});
/bower_components/jquery/src/core/var/rsingleTag.js
@@ -1,6 +1,4 @@
define( function() {
"use strict";
 
define(function() {
// Match a standalone tag
return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
} );
return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
});