scratch

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 58  →  ?path2? @ 125
/bower_components/jquery/src/ajax/jsonp.js
@@ -1,4 +1,4 @@
define( [
define([
"../core",
"./var/nonce",
"./var/rquery",
@@ -5,13 +5,11 @@
"../ajax"
], function( jQuery, nonce, rquery ) {
 
"use strict";
 
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;
 
// Default jsonp settings
jQuery.ajaxSetup( {
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
@@ -18,7 +16,7 @@
this[ callback ] = true;
return callback;
}
} );
});
 
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
@@ -26,10 +24,7 @@
var callbackName, overwritten, responseContainer,
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
"url" :
typeof s.data === "string" &&
( s.contentType || "" )
.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
rjsonp.test( s.data ) && "data"
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
);
 
// Handle iff the expected data type is "jsonp" or we have a parameter to set
@@ -48,7 +43,7 @@
}
 
// Use data converter to retrieve json after script execution
s.converters[ "script json" ] = function() {
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( callbackName + " was not called" );
}
@@ -55,7 +50,7 @@
return responseContainer[ 0 ];
};
 
// Force json dataType
// force json dataType
s.dataTypes[ 0 ] = "json";
 
// Install callback
@@ -65,24 +60,16 @@
};
 
// Clean-up function (fires after converters)
jqXHR.always( function() {
jqXHR.always(function() {
// Restore preexisting value
window[ callbackName ] = overwritten;
 
// If previous value didn't exist - remove it
if ( overwritten === undefined ) {
jQuery( window ).removeProp( callbackName );
 
// Otherwise restore preexisting value
} else {
window[ callbackName ] = overwritten;
}
 
// Save back as free
if ( s[ callbackName ] ) {
 
// Make sure that re-using the options doesn't screw things around
// make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback;
 
// Save the callback name for future use
// save the callback name for future use
oldCallbacks.push( callbackName );
}
 
@@ -92,11 +79,11 @@
}
 
responseContainer = overwritten = undefined;
} );
});
 
// Delegate to script
return "script";
}
} );
});
 
} );
});
/bower_components/jquery/src/ajax/load.js
@@ -1,25 +1,31 @@
define( [
define([
"../core",
"../core/stripAndCollapse",
"../core/parseHTML",
"../ajax",
"../traversing",
"../manipulation",
"../selector"
], function( jQuery, stripAndCollapse ) {
"../selector",
// Optional event/alias dependency
"../event/alias"
], function( jQuery ) {
 
"use strict";
// Keep a copy of the old load method
var _load = jQuery.fn.load;
 
/**
* Load a url into a page
*/
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
 
var selector, type, response,
self = this,
off = url.indexOf( " " );
off = url.indexOf(" ");
 
if ( off > -1 ) {
selector = stripAndCollapse( url.slice( off ) );
if ( off >= 0 ) {
selector = jQuery.trim( url.slice( off ) );
url = url.slice( 0, off );
}
 
@@ -37,16 +43,14 @@
 
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax( {
jQuery.ajax({
url: url,
 
// If "type" variable is undefined, then "GET" method will be used.
// Make value of this field explicit since
// user can override it through ajaxSetup method
type: type || "GET",
// if "type" variable is undefined, then "GET" method will be used
type: type,
dataType: "html",
data: params
} ).done( function( responseText ) {
}).done(function( responseText ) {
 
// Save response for use in complete callback
response = arguments;
@@ -55,22 +59,17 @@
 
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
 
// Otherwise use the full result
responseText );
 
// If the request succeeds, this function gets "data", "status", "jqXHR"
// but they are ignored because response was set above.
// If it fails, this function gets "jqXHR", "status", "error"
} ).always( callback && function( jqXHR, status ) {
self.each( function() {
callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
} );
} );
}).complete( callback && function( jqXHR, status ) {
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
});
}
 
return this;
};
 
} );
});
/bower_components/jquery/src/ajax/parseJSON.js
@@ -0,0 +1,13 @@
define([
"../core"
], function( jQuery ) {
 
// Support: Android 2.3
// Workaround failure to string-cast null input
jQuery.parseJSON = function( data ) {
return JSON.parse( data + "" );
};
 
return jQuery.parseJSON;
 
});
/bower_components/jquery/src/ajax/parseXML.js
@@ -1,20 +1,18 @@
define( [
define([
"../core"
], function( jQuery ) {
 
"use strict";
 
// Cross-browser xml parsing
jQuery.parseXML = function( data ) {
var xml;
var xml, tmp;
if ( !data || typeof data !== "string" ) {
return null;
}
 
// Support: IE 9 - 11 only
// IE throws on parseFromString with invalid input.
// Support: IE9
try {
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
tmp = new DOMParser();
xml = tmp.parseFromString( data, "text/xml" );
} catch ( e ) {
xml = undefined;
}
@@ -27,4 +25,4 @@
 
return jQuery.parseXML;
 
} );
});
/bower_components/jquery/src/ajax/script.js
@@ -1,26 +1,15 @@
define( [
define([
"../core",
"../var/document",
"../ajax"
], function( jQuery, document ) {
], function( jQuery ) {
 
"use strict";
 
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) {
if ( s.crossDomain ) {
s.contents.script = false;
}
} );
 
// Install script dataType
jQuery.ajaxSetup( {
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, " +
"application/ecmascript, application/x-ecmascript"
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /\b(?:java|ecma)script\b/
script: /(?:java|ecma)script/
},
converters: {
"text script": function( text ) {
@@ -28,7 +17,7 @@
return text;
}
}
} );
});
 
// Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) {
@@ -38,20 +27,20 @@
if ( s.crossDomain ) {
s.type = "GET";
}
} );
});
 
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) {
 
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script, callback;
return {
send: function( _, complete ) {
script = jQuery( "<script>" ).prop( {
script = jQuery("<script>").prop({
async: true,
charset: s.scriptCharset,
src: s.url
} ).on(
}).on(
"load error",
callback = function( evt ) {
script.remove();
@@ -61,8 +50,6 @@
}
}
);
 
// Use native DOM manipulation to avoid our domManip AJAX trickery
document.head.appendChild( script[ 0 ] );
},
abort: function() {
@@ -72,6 +59,6 @@
}
};
}
} );
});
 
} );
});
/bower_components/jquery/src/ajax/var/nonce.js
@@ -1,7 +1,5 @@
define( [
define([
"../../core"
], function( jQuery ) {
"use strict";
 
return jQuery.now();
} );
});
/bower_components/jquery/src/ajax/var/rquery.js
@@ -1,5 +1,3 @@
define( function() {
"use strict";
 
return ( /\?/ );
} );
define(function() {
return (/\?/);
});
/bower_components/jquery/src/ajax/xhr.js
@@ -1,33 +1,42 @@
define( [
define([
"../core",
"../var/support",
"../ajax"
], function( jQuery, support ) {
 
"use strict";
 
jQuery.ajaxSettings.xhr = function() {
try {
return new window.XMLHttpRequest();
} catch ( e ) {}
return new XMLHttpRequest();
} catch( e ) {}
};
 
var xhrSuccessStatus = {
 
// File protocol always yields status code 0, assume 200
var xhrId = 0,
xhrCallbacks = {},
xhrSuccessStatus = {
// file protocol always yields status code 0, assume 200
0: 200,
 
// Support: IE <=9 only
// Support: IE9
// #1450: sometimes IE returns 1223 when it should be 204
1223: 204
},
xhrSupported = jQuery.ajaxSettings.xhr();
 
// Support: IE9
// Open requests must be manually aborted on unload (#5280)
// See https://support.microsoft.com/kb/2856746 for more info
if ( window.attachEvent ) {
window.attachEvent( "onunload", function() {
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]();
}
});
}
 
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
support.ajax = xhrSupported = !!xhrSupported;
 
jQuery.ajaxTransport( function( options ) {
var callback, errorCallback;
jQuery.ajaxTransport(function( options ) {
var callback;
 
// Cross domain only allowed if supported through XMLHttpRequest
if ( support.cors || xhrSupported && !options.crossDomain ) {
@@ -34,15 +43,10 @@
return {
send: function( headers, complete ) {
var i,
xhr = options.xhr();
xhr = options.xhr(),
id = ++xhrId;
 
xhr.open(
options.type,
options.url,
options.async,
options.username,
options.password
);
xhr.open( options.type, options.url, options.async, options.username, options.password );
 
// Apply custom fields if provided
if ( options.xhrFields ) {
@@ -61,8 +65,8 @@
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
headers[ "X-Requested-With" ] = "XMLHttpRequest";
if ( !options.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
 
// Set headers
@@ -74,38 +78,27 @@
callback = function( type ) {
return function() {
if ( callback ) {
callback = errorCallback = xhr.onload =
xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
delete xhrCallbacks[ id ];
callback = xhr.onload = xhr.onerror = null;
 
if ( type === "abort" ) {
xhr.abort();
} else if ( type === "error" ) {
 
// Support: IE <=9 only
// On a manual native abort, IE9 throws
// errors on any property access that is not readyState
if ( typeof xhr.status !== "number" ) {
complete( 0, "error" );
} else {
complete(
 
// File: protocol always yields status 0; see #8605, #14207
xhr.status,
xhr.statusText
);
}
complete(
// file: protocol always yields status 0; see #8605, #14207
xhr.status,
xhr.statusText
);
} else {
complete(
xhrSuccessStatus[ xhr.status ] || xhr.status,
xhr.statusText,
 
// Support: IE <=9 only
// IE9 has no XHR2 but throws on binary (trac-11426)
// For XHR2 non-text, let the caller handle it (gh-2498)
( xhr.responseType || "text" ) !== "text" ||
typeof xhr.responseText !== "string" ?
{ binary: xhr.response } :
{ text: xhr.responseText },
// Support: IE9
// Accessing binary-data responseText throws an exception
// (#11426)
typeof xhr.responseText === "string" ? {
text: xhr.responseText
} : undefined,
xhr.getAllResponseHeaders()
);
}
@@ -115,41 +108,15 @@
 
// Listen to events
xhr.onload = callback();
errorCallback = xhr.onerror = callback( "error" );
xhr.onerror = callback("error");
 
// Support: IE 9 only
// Use onreadystatechange to replace onabort
// to handle uncaught aborts
if ( xhr.onabort !== undefined ) {
xhr.onabort = errorCallback;
} else {
xhr.onreadystatechange = function() {
 
// Check readyState before timeout as it changes
if ( xhr.readyState === 4 ) {
 
// Allow onerror to be called first,
// but that will not handle a native abort
// Also, save errorCallback to a variable
// as xhr.onerror cannot be accessed
window.setTimeout( function() {
if ( callback ) {
errorCallback();
}
} );
}
};
}
 
// Create the abort callback
callback = callback( "abort" );
callback = xhrCallbacks[ id ] = callback("abort");
 
try {
 
// Do send the request (this may raise an exception)
xhr.send( options.hasContent && options.data || null );
} catch ( e ) {
 
// #14683: Only rethrow if this hasn't been notified as an error yet
if ( callback ) {
throw e;
@@ -164,6 +131,6 @@
}
};
}
} );
});
 
} );
});