Socket
Socket
Sign inDemoInstall

jquery

Package Overview
Dependencies
Maintainers
4
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery - npm Package Compare versions

Comparing version 1.12.0 to 1.12.1

dist/jquery.slim.js

3

AUTHORS.txt

@@ -264,1 +264,4 @@ Authors ordered by first contribution.

Jun Sun <klsforever@gmail.com>
Devin Wilson <dwilson6.github@gmail.com>
Todor Prikumov <tono_pr@abv.bg>
Zack Hall <zackhall@outlook.com>

2

package.json

@@ -5,3 +5,3 @@ {

"description": "JavaScript library for DOM operations",
"version": "1.12.0",
"version": "1.12.1",
"main": "dist/jquery.js",

@@ -8,0 +8,0 @@ "homepage": "http://jquery.com",

@@ -1,5 +0,65 @@

# jQuery Dist
# jQuery
This repo only contains package distribution files for jQuery Core.
> jQuery is a fast, small, and feature-rich JavaScript library.
For source files and issues, visit the [jQuery repo](https://github.com/jquery/jquery).
For information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/).
For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery).
## Including jQuery
Below are some of the most common ways to include jQuery.
### Browser
#### Script tag
```html
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
```
#### Babel
[Babel](http://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.
```js
import $ from "jquery";
```
#### Browserify/Webpack
There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this...
```js
var $ = require("jquery");
```
#### AMD (Asynchronous Module Definition)
AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html).
```js
define(["jquery"], function($) {
});
```
### Node
To include jQuery in [Node](nodejs.org), first install with npm.
```sh
npm install jquery
```
For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes.
```js
require("jsdom").env("", function(err, window) {
if (err) {
console.error(err);
return;
}
var $ = require("jquery")(window);
});
```

@@ -100,7 +100,6 @@ define( [

// after the browser event has already occurred.
// we once tried to use readyState "interactive" here,
// but it caused issues like the one
// discovered by ChrisS here:
// http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Support: IE6-10
// Older IE sometimes signals "interactive" too soon
if ( document.readyState === "complete" ||
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {

@@ -107,0 +106,0 @@ // Handle it asynchronously to allow scripts the opportunity to delay ready

@@ -22,3 +22,3 @@ define( [

if ( !view.opener ) {
if ( !view || !view.opener ) {
view = window;

@@ -39,8 +39,11 @@ }

// Support: Opera 12.1x only
// Fall back to style even without computed
// computed is undefined for elems on document fragments
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
if ( computed ) {
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// A tribute to the "awesome hack by Dean Edwards"

@@ -47,0 +50,0 @@ // Chrome < 17 and Safari 5.0 uses "computed value"

@@ -1,2 +0,2 @@

define(function() {
define( function() {
return function( elem ) {

@@ -15,2 +15,2 @@

};
});
} );

@@ -1,6 +0,6 @@

define([
define( [
"../core",
"../var/rnotwhite",
"./accepts"
], function( jQuery, rnotwhite ) {
"./var/acceptData"
], function( jQuery, rnotwhite, acceptData ) {

@@ -12,45 +12,37 @@ function Data() {

Data.uid = 1;
Data.accepts = jQuery.acceptData;
Data.prototype = {
register: function( owner ) {
var value = {};
cache: function( owner ) {
// If it is a node unlikely to be stringify-ed or looped over
// use plain assignment
if ( owner.nodeType ) {
owner[ this.expando ] = value;
// Check if the owner object already has a cache
var value = owner[ this.expando ];
// Otherwise secure it in a non-enumerable, non-writable property
// configurability must be true to allow the property to be
// deleted with the delete operator
} else {
Object.defineProperty( owner, this.expando, {
value: value,
writable: true,
configurable: true
});
}
return owner[ this.expando ];
},
cache: function( owner ) {
// If not, create one
if ( !value ) {
value = {};
// We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335.
// Always return an empty object.
if ( !Data.accepts( owner ) ) {
return {};
}
// We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335.
// Always return an empty object.
if ( acceptData( owner ) ) {
// Check if the owner object already has a cache
var cache = owner[ this.expando ];
// If it is a node unlikely to be stringify-ed or looped over
// use plain assignment
if ( owner.nodeType ) {
owner[ this.expando ] = value;
// If so, return it
if ( cache ) {
return cache;
// Otherwise secure it in a non-enumerable property
// configurable must be true to allow the property to be
// deleted when data is removed
} else {
Object.defineProperty( owner, this.expando, {
value: value,
configurable: true
} );
}
}
}
// If not, register one
return this.register( owner );
return value;
},

@@ -77,9 +69,7 @@ set: function( owner, data, value ) {

get: function( owner, key ) {
var cache = this.cache( owner );
return key === undefined ?
cache :
this.cache( owner ) :
// Always use camelCase key (gh-2257)
cache[ jQuery.camelCase( key ) ];
owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
},

@@ -105,3 +95,3 @@ access: function( owner, key, value ) {

// [*]When the key is not a string, or both a key and value
// When the key is not a string, or both a key and value
// are specified, set or extend (existing objects) with either:

@@ -153,3 +143,12 @@ //

if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
delete owner[ this.expando ];
// Support: Chrome <= 35-45+
// Webkit & Blink performance suffers when deleting properties
// from DOM nodes, so set to undefined instead
// https://code.google.com/p/chromium/issues/detail?id=378607
if ( owner.nodeType ) {
owner[ this.expando ] = undefined;
} else {
delete owner[ this.expando ];
}
}

@@ -164,2 +163,2 @@ },

return Data;
});
} );

@@ -1,5 +0,5 @@

define([
define( [
"../Data"
], function( Data ) {
return new Data();
});
} );

@@ -1,5 +0,5 @@

define([
define( [
"../Data"
], function( Data ) {
return new Data();
});
} );

@@ -145,7 +145,4 @@ define( [

// Add offsetParent borders
// Subtract offsetParent scroll positions
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ) -
offsetParent.scrollTop();
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) -
offsetParent.scrollLeft();
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
}

@@ -152,0 +149,0 @@

@@ -1,6 +0,8 @@

define([
define( [
"./core",
"./var/document",
"./var/documentElement"
], function( jQuery, document, documentElement ) {
"./var/documentElement",
"./var/hasOwn",
"./var/indexOf"
], function( jQuery, document, documentElement, hasOwn, indexOf ) {

@@ -32,3 +34,4 @@ /*

var hasDuplicate,
var hasDuplicate, sortInput,
sortStable = jQuery.expando.split( "" ).sort( sortOrder ).join( "" ) === jQuery.expando,
matches = documentElement.matches ||

@@ -38,38 +41,76 @@ documentElement.webkitMatchesSelector ||

documentElement.oMatchesSelector ||
documentElement.msMatchesSelector,
sortOrder = function( a, b ) {
// Flag for duplicate removal
if ( a === b ) {
hasDuplicate = true;
return 0;
documentElement.msMatchesSelector;
function sortOrder( a, b ) {
// Flag for duplicate removal
if ( a === b ) {
hasDuplicate = true;
return 0;
}
// Sort on method existence if only one input has compareDocumentPosition
var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
if ( compare ) {
return compare;
}
// Calculate position if both inputs belong to the same document
compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
a.compareDocumentPosition( b ) :
// Otherwise we know they are disconnected
1;
// Disconnected nodes
if ( compare & 1 ) {
// Choose the first element that is related to our preferred document
if ( a === document || a.ownerDocument === document &&
jQuery.contains( document, a ) ) {
return -1;
}
if ( b === document || b.ownerDocument === document &&
jQuery.contains( document, b ) ) {
return 1;
}
var compare = b.compareDocumentPosition &&
a.compareDocumentPosition &&
a.compareDocumentPosition( b );
// Maintain original order
return sortInput ?
( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
0;
}
if ( compare ) {
// Disconnected nodes
if ( compare & 1 ) {
return compare & 4 ? -1 : 1;
}
// Choose the first element that is related to our document
if ( a === document || jQuery.contains(document, a) ) {
return -1;
}
if ( b === document || jQuery.contains(document, b) ) {
return 1;
}
function uniqueSort( results ) {
var elem,
duplicates = [],
j = 0,
i = 0;
// Maintain original order
return 0;
hasDuplicate = false;
sortInput = !sortStable && results.slice( 0 );
results.sort( sortOrder );
if ( hasDuplicate ) {
while ( ( elem = results[ i++ ] ) ) {
if ( elem === results[ i ] ) {
j = duplicates.push( i );
}
return compare & 4 ? -1 : 1;
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
// Not directly comparable, sort on existence of method
return a.compareDocumentPosition ? -1 : 1;
};
// Clear input after sorting to release objects
// See https://github.com/jquery/sizzle/pull/225
sortInput = null;
jQuery.extend({
return results;
}
jQuery.extend( {
find: function( selector, context, results, seed ) {

@@ -88,3 +129,3 @@ var elem, nodeType,

// Early return if context is not an element or document
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
if ( ( nodeType = context.nodeType ) !== 1 && nodeType !== 9 ) {
return [];

@@ -94,4 +135,4 @@ }

if ( seed ) {
while ( (elem = seed[i++]) ) {
if ( jQuery.find.matchesSelector(elem, selector) ) {
while ( ( elem = seed[ i++ ] ) ) {
if ( jQuery.find.matchesSelector( elem, selector ) ) {
results.push( elem );

@@ -101,3 +142,3 @@ }

} else {
jQuery.merge( results, context.querySelectorAll(selector) );
jQuery.merge( results, context.querySelectorAll( selector ) );
}

@@ -107,24 +148,4 @@

},
unique: function( results ) {
var elem,
duplicates = [],
i = 0,
j = 0;
hasDuplicate = false;
results.sort( sortOrder );
if ( hasDuplicate ) {
while ( (elem = results[i++]) ) {
if ( elem === results[ i ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
},
uniqueSort: uniqueSort,
unique: uniqueSort,
text: function( elem ) {

@@ -137,4 +158,6 @@ var node,

if ( !nodeType ) {
// If no nodeType, this is expected to be an array
while ( (node = elem[i++]) ) {
while ( ( node = elem[ i++ ] ) ) {
// Do not traverse comment nodes

@@ -144,2 +167,3 @@ ret += jQuery.text( node );

} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements

@@ -150,2 +174,3 @@ return elem.textContent;

}
// Do not include comment or processing instruction nodes

@@ -158,6 +183,10 @@

bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) );
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains( bup ) );
},
isXMLDoc: function( elem ) {
return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML";
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && ( elem.ownerDocument || elem ).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
},

@@ -172,3 +201,3 @@ expr: {

}
});
} );

@@ -183,6 +212,12 @@ jQuery.extend( jQuery.find, {

attr: function( elem, name ) {
return elem.getAttribute( name );
var fn = jQuery.expr.attrHandle[ name.toLowerCase() ],
// Don't get fooled by Object.prototype properties (jQuery #13807)
value = fn && hasOwn.call( jQuery.expr.attrHandle, name.toLowerCase() ) ?
fn( elem, name, jQuery.isXMLDoc( elem ) ) :
undefined;
return value !== undefined ? value : elem.getAttribute( name );
}
});
} );
});
} );
define( [
"./core",
"sizzle"
"../external/sizzle/dist/sizzle"
], function( jQuery, Sizzle ) {

@@ -5,0 +5,0 @@

@@ -1,3 +0,3 @@

define(function() {
define( function() {
return [];
});
} );

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc