From 7cc7910df63d19e7ebc67bb1156437f0559712d7 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Sun, 21 Sep 2014 12:25:47 +0200 Subject: add foundation via bower --- source/bower_components/jquery/src/ajax.js | 806 ++++++++ source/bower_components/jquery/src/ajax/jsonp.js | 89 + source/bower_components/jquery/src/ajax/load.js | 75 + .../bower_components/jquery/src/ajax/parseJSON.js | 13 + .../bower_components/jquery/src/ajax/parseXML.js | 28 + source/bower_components/jquery/src/ajax/script.js | 64 + .../bower_components/jquery/src/ajax/var/nonce.js | 5 + .../bower_components/jquery/src/ajax/var/rquery.js | 3 + source/bower_components/jquery/src/ajax/xhr.js | 135 ++ source/bower_components/jquery/src/attributes.js | 11 + .../bower_components/jquery/src/attributes/attr.js | 143 ++ .../jquery/src/attributes/classes.js | 158 ++ .../bower_components/jquery/src/attributes/prop.js | 96 + .../jquery/src/attributes/support.js | 35 + .../bower_components/jquery/src/attributes/val.js | 163 ++ source/bower_components/jquery/src/callbacks.js | 205 ++ source/bower_components/jquery/src/core.js | 498 +++++ source/bower_components/jquery/src/core/access.js | 60 + source/bower_components/jquery/src/core/init.js | 123 ++ .../bower_components/jquery/src/core/parseHTML.js | 39 + source/bower_components/jquery/src/core/ready.js | 97 + .../jquery/src/core/var/rsingleTag.js | 4 + source/bower_components/jquery/src/css.js | 451 +++++ .../jquery/src/css/addGetHookIf.js | 24 + source/bower_components/jquery/src/css/curCSS.js | 57 + .../jquery/src/css/defaultDisplay.js | 70 + .../jquery/src/css/hiddenVisibleSelectors.js | 15 + source/bower_components/jquery/src/css/support.js | 91 + source/bower_components/jquery/src/css/swap.js | 28 + .../jquery/src/css/var/cssExpand.js | 3 + .../jquery/src/css/var/getStyles.js | 5 + .../jquery/src/css/var/isHidden.js | 13 + .../bower_components/jquery/src/css/var/rmargin.js | 3 + .../jquery/src/css/var/rnumnonpx.js | 5 + source/bower_components/jquery/src/data.js | 179 ++ source/bower_components/jquery/src/data/Data.js | 181 ++ source/bower_components/jquery/src/data/accepts.js | 20 + .../jquery/src/data/var/data_priv.js | 5 + .../jquery/src/data/var/data_user.js | 5 + source/bower_components/jquery/src/deferred.js | 149 ++ source/bower_components/jquery/src/deprecated.js | 13 + source/bower_components/jquery/src/dimensions.js | 50 + source/bower_components/jquery/src/effects.js | 649 +++++++ .../bower_components/jquery/src/effects/Tween.js | 114 ++ .../jquery/src/effects/animatedSelector.js | 13 + source/bower_components/jquery/src/event.js | 868 +++++++++ source/bower_components/jquery/src/event/alias.js | 39 + .../bower_components/jquery/src/event/support.js | 9 + source/bower_components/jquery/src/exports/amd.js | 24 + .../bower_components/jquery/src/exports/global.js | 32 + source/bower_components/jquery/src/intro.js | 44 + source/bower_components/jquery/src/jquery.js | 36 + source/bower_components/jquery/src/manipulation.js | 582 ++++++ .../jquery/src/manipulation/_evalUrl.js | 18 + .../jquery/src/manipulation/support.js | 31 + .../jquery/src/manipulation/var/rcheckableType.js | 3 + source/bower_components/jquery/src/offset.js | 204 ++ source/bower_components/jquery/src/outro.js | 1 + source/bower_components/jquery/src/queue.js | 142 ++ source/bower_components/jquery/src/queue/delay.js | 22 + .../bower_components/jquery/src/selector-native.js | 172 ++ .../bower_components/jquery/src/selector-sizzle.js | 14 + source/bower_components/jquery/src/selector.js | 1 + source/bower_components/jquery/src/serialize.js | 111 ++ .../jquery/src/sizzle/dist/sizzle.js | 2044 ++++++++++++++++++++ .../jquery/src/sizzle/dist/sizzle.min.js | 3 + .../jquery/src/sizzle/dist/sizzle.min.map | 1 + source/bower_components/jquery/src/traversing.js | 200 ++ .../jquery/src/traversing/findFilter.js | 100 + .../jquery/src/traversing/var/rneedsContext.js | 6 + source/bower_components/jquery/src/var/arr.js | 3 + .../bower_components/jquery/src/var/class2type.js | 4 + source/bower_components/jquery/src/var/concat.js | 5 + source/bower_components/jquery/src/var/hasOwn.js | 5 + source/bower_components/jquery/src/var/indexOf.js | 5 + source/bower_components/jquery/src/var/pnum.js | 3 + source/bower_components/jquery/src/var/push.js | 5 + .../bower_components/jquery/src/var/rnotwhite.js | 3 + source/bower_components/jquery/src/var/slice.js | 5 + .../jquery/src/var/strundefined.js | 3 + source/bower_components/jquery/src/var/support.js | 4 + source/bower_components/jquery/src/var/toString.js | 5 + source/bower_components/jquery/src/wrap.js | 78 + 83 files changed, 9828 insertions(+) create mode 100644 source/bower_components/jquery/src/ajax.js create mode 100644 source/bower_components/jquery/src/ajax/jsonp.js create mode 100644 source/bower_components/jquery/src/ajax/load.js create mode 100644 source/bower_components/jquery/src/ajax/parseJSON.js create mode 100644 source/bower_components/jquery/src/ajax/parseXML.js create mode 100644 source/bower_components/jquery/src/ajax/script.js create mode 100644 source/bower_components/jquery/src/ajax/var/nonce.js create mode 100644 source/bower_components/jquery/src/ajax/var/rquery.js create mode 100644 source/bower_components/jquery/src/ajax/xhr.js create mode 100644 source/bower_components/jquery/src/attributes.js create mode 100644 source/bower_components/jquery/src/attributes/attr.js create mode 100644 source/bower_components/jquery/src/attributes/classes.js create mode 100644 source/bower_components/jquery/src/attributes/prop.js create mode 100644 source/bower_components/jquery/src/attributes/support.js create mode 100644 source/bower_components/jquery/src/attributes/val.js create mode 100644 source/bower_components/jquery/src/callbacks.js create mode 100644 source/bower_components/jquery/src/core.js create mode 100644 source/bower_components/jquery/src/core/access.js create mode 100644 source/bower_components/jquery/src/core/init.js create mode 100644 source/bower_components/jquery/src/core/parseHTML.js create mode 100644 source/bower_components/jquery/src/core/ready.js create mode 100644 source/bower_components/jquery/src/core/var/rsingleTag.js create mode 100644 source/bower_components/jquery/src/css.js create mode 100644 source/bower_components/jquery/src/css/addGetHookIf.js create mode 100644 source/bower_components/jquery/src/css/curCSS.js create mode 100644 source/bower_components/jquery/src/css/defaultDisplay.js create mode 100644 source/bower_components/jquery/src/css/hiddenVisibleSelectors.js create mode 100644 source/bower_components/jquery/src/css/support.js create mode 100644 source/bower_components/jquery/src/css/swap.js create mode 100644 source/bower_components/jquery/src/css/var/cssExpand.js create mode 100644 source/bower_components/jquery/src/css/var/getStyles.js create mode 100644 source/bower_components/jquery/src/css/var/isHidden.js create mode 100644 source/bower_components/jquery/src/css/var/rmargin.js create mode 100644 source/bower_components/jquery/src/css/var/rnumnonpx.js create mode 100644 source/bower_components/jquery/src/data.js create mode 100644 source/bower_components/jquery/src/data/Data.js create mode 100644 source/bower_components/jquery/src/data/accepts.js create mode 100644 source/bower_components/jquery/src/data/var/data_priv.js create mode 100644 source/bower_components/jquery/src/data/var/data_user.js create mode 100644 source/bower_components/jquery/src/deferred.js create mode 100644 source/bower_components/jquery/src/deprecated.js create mode 100644 source/bower_components/jquery/src/dimensions.js create mode 100644 source/bower_components/jquery/src/effects.js create mode 100644 source/bower_components/jquery/src/effects/Tween.js create mode 100644 source/bower_components/jquery/src/effects/animatedSelector.js create mode 100644 source/bower_components/jquery/src/event.js create mode 100644 source/bower_components/jquery/src/event/alias.js create mode 100644 source/bower_components/jquery/src/event/support.js create mode 100644 source/bower_components/jquery/src/exports/amd.js create mode 100644 source/bower_components/jquery/src/exports/global.js create mode 100644 source/bower_components/jquery/src/intro.js create mode 100644 source/bower_components/jquery/src/jquery.js create mode 100644 source/bower_components/jquery/src/manipulation.js create mode 100644 source/bower_components/jquery/src/manipulation/_evalUrl.js create mode 100644 source/bower_components/jquery/src/manipulation/support.js create mode 100644 source/bower_components/jquery/src/manipulation/var/rcheckableType.js create mode 100644 source/bower_components/jquery/src/offset.js create mode 100644 source/bower_components/jquery/src/outro.js create mode 100644 source/bower_components/jquery/src/queue.js create mode 100644 source/bower_components/jquery/src/queue/delay.js create mode 100644 source/bower_components/jquery/src/selector-native.js create mode 100644 source/bower_components/jquery/src/selector-sizzle.js create mode 100644 source/bower_components/jquery/src/selector.js create mode 100644 source/bower_components/jquery/src/serialize.js create mode 100644 source/bower_components/jquery/src/sizzle/dist/sizzle.js create mode 100644 source/bower_components/jquery/src/sizzle/dist/sizzle.min.js create mode 100644 source/bower_components/jquery/src/sizzle/dist/sizzle.min.map create mode 100644 source/bower_components/jquery/src/traversing.js create mode 100644 source/bower_components/jquery/src/traversing/findFilter.js create mode 100644 source/bower_components/jquery/src/traversing/var/rneedsContext.js create mode 100644 source/bower_components/jquery/src/var/arr.js create mode 100644 source/bower_components/jquery/src/var/class2type.js create mode 100644 source/bower_components/jquery/src/var/concat.js create mode 100644 source/bower_components/jquery/src/var/hasOwn.js create mode 100644 source/bower_components/jquery/src/var/indexOf.js create mode 100644 source/bower_components/jquery/src/var/pnum.js create mode 100644 source/bower_components/jquery/src/var/push.js create mode 100644 source/bower_components/jquery/src/var/rnotwhite.js create mode 100644 source/bower_components/jquery/src/var/slice.js create mode 100644 source/bower_components/jquery/src/var/strundefined.js create mode 100644 source/bower_components/jquery/src/var/support.js create mode 100644 source/bower_components/jquery/src/var/toString.js create mode 100644 source/bower_components/jquery/src/wrap.js (limited to 'source/bower_components/jquery/src') diff --git a/source/bower_components/jquery/src/ajax.js b/source/bower_components/jquery/src/ajax.js new file mode 100644 index 0000000..d39de2a --- /dev/null +++ b/source/bower_components/jquery/src/ajax.js @@ -0,0 +1,806 @@ +define([ + "./core", + "./var/rnotwhite", + "./ajax/var/nonce", + "./ajax/var/rquery", + "./core/init", + "./ajax/parseJSON", + "./ajax/parseXML", + "./deferred" +], function( jQuery, rnotwhite, nonce, rquery ) { + +var + // Document location + ajaxLocParts, + ajaxLocation, + + rhash = /#.*$/, + rts = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat("*"); + +// #8138, IE may throw an exception when accessing +// a field from window.location if document.domain has been set +try { + ajaxLocation = location.href; +} catch( e ) { + // Use the href attribute of an A element + // since IE will modify it given document.location + ajaxLocation = document.createElement( "a" ); + ajaxLocation.href = ""; + ajaxLocation = ajaxLocation.href; +} + +// Segment location into parts +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; + + if ( jQuery.isFunction( func ) ) { + // For each dataType in the dataTypeExpression + while ( (dataType = dataTypes[i++]) ) { + // Prepend if requested + if ( dataType[0] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); + + // Otherwise append + } else { + (structure[ dataType ] = structure[ dataType ] || []).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + }); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s[ "throws" ] ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend({ + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: ajaxLocation, + type: "GET", + isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /xml/, + html: /html/, + json: /json/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": jQuery.parseJSON, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + // URL without anti-cache param + cacheURL, + // Response headers + responseHeadersString, + responseHeaders, + // timeout handle + timeoutTimer, + // Cross-domain detection vars + parts, + // To know if global events are to be dispatched + fireGlobals, + // Loop variable + i, + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + // Callbacks context + callbackContext = s.context || s, + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks("once memory"), + // Status-dependent callbacks + statusCode = s.statusCode || {}, + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + // The jqXHR state + state = 0, + // Default abort message + strAbort = "canceled", + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( state === 2 ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( (match = rheaders.exec( responseHeadersString )) ) { + responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return state === 2 ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + var lname = name.toLowerCase(); + if ( !state ) { + name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( !state ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( state < 2 ) { + for ( code in map ) { + // Lazy-add the new callback in a way that preserves old ones + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } else { + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ).complete = completeDeferred.add; + jqXHR.success = jqXHR.done; + jqXHR.error = jqXHR.fail; + + // Remove hash character (#7531: and string promotion) + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ) + .replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; + + // A cross-domain request is in order when we have a protocol:host:port mismatch + if ( s.crossDomain == null ) { + parts = rurl.exec( s.url.toLowerCase() ); + s.crossDomain = !!( parts && + ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || + ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== + ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) + ); + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( state === 2 ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + fireGlobals = s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger("ajaxStart"); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + cacheURL = s.url; + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // If data is available, append data to url + if ( s.data ) { + cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add anti-cache in url if needed + if ( s.cache === false ) { + s.url = rts.test( cacheURL ) ? + + // If there is already a '_' parameter, set its value + cacheURL.replace( rts, "$1_=" + nonce++ ) : + + // Otherwise add one to the end + cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; + } + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? + s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { + // Abort if not done already and return + return jqXHR.abort(); + } + + // aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + for ( i in { success: 1, error: 1, complete: 1 } ) { + jqXHR[ i ]( s[ i ] ); + } + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = setTimeout(function() { + jqXHR.abort("timeout"); + }, s.timeout ); + } + + try { + state = 1; + transport.send( requestHeaders, done ); + } catch ( e ) { + // Propagate exception as error if not done + if ( state < 2 ) { + done( -1, e ); + // Simply rethrow otherwise + } else { + throw e; + } + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Called once + if ( state === 2 ) { + return; + } + + // State is "done" now + state = 2; + + // Clear timeout if it exists + if ( timeoutTimer ) { + clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader("Last-Modified"); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader("etag"); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + // We extract error from statusText + // then normalize statusText and status for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger("ajaxStop"); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +}); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + // shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + return jQuery.ajax({ + url: url, + type: method, + dataType: type, + data: data, + success: callback + }); + }; +}); + +// 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 ); + }; +}); + +return jQuery; +}); diff --git a/source/bower_components/jquery/src/ajax/jsonp.js b/source/bower_components/jquery/src/ajax/jsonp.js new file mode 100644 index 0000000..ff0d538 --- /dev/null +++ b/source/bower_components/jquery/src/ajax/jsonp.js @@ -0,0 +1,89 @@ +define([ + "../core", + "./var/nonce", + "./var/rquery", + "../ajax" +], function( jQuery, nonce, rquery ) { + +var oldCallbacks = [], + rjsonp = /(=)\?(?=&|$)|\?\?/; + +// Default jsonp settings +jQuery.ajaxSetup({ + jsonp: "callback", + jsonpCallback: function() { + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + this[ callback ] = true; + return callback; + } +}); + +// Detect, normalize options and install callbacks for jsonp requests +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { + + 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") && rjsonp.test( s.data ) && "data" + ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + + // Insert callback into url or form data + if ( jsonProp ) { + s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); + } else if ( s.jsonp !== false ) { + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; + } + + // Use data converter to retrieve json after script execution + s.converters["script json"] = function() { + if ( !responseContainer ) { + jQuery.error( callbackName + " was not called" ); + } + return responseContainer[ 0 ]; + }; + + // force json dataType + s.dataTypes[ 0 ] = "json"; + + // Install callback + overwritten = window[ callbackName ]; + window[ callbackName ] = function() { + responseContainer = arguments; + }; + + // Clean-up function (fires after converters) + jqXHR.always(function() { + // Restore preexisting value + window[ callbackName ] = overwritten; + + // Save back as free + if ( s[ callbackName ] ) { + // make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + + // save the callback name for future use + oldCallbacks.push( callbackName ); + } + + // Call if it was a function and we have a response + if ( responseContainer && jQuery.isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + }); + + // Delegate to script + return "script"; + } +}); + +}); diff --git a/source/bower_components/jquery/src/ajax/load.js b/source/bower_components/jquery/src/ajax/load.js new file mode 100644 index 0000000..bff25b1 --- /dev/null +++ b/source/bower_components/jquery/src/ajax/load.js @@ -0,0 +1,75 @@ +define([ + "../core", + "../core/parseHTML", + "../ajax", + "../traversing", + "../manipulation", + "../selector", + // Optional event/alias dependency + "../event/alias" +], function( jQuery ) { + +// 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(" "); + + if ( off >= 0 ) { + selector = jQuery.trim( url.slice( off ) ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( jQuery.isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; + + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } + + // If we have elements to modify, make the request + if ( self.length > 0 ) { + jQuery.ajax({ + url: url, + + // if "type" variable is undefined, then "GET" method will be used + type: type, + dataType: "html", + data: params + }).done(function( responseText ) { + + // Save response for use in complete callback + response = arguments; + + self.html( selector ? + + // If a selector was specified, locate the right elements in a dummy div + // Exclude scripts to avoid IE 'Permission Denied' errors + jQuery("
").append( jQuery.parseHTML( responseText ) ).find( selector ) : + + // Otherwise use the full result + responseText ); + + }).complete( callback && function( jqXHR, status ) { + self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); + }); + } + + return this; +}; + +}); diff --git a/source/bower_components/jquery/src/ajax/parseJSON.js b/source/bower_components/jquery/src/ajax/parseJSON.js new file mode 100644 index 0000000..3a96d15 --- /dev/null +++ b/source/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; + +}); diff --git a/source/bower_components/jquery/src/ajax/parseXML.js b/source/bower_components/jquery/src/ajax/parseXML.js new file mode 100644 index 0000000..9eeb625 --- /dev/null +++ b/source/bower_components/jquery/src/ajax/parseXML.js @@ -0,0 +1,28 @@ +define([ + "../core" +], function( jQuery ) { + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE9 + try { + tmp = new DOMParser(); + xml = tmp.parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + +return jQuery.parseXML; + +}); diff --git a/source/bower_components/jquery/src/ajax/script.js b/source/bower_components/jquery/src/ajax/script.js new file mode 100644 index 0000000..f44329d --- /dev/null +++ b/source/bower_components/jquery/src/ajax/script.js @@ -0,0 +1,64 @@ +define([ + "../core", + "../ajax" +], function( jQuery ) { + +// Install script dataType +jQuery.ajaxSetup({ + accepts: { + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /(?:java|ecma)script/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +}); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + 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("