// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
- return arguments.length === 0 ?
- rootjQuery :
- new jQuery.fn.init( selector, context );
+ return new jQuery.fn.init( selector, context );
},
// Map over jQuery in case of overwrite
// not own constructor property must be Object
if ( obj.constructor
- && !hasOwnProperty.call(obj, "constructor")
- && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ && !hasOwnProperty.call(obj, "constructor")
+ && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
script.text = data;
}
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709).
head.insertBefore( script, head.firstChild );
head.removeChild( script );
},
merge: function( first, second ) {
- var pos, i = second.length;
+ var i = first.length, j = 0;
- // We have to get length this way when IE & Opera overwrite the length
- // expando of getElementsByTagName
- if ( i && i.nodeType ) {
- for ( i = 0; second[i]; ++i ) {}
- }
-
- pos = i + first.length;
-
- // Correct length for non Arrays
- first.length = pos;
-
- while ( i ) {
- first[ --pos ] = second[ --i ];
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
}
+ first.length = i;
+
return first;
},
},
// Use of jQuery.browser is frowned upon.
- // It's included for backwards compatibility and plugins,
- // although they should work to migrate away.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
browser: {
version: (/.*?(?:firefox|safari|opera|msie)[\/ ]([\d.]+)/.exec(userAgent) || [0,'0'])[1],
safari: /safari/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
- firefox: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
+ firefox: /firefox/.test( userAgent )
}
});
// Deprecated
-jQuery.browser.mozilla = jQuery.browser.firefox;
+jQuery.browser.mozilla = /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent );
if ( indexOf ) {
jQuery.inArray = function( elem, array ) {