diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ajax.js | 4 | ||||
-rw-r--r-- | src/ajax/jsonp.js | 4 | ||||
-rw-r--r-- | src/ajax/script.js | 4 | ||||
-rw-r--r-- | src/ajax/xhr.js | 4 | ||||
-rw-r--r-- | src/attributes.js | 4 | ||||
-rw-r--r-- | src/callbacks.js | 4 | ||||
-rw-r--r-- | src/core.js | 29 | ||||
-rw-r--r-- | src/css.js | 93 | ||||
-rw-r--r-- | src/data.js | 4 | ||||
-rw-r--r-- | src/deferred.js | 6 | ||||
-rw-r--r-- | src/dimensions.js | 4 | ||||
-rw-r--r-- | src/effects.js | 2 | ||||
-rw-r--r-- | src/event.js | 4 | ||||
-rw-r--r-- | src/exports.js | 4 | ||||
-rw-r--r-- | src/intro.js | 5 | ||||
-rw-r--r-- | src/manipulation.js | 4 | ||||
-rw-r--r-- | src/offset.js | 4 | ||||
-rw-r--r-- | src/queue.js | 4 | ||||
-rw-r--r-- | src/support.js | 4 | ||||
-rw-r--r-- | src/traversing.js | 5 |
20 files changed, 61 insertions, 135 deletions
diff --git a/src/ajax.js b/src/ajax.js index c402f2153..cb8af47c9 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, @@ -993,5 +991,3 @@ function ajaxConvert( s, response ) { return { state: "success", data: response }; } - -})( jQuery ); diff --git a/src/ajax/jsonp.js b/src/ajax/jsonp.js index 3e3ea85a3..c39913fac 100644 --- a/src/ajax/jsonp.js +++ b/src/ajax/jsonp.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var oldCallbacks = [], rquestion = /\?/, rjsonp = /(=)\?(?=&|$)|\?\?/, @@ -87,5 +85,3 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { return "script"; } }); - -})( jQuery ); diff --git a/src/ajax/script.js b/src/ajax/script.js index f7a918010..48b329ae3 100644 --- a/src/ajax/script.js +++ b/src/ajax/script.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - // Install script dataType jQuery.ajaxSetup({ accepts: { @@ -85,5 +83,3 @@ jQuery.ajaxTransport( "script", function(s) { }; } }); - -})( jQuery ); diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 186432f61..fb431034d 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject ? function() { // Abort all pending requests @@ -222,5 +220,3 @@ if ( jQuery.support.ajax ) { } }); } - -})( jQuery ); diff --git a/src/attributes.js b/src/attributes.js index cc2256f88..1b79ae44a 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var rclass = /[\n\t\r]/g, rspace = /\s+/, rreturn = /\r/g, @@ -652,5 +650,3 @@ jQuery.each([ "radio", "checkbox" ], function() { } }); }); - -})( jQuery ); diff --git a/src/callbacks.js b/src/callbacks.js index 5516d551f..12f2956ce 100644 --- a/src/callbacks.js +++ b/src/callbacks.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - // String to Object options format cache var optionsCache = {}; @@ -192,5 +190,3 @@ jQuery.Callbacks = function( options ) { return self; }; - -})( jQuery ); diff --git a/src/core.js b/src/core.js index 3fcc9e46c..c9ed81d2a 100644 --- a/src/core.js +++ b/src/core.js @@ -1,7 +1,18 @@ -var jQuery = (function() { +// Use the correct document accordingly with window argument (sandbox) +var document = window.document, + navigator = window.navigator, + location = window.location, -// Define a local copy of jQuery -var jQuery = function( selector, context ) { + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // Define a local copy of jQuery + jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, @@ -71,14 +82,6 @@ var jQuery = function( selector, context ) { jQuery.ready(); }, - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - // [[Class]] -> type pairs class2type = {}; @@ -933,7 +936,3 @@ function doScrollCheck() { // and execute any waiting functions jQuery.ready(); } - -return jQuery; - -})(); diff --git a/src/css.js b/src/css.js index 67559e950..4497878e4 100644 --- a/src/css.js +++ b/src/css.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - // order is important! jQuery.cssExpand = [ "Top", "Right", "Bottom", "Left" ]; @@ -66,7 +64,7 @@ function showHide( elements, show ) { // for such an element if ( (elem.style.display === "" && curCSS( elem, "display" ) === "none") || !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", jQuery.defaultDisplay(elem.nodeName) ); + values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); } } else { display = curCSS( elem, "display" ); @@ -264,49 +262,6 @@ jQuery.extend({ } return ret; - }, - - // Try to determine the default display value of an element - defaultDisplay: function( nodeName ) { - if ( elemdisplay[ nodeName ] ) { - return elemdisplay[ nodeName ]; - } - - var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ), - display = elem.css("display"); - elem.remove(); - - // If the simple way fails, - // get element's real default display by attaching it to a temp iframe - if ( display === "none" || display === "" ) { - // Use the already-created iframe if possible - iframe = document.body.appendChild( - iframe || jQuery.extend( document.createElement("iframe"), { - frameBorder: 0, - width: 0, - height: 0 - }) - ); - - // Create a cacheable copy of the iframe document on first call. - // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML - // document to it; WebKit & Firefox won't allow reusing the iframe document. - if ( !iframeDoc || !iframe.createElement ) { - iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; - iframeDoc.write("<!doctype html><html><body>"); - iframeDoc.close(); - } - - elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) ); - - display = curCSS( elem, "display" ); - document.body.removeChild( iframe ); - } - - // Store the correct default display - elemdisplay[ nodeName ] = display; - - return display; } }); @@ -466,6 +421,50 @@ function getWidthOrHeight( elem, name, extra ) { ) + "px"; } + +// Try to determine the default display value of an element +function defaultDisplay( nodeName ) { + if ( elemdisplay[ nodeName ] ) { + return elemdisplay[ nodeName ]; + } + + var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ), + display = elem.css("display"); + elem.remove(); + + // If the simple way fails, + // get element's real default display by attaching it to a temp iframe + if ( display === "none" || display === "" ) { + // Use the already-created iframe if possible + iframe = document.body.appendChild( + iframe || jQuery.extend( document.createElement("iframe"), { + frameBorder: 0, + width: 0, + height: 0 + }) + ); + + // Create a cacheable copy of the iframe document on first call. + // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML + // document to it; WebKit & Firefox won't allow reusing the iframe document. + if ( !iframeDoc || !iframe.createElement ) { + iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; + iframeDoc.write("<!doctype html><html><body>"); + iframeDoc.close(); + } + + elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) ); + + display = curCSS( elem, "display" ); + document.body.removeChild( iframe ); + } + + // Store the correct default display + elemdisplay[ nodeName ] = display; + + return display; +} + jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { @@ -594,5 +593,3 @@ jQuery.each({ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); - -})( jQuery ); diff --git a/src/data.js b/src/data.js index ff4309f1e..4b5b22fda 100644 --- a/src/data.js +++ b/src/data.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var rbrace = /^(?:\{.*\}|\[.*\])$/, rmultiDash = /([A-Z])/g; @@ -368,5 +366,3 @@ function isEmptyDataObject( obj ) { return true; } - -})( jQuery ); diff --git a/src/deferred.js b/src/deferred.js index 6c42583a5..a8410c8be 100644 --- a/src/deferred.js +++ b/src/deferred.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var // Static reference to slice sliceDeferred = [].slice; @@ -116,7 +114,7 @@ jQuery.extend({ } }; }, - + progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved @@ -144,5 +142,3 @@ jQuery.extend({ return deferred.promise(); } }); - -})( jQuery ); diff --git a/src/dimensions.js b/src/dimensions.js index d81fb327e..172df647d 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { @@ -44,5 +42,3 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { }; }); }); - -})( jQuery ); diff --git a/src/effects.js b/src/effects.js index c2f04a049..bd2ac816d 100644 --- a/src/effects.js +++ b/src/effects.js @@ -253,7 +253,7 @@ function defaultPrefilter( elem, props, opts ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout - if ( !jQuery.support.inlineBlockNeedsLayout || jQuery.defaultDisplay( elem.nodeName ) === "inline" ) { + if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { diff --git a/src/event.js b/src/event.js index b4a76c710..03049a5c4 100644 --- a/src/event.js +++ b/src/event.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var rformElems = /^(?:textarea|input|select)$/i, rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, @@ -1071,5 +1069,3 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; } }); - -})( jQuery ); diff --git a/src/exports.js b/src/exports.js index 7d8964f01..88def50ba 100644 --- a/src/exports.js +++ b/src/exports.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - // Expose jQuery to the global object window.jQuery = window.$ = jQuery; @@ -18,5 +16,3 @@ window.jQuery = window.$ = jQuery; if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } - -})( jQuery ); diff --git a/src/intro.js b/src/intro.js index a81c86f92..8c3272068 100644 --- a/src/intro.js +++ b/src/intro.js @@ -14,8 +14,3 @@ * Date: @DATE */ (function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; diff --git a/src/manipulation.js b/src/manipulation.js index a6b8edc6f..e53daa9b6 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); @@ -799,5 +797,3 @@ jQuery.extend({ } } }); - -})( jQuery ); diff --git a/src/offset.js b/src/offset.js index 362c1329b..fcd39ed05 100644 --- a/src/offset.js +++ b/src/offset.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - var rroot = /^(?:body|html)$/i; jQuery.fn.offset = function( options ) { @@ -180,5 +178,3 @@ function getWindow( elem ) { elem.defaultView || elem.parentWindow : false; } - -})( jQuery );
\ No newline at end of file diff --git a/src/queue.js b/src/queue.js index 175603781..e47f721b8 100644 --- a/src/queue.js +++ b/src/queue.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - jQuery.extend({ queue: function( elem, type, data ) { var queue; @@ -142,5 +140,3 @@ jQuery.fn.extend({ return defer.promise( object ); } }); - -})( jQuery ); diff --git a/src/support.js b/src/support.js index 3a51ba74b..16ce528f2 100644 --- a/src/support.js +++ b/src/support.js @@ -1,5 +1,3 @@ -(function( jQuery ) { - jQuery.support = (function() { var support, @@ -268,5 +266,3 @@ jQuery.support = (function() { return support; })(); - -})( jQuery ); diff --git a/src/traversing.js b/src/traversing.js index a5c08fba5..3544f5be8 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -1,11 +1,8 @@ -(function( jQuery ) { - var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle rmultiselector = /,/, isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, POS = jQuery.expr.match.globalPOS, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { @@ -299,5 +296,3 @@ function winnow( elements, qualifier, keep ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } - -})( jQuery ); |