mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
All non-var modules should not indent in their AMD wrappers (just for prettier builds). No functionality changes.
This commit is contained in:
parent
2063d6c189
commit
6bc8059717
@ -2,12 +2,12 @@ define([
|
|||||||
"../core"
|
"../core"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
|
|
||||||
var rvalidchars = /^[\],:{}\s]*$/,
|
var rvalidchars = /^[\],:{}\s]*$/,
|
||||||
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
||||||
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
|
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
|
||||||
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;
|
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;
|
||||||
|
|
||||||
jQuery.parseJSON = function( data ) {
|
jQuery.parseJSON = function( data ) {
|
||||||
// Attempt to parse using the native JSON parser first
|
// Attempt to parse using the native JSON parser first
|
||||||
if ( window.JSON && window.JSON.parse ) {
|
if ( window.JSON && window.JSON.parse ) {
|
||||||
return window.JSON.parse( data );
|
return window.JSON.parse( data );
|
||||||
@ -35,7 +35,8 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
jQuery.error( "Invalid JSON: " + data );
|
jQuery.error( "Invalid JSON: " + data );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return jQuery.parseJSON;
|
||||||
|
|
||||||
return jQuery.parseJSON;
|
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
define([
|
define([
|
||||||
"../core"
|
"../core"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
// Cross-browser xml parsing
|
|
||||||
jQuery.parseXML = function( data ) {
|
// Cross-browser xml parsing
|
||||||
|
jQuery.parseXML = function( data ) {
|
||||||
var xml, tmp;
|
var xml, tmp;
|
||||||
if ( !data || typeof data !== "string" ) {
|
if ( !data || typeof data !== "string" ) {
|
||||||
return null;
|
return null;
|
||||||
@ -23,7 +24,8 @@ define([
|
|||||||
jQuery.error( "Invalid XML: " + data );
|
jQuery.error( "Invalid XML: " + data );
|
||||||
}
|
}
|
||||||
return xml;
|
return xml;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return jQuery.parseXML;
|
||||||
|
|
||||||
return jQuery.parseXML;
|
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,7 @@ define([
|
|||||||
"./attributes/prop",
|
"./attributes/prop",
|
||||||
"./attributes/classes"
|
"./attributes/classes"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
// Return jQuery for attributes-only inclusion
|
|
||||||
return jQuery;
|
// Return jQuery for attributes-only inclusion
|
||||||
|
return jQuery;
|
||||||
});
|
});
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
define([
|
define([
|
||||||
"../core"
|
"../core"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
// Multifunctional method to get and set values of a collection
|
|
||||||
// The value/s can optionally be executed if it's a function
|
// Multifunctional method to get and set values of a collection
|
||||||
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
// 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,
|
var i = 0,
|
||||||
length = elems.length,
|
length = elems.length,
|
||||||
bulk = key == null;
|
bulk = key == null;
|
||||||
@ -52,7 +53,8 @@ define([
|
|||||||
bulk ?
|
bulk ?
|
||||||
fn.call( elems ) :
|
fn.call( elems ) :
|
||||||
length ? fn( elems[0], key ) : emptyGet;
|
length ? fn( elems[0], key ) : emptyGet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return access;
|
||||||
|
|
||||||
return access;
|
|
||||||
});
|
});
|
||||||
|
@ -4,10 +4,10 @@ define([
|
|||||||
"../manipulation" // buildFragment
|
"../manipulation" // buildFragment
|
||||||
], function( jQuery, rsingleTag ) {
|
], function( jQuery, rsingleTag ) {
|
||||||
|
|
||||||
// data: string of html
|
// data: string of html
|
||||||
// context (optional): If specified, the fragment will be created in this context, defaults to document
|
// 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
|
// keepScripts (optional): If true, will include scripts passed in the html string
|
||||||
jQuery.parseHTML = function( data, context, keepScripts ) {
|
jQuery.parseHTML = function( data, context, keepScripts ) {
|
||||||
if ( !data || typeof data !== "string" ) {
|
if ( !data || typeof data !== "string" ) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -32,7 +32,8 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
return jQuery.merge( [], parsed.childNodes );
|
return jQuery.merge( [], parsed.childNodes );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return jQuery.parseHTML;
|
||||||
|
|
||||||
return jQuery.parseHTML;
|
|
||||||
});
|
});
|
||||||
|
@ -2,8 +2,8 @@ define([
|
|||||||
"../core"
|
"../core"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
|
|
||||||
// A method for quickly swapping in/out CSS properties to get correct calculations.
|
// A method for quickly swapping in/out CSS properties to get correct calculations.
|
||||||
jQuery.swap = function( elem, options, callback, args ) {
|
jQuery.swap = function( elem, options, callback, args ) {
|
||||||
var ret, name,
|
var ret, name,
|
||||||
old = {};
|
old = {};
|
||||||
|
|
||||||
@ -21,7 +21,8 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return jQuery.swap;
|
||||||
|
|
||||||
return jQuery.swap;
|
|
||||||
});
|
});
|
||||||
|
@ -3,9 +3,11 @@ define([
|
|||||||
"../selector",
|
"../selector",
|
||||||
"../effects"
|
"../effects"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
jQuery.expr.filters.animated = function( elem ) {
|
|
||||||
|
jQuery.expr.filters.animated = function( elem ) {
|
||||||
return jQuery.grep(jQuery.timers, function( fn ) {
|
return jQuery.grep(jQuery.timers, function( fn ) {
|
||||||
return elem === fn.elem;
|
return elem === fn.elem;
|
||||||
}).length;
|
}).length;
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
"../ajax"
|
"../ajax"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
jQuery._evalUrl = function( url ) {
|
|
||||||
|
jQuery._evalUrl = function( url ) {
|
||||||
return jQuery.ajax({
|
return jQuery.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@ -10,7 +11,8 @@ define([
|
|||||||
global: false,
|
global: false,
|
||||||
"throws": true
|
"throws": true
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return jQuery._evalUrl;
|
||||||
|
|
||||||
return jQuery._evalUrl;
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user