Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ module.exports = function( grunt ) {
"src/intro.js",
"src/version.js",
"src/migrate.js",
"src/attributes.js",
"src/core.js",
"src/css.js",
"src/data.js",
"src/manipulation.js",
"src/effects.js",
"src/event.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be back soon if #87 is fixed, but we might as well take it out now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may leave it empty if you wish but adding new modules isn't that hard anyway. :)

"src/traversing.js",
Expand Down
119 changes: 0 additions & 119 deletions src/attributes.js

This file was deleted.

134 changes: 6 additions & 128 deletions src/core.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,15 @@

var matched, browser,
oldInit = jQuery.fn.init,
rspaceAngle = /^\s*</,
rattrHash = /\[\s*\w+\s*[~|^$*]?=\s*(?![\s'"])[^#\]]*#/,
var oldInit = jQuery.fn.init,
rattrHash = /\[\s*\w+\s*[~|^$*]?=\s*(?![\s'"])[^#\]]*#/;

// Note: XSS check is done below after string is trimmed
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;

// $(html) "looks like html" rule change
jQuery.fn.init = function( selector, context, rootjQuery ) {
var match, ret;

if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
( match = rquickExpr.exec( jQuery.trim( selector ) ) ) && match[ 0 ] ) {

// This is an HTML string according to the "old" rules; is it still?
if ( !rspaceAngle.test( selector ) ) {
migrateWarn( "$(html) HTML strings must start with '<' character" );
}
if ( match[ 3 ] ) {
migrateWarn( "$(html) HTML text after last tag is ignored" );
}

// Consistently reject any HTML-like string starting with a hash (#9521)
// Note that this may break jQuery 1.6.x code that otherwise would work.
if ( match[ 0 ].charAt( 0 ) === "#" ) {
migrateWarn( "HTML string cannot start with a '#' character" );
jQuery.error( "JQMIGRATE: Invalid selector string (XSS)" );
}

// Now process using loose rules; let pre-1.8 play too
if ( context && context.context ) {

// JQuery object as context; parseHTML expects a DOM object
context = context.context;
}
if ( jQuery.parseHTML ) {
return oldInit.call( this,
jQuery.parseHTML( match[ 2 ], context && context.ownerDocument ||
context || document, true ), context, rootjQuery );
}
}
jQuery.fn.init = function( selector ) {
var args = Array.prototype.slice.call( arguments );

if ( selector === "#" ) {

// JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
migrateWarn( "jQuery( '#' ) is not a valid selector" );
selector = [];
args[ 0 ] = selector = [];

} else if ( rattrHash.test( selector ) ) {

Expand All @@ -55,95 +18,10 @@ jQuery.fn.init = function( selector, context, rootjQuery ) {
migrateWarn( "Attribute selectors with '#' must be quoted: '" + selector + "'" );
}

ret = oldInit.apply( this, arguments );

// Fill in selector and context properties so .live() works
if ( selector && selector.selector !== undefined ) {

// A jQuery object, copy its properties
ret.selector = selector.selector;
ret.context = selector.context;

} else {
ret.selector = typeof selector === "string" ? selector : "";
if ( selector ) {
ret.context = selector.nodeType ? selector : context || document;
}
}

return ret;
return oldInit.apply( this, args );
};
jQuery.fn.init.prototype = jQuery.fn;

jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();

var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf( "compatible" ) < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];

return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};

// Don't clobber any existing jQuery.browser in case it's different
if ( !jQuery.browser ) {
matched = jQuery.uaMatch( navigator.userAgent );
browser = {};

if ( matched.browser ) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}

// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
browser.webkit = true;
} else if ( browser.webkit ) {
browser.safari = true;
}

jQuery.browser = browser;
}

// Warn if the code tries to get jQuery.browser
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );

// JQuery.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7
jQuery.boxModel = jQuery.support.boxModel = ( document.compatMode === "CSS1Compat" );
migrateWarnProp( jQuery, "boxModel", jQuery.boxModel, "jQuery.boxModel is deprecated" );
migrateWarnProp(
jQuery.support,
"boxModel",
jQuery.support.boxModel, "jQuery.support.boxModel is deprecated"
);

jQuery.sub = function() {
function jQuerySub( selector, context ) {
return new jQuerySub.fn.init( selector, context );
}
jQuery.extend( true, jQuerySub, this );
jQuerySub.superclass = this;
jQuerySub.fn = jQuerySub.prototype = this();
jQuerySub.fn.constructor = jQuerySub;
jQuerySub.sub = this.sub;
jQuerySub.fn.init = function init( selector, context ) {
var instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub );
return instance instanceof jQuerySub ?
instance :
jQuerySub( instance );
};
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub( document );
migrateWarn( "jQuery.sub() is deprecated" );
return jQuerySub;
};

// The number of elements contained in the matched element set
jQuery.fn.size = function() {
migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
Expand Down
18 changes: 0 additions & 18 deletions src/data.js

This file was deleted.

Loading