Commit efbdc6e3 authored by Timmy Willison's avatar Timmy Willison

Release 1.12.0

parent 2c92869b
...@@ -6,10 +6,10 @@ Michael Geary <mike@geary.com> ...@@ -6,10 +6,10 @@ Michael Geary <mike@geary.com>
Stefan Petre <stefan.petre@gmail.com> Stefan Petre <stefan.petre@gmail.com>
Yehuda Katz <wycats@gmail.com> Yehuda Katz <wycats@gmail.com>
Corey Jewett <cj@syntheticplayground.com> Corey Jewett <cj@syntheticplayground.com>
Klaus Hartl <klaus.hartl@gmail.com> Klaus Hartl <klaus.hartl@googlemail.com>
Franck Marcia <franck.marcia@gmail.com> Franck Marcia <franck.marcia@gmail.com>
Jörn Zaefferer <joern.zaefferer@gmail.com> Jörn Zaefferer <joern.zaefferer@gmail.com>
Paul Bakaus <paul.bakaus@gmail.com> Paul Bakaus <paul.bakaus@googlemail.com>
Brandon Aaron <brandon.aaron@gmail.com> Brandon Aaron <brandon.aaron@gmail.com>
Mike Alsup <malsup@gmail.com> Mike Alsup <malsup@gmail.com>
Dave Methvin <dave.methvin@gmail.com> Dave Methvin <dave.methvin@gmail.com>
...@@ -36,7 +36,7 @@ Justin Meyer <justinbmeyer@gmail.com> ...@@ -36,7 +36,7 @@ Justin Meyer <justinbmeyer@gmail.com>
Ben Alman <cowboy@rj3.net> Ben Alman <cowboy@rj3.net>
James Padolsey <cla@padolsey.net> James Padolsey <cla@padolsey.net>
David Petersen <public@petersendidit.com> David Petersen <public@petersendidit.com>
Batiste Bieler <batiste@gmail.com> Batiste Bieler <batiste.bieler@gmail.com>
Alexander Farkas <info@corrupt-system.de> Alexander Farkas <info@corrupt-system.de>
Rick Waldron <waldron.rick@gmail.com> Rick Waldron <waldron.rick@gmail.com>
Filipe Fortes <filipe@fortes.com> Filipe Fortes <filipe@fortes.com>
...@@ -47,7 +47,7 @@ Matt Curry <matt@pseudocoder.com> ...@@ -47,7 +47,7 @@ Matt Curry <matt@pseudocoder.com>
Michael Monteleone <michael@michaelmonteleone.net> Michael Monteleone <michael@michaelmonteleone.net>
Noah Sloan <noah.sloan@gmail.com> Noah Sloan <noah.sloan@gmail.com>
Tom Viner <github@viner.tv> Tom Viner <github@viner.tv>
Douglas Neiner <doug@dougneiner.com> Douglas Neiner <doug@pixelgraphics.us>
Adam J. Sontag <ajpiano@ajpiano.com> Adam J. Sontag <ajpiano@ajpiano.com>
Dave Reed <dareed@microsoft.com> Dave Reed <dareed@microsoft.com>
Ralph Whitbeck <ralph.whitbeck@gmail.com> Ralph Whitbeck <ralph.whitbeck@gmail.com>
...@@ -57,7 +57,7 @@ J. Ryan Stinnett <jryans@gmail.com> ...@@ -57,7 +57,7 @@ J. Ryan Stinnett <jryans@gmail.com>
unknown <Igen005@.upcorp.ad.uprr.com> unknown <Igen005@.upcorp.ad.uprr.com>
temp01 <temp01irc@gmail.com> temp01 <temp01irc@gmail.com>
Heungsub Lee <h@subl.ee> Heungsub Lee <h@subl.ee>
Colin Snover <github.com@zetafleet.com> Colin Snover <colin@alpha.zetafleet.com>
Ryan W Tenney <ryan@10e.us> Ryan W Tenney <ryan@10e.us>
Pinhook <contact@pinhooklabs.com> Pinhook <contact@pinhooklabs.com>
Ron Otten <r.j.g.otten@gmail.com> Ron Otten <r.j.g.otten@gmail.com>
...@@ -69,7 +69,7 @@ Henri Wiechers <hwiechers@gmail.com> ...@@ -69,7 +69,7 @@ Henri Wiechers <hwiechers@gmail.com>
Russell Holbrook <russell.holbrook@patch.com> Russell Holbrook <russell.holbrook@patch.com>
Julian Aubourg <aubourg.julian@gmail.com> Julian Aubourg <aubourg.julian@gmail.com>
Gianni Alessandro Chiappetta <gianni@runlevel6.org> Gianni Alessandro Chiappetta <gianni@runlevel6.org>
Scott Jehl <scottjehl@gmail.com> Scott Jehl <scott@scottjehl.com>
James Burke <jrburke@gmail.com> James Burke <jrburke@gmail.com>
Jonas Pfenniger <jonas@pfenniger.name> Jonas Pfenniger <jonas@pfenniger.name>
Xavi Ramirez <xavi.rmz@gmail.com> Xavi Ramirez <xavi.rmz@gmail.com>
...@@ -78,10 +78,10 @@ Sylvester Keil <sylvester@keil.or.at> ...@@ -78,10 +78,10 @@ Sylvester Keil <sylvester@keil.or.at>
Brandon Sterne <bsterne@mozilla.com> Brandon Sterne <bsterne@mozilla.com>
Mathias Bynens <mathias@qiwi.be> Mathias Bynens <mathias@qiwi.be>
Timmy Willison <timmywillisn@gmail.com> Timmy Willison <timmywillisn@gmail.com>
Corey Frang <gnarf37@gmail.com> Corey Frang <gnarf@gnarf.net>
Digitalxero <digitalxero> Digitalxero <digitalxero>
Anton Kovalyov <anton@kovalyov.net> Anton Kovalyov <anton@kovalyov.net>
David Murdoch <david@davidmurdoch.com> David Murdoch <musicisair@yahoo.com>
Josh Varner <josh.varner@gmail.com> Josh Varner <josh.varner@gmail.com>
Charles McNulty <cmcnulty@kznf.com> Charles McNulty <cmcnulty@kznf.com>
Jordan Boesch <jboesch26@gmail.com> Jordan Boesch <jboesch26@gmail.com>
...@@ -139,7 +139,7 @@ Chris Faulkner <thefaulkner@gmail.com> ...@@ -139,7 +139,7 @@ Chris Faulkner <thefaulkner@gmail.com>
Elijah Manor <elijah.manor@gmail.com> Elijah Manor <elijah.manor@gmail.com>
Daniel Chatfield <chatfielddaniel@gmail.com> Daniel Chatfield <chatfielddaniel@gmail.com>
Nikita Govorov <nikita.govorov@gmail.com> Nikita Govorov <nikita.govorov@gmail.com>
Wesley Walser <waw325@gmail.com> Wesley Walser <wwalser@atlassian.com>
Mike Pennisi <mike@mikepennisi.com> Mike Pennisi <mike@mikepennisi.com>
Markus Staab <markus.staab@redaxo.de> Markus Staab <markus.staab@redaxo.de>
Dave Riddle <david@joyvuu.com> Dave Riddle <david@joyvuu.com>
...@@ -170,8 +170,6 @@ Paul Ramos <paul.b.ramos@gmail.com> ...@@ -170,8 +170,6 @@ Paul Ramos <paul.b.ramos@gmail.com>
Rod Vagg <rod@vagg.org> Rod Vagg <rod@vagg.org>
Bennett Sorbo <bsorbo@gmail.com> Bennett Sorbo <bsorbo@gmail.com>
Sebastian Burkhard <sebi.burkhard@gmail.com> Sebastian Burkhard <sebi.burkhard@gmail.com>
Zachary Adam Kaplan <razic@viralkitty.com>
nanto_vi <nanto@moon.email.ne.jp>
nanto <nanto@moon.email.ne.jp> nanto <nanto@moon.email.ne.jp>
Danil Somsikov <danilasomsikov@gmail.com> Danil Somsikov <danilasomsikov@gmail.com>
Ryunosuke SATO <tricknotes.rs@gmail.com> Ryunosuke SATO <tricknotes.rs@gmail.com>
...@@ -179,70 +177,62 @@ Jean Boussier <jean.boussier@gmail.com> ...@@ -179,70 +177,62 @@ Jean Boussier <jean.boussier@gmail.com>
Adam Coulombe <me@adam.co> Adam Coulombe <me@adam.co>
Andrew Plummer <plummer.andrew@gmail.com> Andrew Plummer <plummer.andrew@gmail.com>
Mark Raddatz <mraddatz@gmail.com> Mark Raddatz <mraddatz@gmail.com>
Isaac Z. Schlueter <i@izs.me>
Karl Sieburg <ksieburg@yahoo.com>
Pascal Borreli <pascal@borreli.com>
Nguyen Phuc Lam <ruado1987@gmail.com>
Dmitry Gusev <dmitry.gusev@gmail.com> Dmitry Gusev <dmitry.gusev@gmail.com>
Michał Gołębiowski <m.goleb@gmail.com> Michał Gołębiowski <m.goleb@gmail.com>
Li Xudong <istonelee@gmail.com> Nguyen Phuc Lam <ruado1987@gmail.com>
Steven Benner <admin@stevenbenner.com>
Tom H Fuertes <tomfuertes@gmail.com> Tom H Fuertes <tomfuertes@gmail.com>
Renato Oliveira dos Santos <ros3@cin.ufpe.br> Brandon Johnson <bjohn465+github@gmail.com>
ros3cin <ros3@cin.ufpe.br>
Jason Bedard <jason+jquery@jbedard.ca> Jason Bedard <jason+jquery@jbedard.ca>
Kyle Robinson Young <kyle@dontkry.com> Kyle Robinson Young <kyle@dontkry.com>
Renato Oliveira dos Santos <ros3@cin.ufpe.br>
Chris Talkington <chris@talkingtontech.com> Chris Talkington <chris@talkingtontech.com>
Eddie Monge <eddie@eddiemonge.com> Eddie Monge <eddie@eddiemonge.com>
Terry Jones <terry@jon.es> Terry Jones <terry@jon.es>
Jason Merino <jasonmerino@gmail.com> Jason Merino <jasonmerino@gmail.com>
Jeremy Dunck <jdunck@gmail.com> Jeremy Dunck <jdunck@gmail.com>
Chris Price <price.c@gmail.com> Chris Price <price.c@gmail.com>
Guy Bedford <guybedford@gmail.com>
Amey Sakhadeo <me@ameyms.com> Amey Sakhadeo <me@ameyms.com>
Mike Sidorov <mikes.ekb@gmail.com>
Anthony Ryan <anthonyryan1@gmail.com> Anthony Ryan <anthonyryan1@gmail.com>
Dominik D. Geyer <dominik.geyer@gmail.com> Dominik D. Geyer <dominik.geyer@gmail.com>
George Kats <katsgeorgeek@gmail.com> George Kats <katsgeorgeek@gmail.com>
Lihan Li <frankieteardrop@gmail.com> Lihan Li <frankieteardrop@gmail.com>
Ronny Springer <springer.ronny@gmail.com> Ronny Springer <springer.ronny@gmail.com>
Chris Antaki <ChrisAntaki@gmail.com>
Marian Sollmann <marian.sollmann@cargomedia.ch> Marian Sollmann <marian.sollmann@cargomedia.ch>
njhamann <njhamann@gmail.com> Corey Frang <gnarf37@gmail.com>
Ilya Kantor <iliakan@gmail.com> Chris Antaki <ChrisAntaki@gmail.com>
Noah Hamann <njhamann@gmail.com>
David Hong <d.hong@me.com> David Hong <d.hong@me.com>
John Paul <john@johnkpaul.com>
Jakob Stoeck <jakob@pokermania.de> Jakob Stoeck <jakob@pokermania.de>
Christopher Jones <chris@cjqed.com> Christopher Jones <christopherjonesqed@gmail.com>
Forbes Lindesay <forbes@lindesay.co.uk> Forbes Lindesay <forbes@lindesay.co.uk>
John Paul <john@johnkpaul.com>
S. Andrew Sheppard <andrew@wq.io> S. Andrew Sheppard <andrew@wq.io>
Leonardo Balter <leonardo.balter@gmail.com> Leonardo Balter <leonardo.balter@gmail.com>
Roman Reiß <me@silverwind.io> Roman Reiß <me@silverwind.io>
Benjy Cui <benjytrys@gmail.com> Benjy Cui <benjytrys@gmail.com>
Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>
John Hoven <hovenj@gmail.com> John Hoven <hovenj@gmail.com>
Philip Jägenstedt <philip@foolip.org>
Christian Kosmowski <ksmwsk@gmail.com> Christian Kosmowski <ksmwsk@gmail.com>
Liang Peng <poppinlp@gmail.com> Liang Peng <poppinlp@gmail.com>
TJ VanToll <tj.vantoll@gmail.com> TJ VanToll <tj.vantoll@gmail.com>
Senya Pugach <upisfree@outlook.com> Senya Pugach <upisfree@outlook.com>
Aurelio De Rosa <aurelioderosa@gmail.com> Aurelio De Rosa <aurelioderosa@gmail.com>
Nazar Mokrynskyi <nazar@mokrynskyi.com> Nazar Mokrynskyi <nazar@mokrynskyi.com>
Amit Merchant <bullredeyes@gmail.com>
Jason Bedard <jason+github@jbedard.ca>
Arthur Verschaeve <contact@arthurverschaeve.be> Arthur Verschaeve <contact@arthurverschaeve.be>
Dan Hart <danhart@notonthehighstreet.com> Dan Hart <danhart@notonthehighstreet.com>
Scott González <scott.gonzalez@gmail.com>
Zheming Sun <mescodasun@gmail.com>
Bin Xin <rhyzix@gmail.com> Bin Xin <rhyzix@gmail.com>
David Corbacho <davidcorbacho@gmail.com> David Corbacho <davidcorbacho@gmail.com>
Veaceslav Grimalschi <grimalschi@yandex.ru> Veaceslav Grimalschi <grimalschi@yandex.ru>
Daniel Husar <dano.husar@gmail.com> Daniel Husar <dano.husar@gmail.com>
Frederic Hemberger <mail@frederic-hemberger.de> Jason Bedard <jason+github@jbedard.ca>
Ben Toews <mastahyeti@gmail.com> Ben Toews <mastahyeti@gmail.com>
Aditya Raghavan <araghavan3@gmail.com> Aditya Raghavan <araghavan3@gmail.com>
Victor Homyakov <vkhomyackov@gmail.com>
Shivaji Varma <contact@shivajivarma.com>
Nicolas HENRY <icewil@gmail.com> Nicolas HENRY <icewil@gmail.com>
Norman Xu <homyu.shinn@gmail.com>
Anne-Gaelle Colom <coloma@westminster.ac.uk> Anne-Gaelle Colom <coloma@westminster.ac.uk>
Victor Homyakov <vkhomyackov@gmail.com>
George Mauer <gmauer@gmail.com> George Mauer <gmauer@gmail.com>
Leonardo Braga <leonardo.braga@gmail.com> Leonardo Braga <leonardo.braga@gmail.com>
Stephen Edgar <stephen@netweb.com.au> Stephen Edgar <stephen@netweb.com.au>
...@@ -256,6 +246,18 @@ Calvin Metcalf <calvin.metcalf@gmail.com> ...@@ -256,6 +246,18 @@ Calvin Metcalf <calvin.metcalf@gmail.com>
Mu Haibao <mhbseal@163.com> Mu Haibao <mhbseal@163.com>
Richard McDaniel <rm0026@uah.edu> Richard McDaniel <rm0026@uah.edu>
Chris Rebert <github@rebertia.com> Chris Rebert <github@rebertia.com>
Gabriel Schulhof <gabriel.schulhof@intel.com>
Gilad Peleg <giladp007@gmail.com> Gilad Peleg <giladp007@gmail.com>
Martin Naumann <martin@geekonaut.de> Martin Naumann <martin@geekonaut.de>
Bruno Pérel <brunoperel@gmail.com>
Reed Loden <reed@reedloden.com>
Daniel Nill <daniellnill@gmail.com>
Yongwoo Jeon <yongwoo.jeon@navercorp.com>
Sean Henderson <seanh.za@gmail.com>
Adrian Olek <adrianolek@gmail.com>
Richard Kraaijenhagen <stdin+git@riichard.com>
Gary Ye <garysye@gmail.com>
Christian Grete <webmaster@christiangrete.com>
Liza Ramo <liza.h.ramo@gmail.com>
Joelle Fleurantin <joasqueeniebee@gmail.com>
Julian Alexander Murillo <julian.alexander.murillo@gmail.com>
Jun Sun <klsforever@gmail.com>
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
"name": "jquery", "name": "jquery",
"title": "jQuery", "title": "jQuery",
"description": "JavaScript library for DOM operations", "description": "JavaScript library for DOM operations",
"version": "3.0.0-alpha1", "version": "1.12.0",
"main": "dist/jquery.js", "main": "dist/jquery.js",
"homepage": "http://jquery.com", "homepage": "http://jquery.com",
"author": { "author": {
"name": "jQuery Foundation and other contributors", "name": "jQuery Foundation and other contributors",
"url": "https://github.com/jquery/jquery/blob/3.0.0-alpha1/AUTHORS.txt" "url": "https://github.com/jquery/jquery/blob/1.12-stable/AUTHORS.txt"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -32,28 +32,25 @@ ...@@ -32,28 +32,25 @@
"grunt-cli": "0.1.13", "grunt-cli": "0.1.13",
"grunt-compare-size": "0.4.0", "grunt-compare-size": "0.4.0",
"grunt-contrib-jshint": "0.11.2", "grunt-contrib-jshint": "0.11.2",
"grunt-contrib-uglify": "0.7.0", "grunt-contrib-uglify": "0.9.2",
"grunt-contrib-watch": "0.6.1", "grunt-contrib-watch": "0.6.1",
"grunt-git-authors": "2.0.1", "grunt-git-authors": "2.0.1",
"grunt-jscs-checker": "0.8.1", "grunt-jscs": "2.1.0",
"grunt-jsonlint": "1.0.4", "grunt-jsonlint": "1.0.4",
"grunt-npmcopy": "0.1.0", "grunt-npmcopy": "0.1.0",
"gzip-js": "0.3.2", "gzip-js": "0.3.2",
"jsdom": "5.6.1",
"load-grunt-tasks": "1.0.0", "load-grunt-tasks": "1.0.0",
"native-promise-only": "0.7.8-a", "npm": "2.1.12",
"promises-aplus-tests": "2.1.0",
"q": "1.1.2",
"qunitjs": "1.17.1", "qunitjs": "1.17.1",
"qunit-assert-step": "1.0.3",
"requirejs": "2.1.17", "requirejs": "2.1.17",
"sinon": "1.10.3", "sinon": "1.12.2",
"sizzle": "2.2.0", "sizzle": "2.2.1",
"strip-json-comments": "1.0.3",
"testswarm": "1.1.0", "testswarm": "1.1.0",
"win-spawn": "2.0.0" "win-spawn": "2.0.0"
}, },
"jsdomVersions": {
"node": "3.1.2",
"iojs": "5.3.0"
},
"scripts": { "scripts": {
"build": "npm install && grunt", "build": "npm install && grunt",
"start": "grunt watch", "start": "grunt watch",
...@@ -72,6 +69,7 @@ ...@@ -72,6 +69,7 @@
"CSS", "CSS",
"Data", "Data",
"Deferred", "Deferred",
"Deprecated",
"Dimensions", "Dimensions",
"Effects", "Effects",
"Event", "Event",
......
...@@ -10,14 +10,21 @@ ...@@ -10,14 +10,21 @@
"undef": true, "undef": true,
"unused": true, "unused": true,
"evil": true,
"sub": true, "sub": true,
// Support: IE < 10, Android < 4.1
// The above browsers are failing a lot of tests in the ES5
// test suite at http://test262.ecmascript.org.
"es3": true,
"globals": { "globals": {
"window": true, "window": true,
"JSON": false,
"jQuery": true, "jQuery": true,
"define": true, "define": false,
"module": true, "module": false,
"noGlobal": true "noGlobal": true
} }
} }
This diff is collapsed.
define([ define( [
"../core", "../core",
"./var/nonce", "./var/nonce",
"./var/rquery", "./var/rquery",
...@@ -9,14 +9,14 @@ var oldCallbacks = [], ...@@ -9,14 +9,14 @@ var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/; rjsonp = /(=)\?(?=&|$)|\?\?/;
// Default jsonp settings // Default jsonp settings
jQuery.ajaxSetup({ jQuery.ajaxSetup( {
jsonp: "callback", jsonp: "callback",
jsonpCallback: function() { jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
this[ callback ] = true; this[ callback ] = true;
return callback; return callback;
} }
}); } );
// Detect, normalize options and install callbacks for jsonp requests // Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
...@@ -26,7 +26,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { ...@@ -26,7 +26,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
"url" : "url" :
typeof s.data === "string" && typeof s.data === "string" &&
( s.contentType || "" ) ( s.contentType || "" )
.indexOf("application/x-www-form-urlencoded") === 0 && .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
rjsonp.test( s.data ) && "data" rjsonp.test( s.data ) && "data"
); );
...@@ -46,7 +46,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { ...@@ -46,7 +46,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
} }
// Use data converter to retrieve json after script execution // Use data converter to retrieve json after script execution
s.converters["script json"] = function() { s.converters[ "script json" ] = function() {
if ( !responseContainer ) { if ( !responseContainer ) {
jQuery.error( callbackName + " was not called" ); jQuery.error( callbackName + " was not called" );
} }
...@@ -63,7 +63,8 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { ...@@ -63,7 +63,8 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
}; };
// Clean-up function (fires after converters) // Clean-up function (fires after converters)
jqXHR.always(function() { jqXHR.always( function() {
// If previous value didn't exist - remove it // If previous value didn't exist - remove it
if ( overwritten === undefined ) { if ( overwritten === undefined ) {
jQuery( window ).removeProp( callbackName ); jQuery( window ).removeProp( callbackName );
...@@ -75,6 +76,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { ...@@ -75,6 +76,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
// Save back as free // Save back as free
if ( s[ callbackName ] ) { if ( s[ callbackName ] ) {
// make sure that re-using the options doesn't screw things around // make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback; s.jsonpCallback = originalSettings.jsonpCallback;
...@@ -88,11 +90,11 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { ...@@ -88,11 +90,11 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
} }
responseContainer = overwritten = undefined; responseContainer = overwritten = undefined;
}); } );
// Delegate to script // Delegate to script
return "script"; return "script";
} }
}); } );
}); } );
define([ define( [
"../core", "../core",
"../core/parseHTML", "../core/parseHTML",
"../ajax", "../ajax",
"../traversing", "../traversing",
"../manipulation", "../manipulation",
"../selector" "../selector",
// Optional event/alias dependency
"../event/alias"
], function( jQuery ) { ], function( jQuery ) {
// Keep a copy of the old load method
var _load = jQuery.fn.load;
/** /**
* Load a url into a page * Load a url into a page
*/ */
jQuery.fn.load = function( url, params, callback ) { jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
var selector, type, response, var selector, type, response,
self = this, self = this,
off = url.indexOf(" "); off = url.indexOf( " " );
if ( off > -1 ) { if ( off > -1 ) {
selector = jQuery.trim( url.slice( off ) ); selector = jQuery.trim( url.slice( off, url.length ) );
url = url.slice( 0, off ); url = url.slice( 0, off );
} }
...@@ -34,7 +44,7 @@ jQuery.fn.load = function( url, params, callback ) { ...@@ -34,7 +44,7 @@ jQuery.fn.load = function( url, params, callback ) {
// If we have elements to modify, make the request // If we have elements to modify, make the request
if ( self.length > 0 ) { if ( self.length > 0 ) {
jQuery.ajax({ jQuery.ajax( {
url: url, url: url,
// If "type" variable is undefined, then "GET" method will be used. // If "type" variable is undefined, then "GET" method will be used.
...@@ -43,7 +53,7 @@ jQuery.fn.load = function( url, params, callback ) { ...@@ -43,7 +53,7 @@ jQuery.fn.load = function( url, params, callback ) {
type: type || "GET", type: type || "GET",
dataType: "html", dataType: "html",
data: params data: params
}).done(function( responseText ) { } ).done( function( responseText ) {
// Save response for use in complete callback // Save response for use in complete callback
response = arguments; response = arguments;
...@@ -52,7 +62,7 @@ jQuery.fn.load = function( url, params, callback ) { ...@@ -52,7 +62,7 @@ jQuery.fn.load = function( url, params, callback ) {
// If a selector was specified, locate the right elements in a dummy div // If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors // Exclude scripts to avoid IE 'Permission Denied' errors
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result // Otherwise use the full result
responseText ); responseText );
...@@ -60,14 +70,14 @@ jQuery.fn.load = function( url, params, callback ) { ...@@ -60,14 +70,14 @@ jQuery.fn.load = function( url, params, callback ) {
// If the request succeeds, this function gets "data", "status", "jqXHR" // If the request succeeds, this function gets "data", "status", "jqXHR"
// but they are ignored because response was set above. // but they are ignored because response was set above.
// If it fails, this function gets "jqXHR", "status", "error" // If it fails, this function gets "jqXHR", "status", "error"
}).always( callback && function( jqXHR, status ) { } ).always( callback && function( jqXHR, status ) {
self.each( function() { self.each( function() {
callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] ); callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] );
}); } );
}); } );
} }
return this; return this;
}; };
}); } );
define([ define( [
"../core" "../core"
], function( jQuery ) { ], function( jQuery ) {
// Support: Android 2.3 var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
// Workaround failure to string-cast null input
jQuery.parseJSON = function( data ) { jQuery.parseJSON = function( data ) {
return JSON.parse( data + "" );
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
// Support: Android 2.3
// Workaround failure to string-cast null input
return window.JSON.parse( data + "" );
}
var requireNonComma,
depth = null,
str = jQuery.trim( data + "" );
// Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
// after removing valid tokens
return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
// Force termination if we see a misplaced comma
if ( requireNonComma && comma ) {
depth = 0;
}
// Perform no more replacements after returning to outermost depth
if ( depth === 0 ) {
return token;
}
// Commas must not follow "[", "{", or ","
requireNonComma = open || comma;
// Determine new depth
// array/object open ("[" or "{"): depth += true - false (increment)
// array/object close ("]" or "}"): depth += false - true (decrement)
// other cases ("," or primitive): depth += true - true (numeric cast)
depth += !close - !open;
// Remove this token
return "";
} ) ) ?
( Function( "return " + str ) )() :
jQuery.error( "Invalid JSON: " + data );
}; };
return jQuery.parseJSON; return jQuery.parseJSON;
}); } );
define([ define( [
"../core" "../core"
], function( jQuery ) { ], function( jQuery ) {
// Cross-browser xml parsing // Cross-browser xml parsing
jQuery.parseXML = function( data ) { jQuery.parseXML = function( data ) {
var xml; var xml, tmp;
if ( !data || typeof data !== "string" ) { if ( !data || typeof data !== "string" ) {
return null; return null;
} }
// Support: IE9
try { try {
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); if ( window.DOMParser ) { // Standard
tmp = new window.DOMParser();
xml = tmp.parseFromString( data, "text/xml" );
} else { // IE
xml = new window.ActiveXObject( "Microsoft.XMLDOM" );
xml.async = "false";
xml.loadXML( data );
}
} catch ( e ) { } catch ( e ) {
xml = undefined; xml = undefined;
} }
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data ); jQuery.error( "Invalid XML: " + data );
} }
return xml; return xml;
...@@ -24,4 +28,4 @@ jQuery.parseXML = function( data ) { ...@@ -24,4 +28,4 @@ jQuery.parseXML = function( data ) {
return jQuery.parseXML; return jQuery.parseXML;
}); } );
define([ define( [
"../core", "../core",
"../var/document", "../var/document",
"../ajax" "../ajax"
], function( jQuery, document ) { ], function( jQuery, document ) {
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) {
if ( s.crossDomain ) {
s.contents.script = false;
}
} );
// Install script dataType // Install script dataType
jQuery.ajaxSetup({ jQuery.ajaxSetup( {
accepts: { accepts: {
script: "text/javascript, application/javascript, " + script: "text/javascript, application/javascript, " +
"application/ecmascript, application/x-ecmascript" "application/ecmascript, application/x-ecmascript"
}, },
contents: { contents: {
script: /(?:java|ecma)script/ script: /\b(?:java|ecma)script\b/
}, },
converters: { converters: {
"text script": function( text ) { "text script": function( text ) {
...@@ -19,49 +26,77 @@ jQuery.ajaxSetup({ ...@@ -19,49 +26,77 @@ jQuery.ajaxSetup({
return text; return text;
} }
} }
}); } );
// Handle cache's special case and crossDomain // Handle cache's special case and global
jQuery.ajaxPrefilter( "script", function( s ) { jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) { if ( s.cache === undefined ) {
s.cache = false; s.cache = false;
} }
if ( s.crossDomain ) { if ( s.crossDomain ) {
s.type = "GET"; s.type = "GET";
s.global = false;
} }
}); } );
// Bind script tag hack transport // Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) { jQuery.ajaxTransport( "script", function( s ) {
// This transport only deals with cross domain requests // This transport only deals with cross domain requests
if ( s.crossDomain ) { if ( s.crossDomain ) {
var script, callback;
var script,
head = document.head || jQuery( "head" )[ 0 ] || document.documentElement;
return { return {
send: function( _, complete ) {
script = jQuery("<script>").prop({ send: function( _, callback ) {
charset: s.scriptCharset,
src: s.url script = document.createElement( "script" );
}).on(
"load error", script.async = true;
callback = function( evt ) {
script.remove(); if ( s.scriptCharset ) {
callback = null; script.charset = s.scriptCharset;
if ( evt ) { }
complete( evt.type === "error" ? 404 : 200, evt.type );
script.src = s.url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Remove the script
if ( script.parentNode ) {
script.parentNode.removeChild( script );
}
// Dereference the script
script = null;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
} }
} }
); };
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
// Use native DOM manipulation to avoid our domManip AJAX trickery // Use native DOM manipulation to avoid our domManip AJAX trickery
document.head.appendChild( script[ 0 ] ); head.insertBefore( script, head.firstChild );
}, },
abort: function() { abort: function() {
if ( callback ) { if ( script ) {
callback(); script.onload( undefined, true );
} }
} }
}; };
} }
}); } );
}); } );
define(function() { define( function() {
return window.location; return window.location;
}); } );
define([ define( [
"../../core" "../../core"
], function( jQuery ) { ], function( jQuery ) {
return jQuery.now(); return jQuery.now();
}); } );
define(function() { define( function() {
return (/\?/); return ( /\?/ );
}); } );
define([ define( [
"../core", "../core",
"../var/document",
"../var/support", "../var/support",
"../ajax" "../ajax"
], function( jQuery, support ) { ], function( jQuery, document, support ) {
jQuery.ajaxSettings.xhr = function() { // Create the request object
try { // (This is still attached to ajaxSettings for backward compatibility)
return new window.XMLHttpRequest(); jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
} catch ( e ) {}
}; // Support: IE6-IE8
function() {
var xhrSuccessStatus = {
// file protocol always yields status code 0, assume 200 // XHR cannot access local files, always use ActiveX for that case
0: 200, if ( this.isLocal ) {
// Support: IE9 return createActiveXHR();
// #1450: sometimes IE returns 1223 when it should be 204 }
1223: 204
}, // Support: IE 9-11
// IE seems to error on cross-domain PATCH requests when ActiveX XHR
// is used. In IE 9+ always use the native XHR.
// Note: this condition won't catch Edge as it doesn't define
// document.documentMode but it also doesn't support ActiveX so it won't
// reach this code.
if ( document.documentMode > 8 ) {
return createStandardXHR();
}
// Support: IE<9
// oldIE XHR does not support non-RFC2616 methods (#13240)
// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
// Although this check for six methods instead of eight
// since IE also does not support "trace" and "connect"
return /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
var xhrId = 0,
xhrCallbacks = {},
xhrSupported = jQuery.ajaxSettings.xhr(); xhrSupported = jQuery.ajaxSettings.xhr();
// Support: IE<10
// Open requests must be manually aborted on unload (#5280)
// See https://support.microsoft.com/kb/2856746 for more info
if ( window.attachEvent ) {
window.attachEvent( "onunload", function() {
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]( undefined, true );
}
} );
}
// Determine support properties
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
support.ajax = xhrSupported = !!xhrSupported; xhrSupported = support.ajax = !!xhrSupported;
jQuery.ajaxTransport(function( options ) { // Create transport if the browser can provide an xhr
var callback; if ( xhrSupported ) {
jQuery.ajaxTransport( function( options ) {
// Cross domain only allowed if supported through XMLHttpRequest // Cross domain only allowed if supported through XMLHttpRequest
if ( support.cors || xhrSupported && !options.crossDomain ) { if ( !options.crossDomain || support.cors ) {
var callback;
return { return {
send: function( headers, complete ) { send: function( headers, complete ) {
var i, var i,
xhr = options.xhr(); xhr = options.xhr(),
id = ++xhrId;
// Open the socket
xhr.open( xhr.open(
options.type, options.type,
options.url, options.url,
...@@ -57,71 +101,129 @@ jQuery.ajaxTransport(function( options ) { ...@@ -57,71 +101,129 @@ jQuery.ajaxTransport(function( options ) {
// akin to a jigsaw puzzle, we simply never set it to be sure. // akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup) // (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided. // For same-domain requests, won't change header if already provided.
if ( !options.crossDomain && !headers["X-Requested-With"] ) { if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
headers["X-Requested-With"] = "XMLHttpRequest"; headers[ "X-Requested-With" ] = "XMLHttpRequest";
} }
// Set headers // Set headers
for ( i in headers ) { for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
// Support: IE<9
// IE's ActiveXObject throws a 'Type Mismatch' exception when setting
// request header to a null-value.
//
// To keep consistent with other XHR implementations, cast the value
// to string and ignore `undefined`.
if ( headers[ i ] !== undefined ) {
xhr.setRequestHeader( i, headers[ i ] + "" );
}
} }
// Callback // Do send the request
callback = function( type ) { // This may raise an exception which is actually
return function() { // handled in jQuery.ajax (so no try/catch here)
if ( callback ) { xhr.send( ( options.hasContent && options.data ) || null );
callback = xhr.onload = xhr.onerror = null;
// Listener
callback = function( _, isAbort ) {
var status, statusText, responses;
if ( type === "abort" ) { // Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Clean up
delete xhrCallbacks[ id ];
callback = undefined;
xhr.onreadystatechange = jQuery.noop;
// Abort manually if needed
if ( isAbort ) {
if ( xhr.readyState !== 4 ) {
xhr.abort(); xhr.abort();
} else if ( type === "error" ) { }
complete(
// file: protocol always yields status 0; see #8605, #14207
xhr.status,
xhr.statusText
);
} else { } else {
complete( responses = {};
xhrSuccessStatus[ xhr.status ] || xhr.status, status = xhr.status;
xhr.statusText,
// Support: IE9 // Support: IE<10
// Accessing binary-data responseText throws an exception // Accessing binary-data responseText throws an exception
// (#11426) // (#11426)
typeof xhr.responseText === "string" ? { if ( typeof xhr.responseText === "string" ) {
text: xhr.responseText responses.text = xhr.responseText;
} : undefined,
xhr.getAllResponseHeaders()
);
} }
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
try {
statusText = xhr.statusText;
} catch ( e ) {
// We normalize with Webkit giving an empty statusText
statusText = "";
} }
};
};
// Listen to events // Filter status for non standard behaviors
xhr.onload = callback();
xhr.onerror = callback("error");
// Create the abort callback // If the request is local and we have data: assume a success
callback = callback("abort"); // (success with no data won't get notified, that's the best we
// can do given current implementations)
if ( !status && options.isLocal && !options.crossDomain ) {
status = responses.text ? 200 : 404;
try { // IE - #1450: sometimes returns 1223 when it should be 204
// Do send the request (this may raise an exception) } else if ( status === 1223 ) {
xhr.send( options.hasContent && options.data || null ); status = 204;
} catch ( e ) { }
// #14683: Only rethrow if this hasn't been notified as an error yet
if ( callback ) {
throw e;
} }
} }
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, xhr.getAllResponseHeaders() );
}
};
// Do send the request
// `xhr.send` may raise an exception, but it will be
// handled in jQuery.ajax (so no try/catch here)
if ( !options.async ) {
// If we're in sync mode we fire the callback
callback();
} else if ( xhr.readyState === 4 ) {
// (IE6 & IE7) if it's in cache and has been
// retrieved directly we need to fire the callback
window.setTimeout( callback );
} else {
// Register the callback, but delay it in case `xhr.send` throws
// Add to the list of active xhr callbacks
xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
}
}, },
abort: function() { abort: function() {
if ( callback ) { if ( callback ) {
callback(); callback( undefined, true );
} }
} }
}; };
} }
}); } );
}
// Functions to create xhrs
function createStandardXHR() {
try {
return new window.XMLHttpRequest();
} catch ( e ) {}
}
function createActiveXHR() {
try {
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
} catch ( e ) {}
}
}); } );
define([ define( [
"./core", "./core",
"./attributes/val",
"./attributes/attr", "./attributes/attr",
"./attributes/prop", "./attributes/prop",
"./attributes/classes", "./attributes/classes"
"./attributes/val"
], function( jQuery ) { ], function( jQuery ) {
// Return jQuery for attributes-only inclusion // Return jQuery for attributes-only inclusion
return jQuery; return jQuery;
}); } );
define([ define( [
"../core", "../core",
"../core/access", "../core/access",
"./support", "./support",
"../var/rnotwhite", "../var/rnotwhite",
"./val",
"../selector" "../selector"
], function( jQuery, access, support, rnotwhite ) { ], function( jQuery, access, support, rnotwhite ) {
var boolHook, var nodeHook, boolHook,
attrHandle = jQuery.expr.attrHandle; attrHandle = jQuery.expr.attrHandle,
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = support.getSetAttribute,
getSetInput = support.input;
jQuery.fn.extend({ jQuery.fn.extend( {
attr: function( name, value ) { attr: function( name, value ) {
return access( this, jQuery.attr, name, value, arguments.length > 1 ); return access( this, jQuery.attr, name, value, arguments.length > 1 );
}, },
removeAttr: function( name ) { removeAttr: function( name ) {
return this.each(function() { return this.each( function() {
jQuery.removeAttr( this, name ); jQuery.removeAttr( this, name );
}); } );
} }
}); } );
jQuery.extend({ jQuery.extend( {
attr: function( elem, name, value ) { attr: function( elem, name, value ) {
var ret, hooks, var ret, hooks,
nType = elem.nodeType; nType = elem.nodeType;
...@@ -41,7 +45,7 @@ jQuery.extend({ ...@@ -41,7 +45,7 @@ jQuery.extend({
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
name = name.toLowerCase(); name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || hooks = jQuery.attrHooks[ name ] ||
( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
} }
if ( value !== undefined ) { if ( value !== undefined ) {
...@@ -74,6 +78,9 @@ jQuery.extend({ ...@@ -74,6 +78,9 @@ jQuery.extend({
set: function( elem, value ) { set: function( elem, value ) {
if ( !support.radioValue && value === "radio" && if ( !support.radioValue && value === "radio" &&
jQuery.nodeName( elem, "input" ) ) { jQuery.nodeName( elem, "input" ) ) {
// Setting the type on a radio button after the value resets the value in IE8-9
// Reset value to default in case type is set after value during creation
var val = elem.value; var val = elem.value;
elem.setAttribute( "type", value ); elem.setAttribute( "type", value );
if ( val ) { if ( val ) {
...@@ -91,40 +98,64 @@ jQuery.extend({ ...@@ -91,40 +98,64 @@ jQuery.extend({
attrNames = value && value.match( rnotwhite ); attrNames = value && value.match( rnotwhite );
if ( attrNames && elem.nodeType === 1 ) { if ( attrNames && elem.nodeType === 1 ) {
while ( ( name = attrNames[i++] ) ) { while ( ( name = attrNames[ i++ ] ) ) {
propName = jQuery.propFix[ name ] || name; propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870) // Boolean attributes get special treatment (#10870)
if ( jQuery.expr.match.bool.test( name ) ) { if ( jQuery.expr.match.bool.test( name ) ) {
// Set corresponding property to false // Set corresponding property to false
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
elem[ propName ] = false;
// Support: IE<9
// Also clear defaultChecked/defaultSelected (if appropriate)
} else {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false; elem[ propName ] = false;
} }
elem.removeAttribute( name ); // See #9699 for explanation of this approach (setting first, then removal)
} else {
jQuery.attr( elem, name, "" );
}
elem.removeAttribute( getSetAttribute ? name : propName );
} }
} }
} }
}); } );
// Hooks for boolean attributes // Hooks for boolean attributes
boolHook = { boolHook = {
set: function( elem, value, name ) { set: function( elem, value, name ) {
if ( value === false ) { if ( value === false ) {
// Remove boolean attributes when set to false // Remove boolean attributes when set to false
jQuery.removeAttr( elem, name ); jQuery.removeAttr( elem, name );
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
// IE<8 needs the *property* name
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
} else { } else {
elem.setAttribute( name, name );
// Support: IE<9
// Use defaultChecked and defaultSelected for oldIE
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
} }
return name; return name;
} }
}; };
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
var getter = attrHandle[ name ] || jQuery.find.attr; var getter = attrHandle[ name ] || jQuery.find.attr;
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
attrHandle[ name ] = function( elem, name, isXML ) { attrHandle[ name ] = function( elem, name, isXML ) {
var ret, handle; var ret, handle;
if ( !isXML ) { if ( !isXML ) {
// Avoid an infinite loop by temporarily removing this function from the getter // Avoid an infinite loop by temporarily removing this function from the getter
handle = attrHandle[ name ]; handle = attrHandle[ name ];
attrHandle[ name ] = ret; attrHandle[ name ] = ret;
...@@ -135,6 +166,116 @@ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) ...@@ -135,6 +166,116 @@ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name )
} }
return ret; return ret;
}; };
}); } else {
attrHandle[ name ] = function( elem, name, isXML ) {
if ( !isXML ) {
return elem[ jQuery.camelCase( "default-" + name ) ] ?
name.toLowerCase() :
null;
}
};
}
} );
// fix oldIE attroperties
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
set: function( elem, value, name ) {
if ( jQuery.nodeName( elem, "input" ) ) {
// Does not return so that setAttribute is also used
elem.defaultValue = value;
} else {
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
return nodeHook && nodeHook.set( elem, value, name );
}
}
};
}
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = {
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
elem.setAttributeNode(
( ret = elem.ownerDocument.createAttribute( name ) )
);
}
ret.value = value += "";
// Break association with cloned elements by also using setAttribute (#9646)
if ( name === "value" || value === elem.getAttribute( name ) ) {
return value;
}
}
};
// Some attributes are constructed with empty-string values when not defined
attrHandle.id = attrHandle.name = attrHandle.coords =
function( elem, name, isXML ) {
var ret;
if ( !isXML ) {
return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ?
ret.value :
null;
}
};
// Fixing value retrieval on a button requires this module
jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
if ( ret && ret.specified ) {
return ret.value;
}
},
set: nodeHook.set
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
set: function( elem, value, name ) {
nodeHook.set( elem, value === "" ? false : value, name );
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each( [ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
};
} );
}
if ( !support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Note: IE uppercases css property names, but if we were to .toLowerCase()
// .cssText, that would destroy case sensitivity in URL's, like in "background"
return elem.style.cssText || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = value + "" );
}
};
}
}); } );
define([ define( [
"../core", "../core",
"../var/rnotwhite", "../var/rnotwhite",
"../data/var/dataPriv",
"../core/init" "../core/init"
], function( jQuery, rnotwhite, dataPriv ) { ], function( jQuery, rnotwhite ) {
var rclass = /[\t\r\n\f]/g; var rclass = /[\t\r\n\f]/g;
function getClass( elem ) { function getClass( elem ) {
return elem.getAttribute && elem.getAttribute( "class" ) || ""; return jQuery.attr( elem, "class" ) || "";
} }
jQuery.fn.extend({ jQuery.fn.extend( {
addClass: function( value ) { addClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue, var classes, elem, cur, curValue, clazz, j, finalValue,
proceed = typeof value === "string" && value, i = 0;
i = 0,
len = this.length;
if ( jQuery.isFunction( value ) ) { if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) { return this.each( function( j ) {
jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
}); } );
} }
if ( proceed ) { if ( typeof value === "string" && value ) {
// The disjunction here is for better compressibility (see removeClass) classes = value.match( rnotwhite ) || [];
classes = ( value || "" ).match( rnotwhite ) || [];
for ( ; i < len; i++ ) { while ( ( elem = this[ i++ ] ) ) {
elem = this[ i ];
curValue = getClass( elem ); curValue = getClass( elem );
cur = elem.nodeType === 1 && cur = elem.nodeType === 1 &&
( " " + curValue + " " ).replace( rclass, " " ); ( " " + curValue + " " ).replace( rclass, " " );
if ( cur ) { if ( cur ) {
j = 0; j = 0;
while ( (clazz = classes[j++]) ) { while ( ( clazz = classes[ j++ ] ) ) {
if ( cur.indexOf( " " + clazz + " " ) < 0 ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " "; cur += clazz + " ";
} }
...@@ -45,7 +40,7 @@ jQuery.fn.extend({ ...@@ -45,7 +40,7 @@ jQuery.fn.extend({
// only assign if different to avoid unneeded rendering. // only assign if different to avoid unneeded rendering.
finalValue = jQuery.trim( cur ); finalValue = jQuery.trim( cur );
if ( curValue !== finalValue ) { if ( curValue !== finalValue ) {
elem.setAttribute( "class", finalValue ); jQuery.attr( elem, "class", finalValue );
} }
} }
} }
...@@ -56,20 +51,22 @@ jQuery.fn.extend({ ...@@ -56,20 +51,22 @@ jQuery.fn.extend({
removeClass: function( value ) { removeClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue, var classes, elem, cur, curValue, clazz, j, finalValue,
proceed = arguments.length === 0 || typeof value === "string" && value, i = 0;
i = 0,
len = this.length;
if ( jQuery.isFunction( value ) ) { if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) { return this.each( function( j ) {
jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
}); } );
} }
if ( proceed ) {
classes = ( value || "" ).match( rnotwhite ) || [];
for ( ; i < len; i++ ) { if ( !arguments.length ) {
elem = this[ i ]; return this.attr( "class", "" );
}
if ( typeof value === "string" && value ) {
classes = value.match( rnotwhite ) || [];
while ( ( elem = this[ i++ ] ) ) {
curValue = getClass( elem ); curValue = getClass( elem );
// This expression is here for better compressibility (see addClass) // This expression is here for better compressibility (see addClass)
...@@ -78,7 +75,8 @@ jQuery.fn.extend({ ...@@ -78,7 +75,8 @@ jQuery.fn.extend({
if ( cur ) { if ( cur ) {
j = 0; j = 0;
while ( (clazz = classes[j++]) ) { while ( ( clazz = classes[ j++ ] ) ) {
// Remove *all* instances // Remove *all* instances
while ( cur.indexOf( " " + clazz + " " ) > -1 ) { while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
cur = cur.replace( " " + clazz + " ", " " ); cur = cur.replace( " " + clazz + " ", " " );
...@@ -86,9 +84,9 @@ jQuery.fn.extend({ ...@@ -86,9 +84,9 @@ jQuery.fn.extend({
} }
// Only assign if different to avoid unneeded rendering. // Only assign if different to avoid unneeded rendering.
finalValue = value ? jQuery.trim( cur ) : ""; finalValue = jQuery.trim( cur );
if ( curValue !== finalValue ) { if ( curValue !== finalValue ) {
elem.setAttribute( "class", finalValue ); jQuery.attr( elem, "class", finalValue );
} }
} }
} }
...@@ -105,15 +103,15 @@ jQuery.fn.extend({ ...@@ -105,15 +103,15 @@ jQuery.fn.extend({
} }
if ( jQuery.isFunction( value ) ) { if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) { return this.each( function( i ) {
jQuery( this ).toggleClass( jQuery( this ).toggleClass(
value.call( this, i, getClass( this ), stateVal ), value.call( this, i, getClass( this ), stateVal ),
stateVal stateVal
); );
}); } );
} }
return this.each(function() { return this.each( function() {
var className, i, self, classNames; var className, i, self, classNames;
if ( type === "string" ) { if ( type === "string" ) {
...@@ -139,31 +137,30 @@ jQuery.fn.extend({ ...@@ -139,31 +137,30 @@ jQuery.fn.extend({
if ( className ) { if ( className ) {
// store className if set // store className if set
dataPriv.set( this, "__className__", className ); jQuery._data( this, "__className__", className );
} }
// If the element has a class name or if we're passed `false`, // If the element has a class name or if we're passed "false",
// then remove the whole classname (if there was one, the above saved it). // then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything), // Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored. // falling back to the empty string if nothing was stored.
if ( this.setAttribute ) { jQuery.attr( this, "class",
this.setAttribute( "class",
className || value === false ? className || value === false ?
"" : "" :
dataPriv.get( this, "__className__" ) || "" jQuery._data( this, "__className__" ) || ""
); );
} }
} } );
});
}, },
hasClass: function( selector ) { hasClass: function( selector ) {
var className = " " + selector + " ", var className, elem,
i = 0, i = 0;
l = this.length;
for ( ; i < l; i++ ) { className = " " + selector + " ";
if ( this[i].nodeType === 1 && while ( ( elem = this[ i++ ] ) ) {
( " " + getClass( this[i] ) + " " ).replace( rclass, " " ) if ( elem.nodeType === 1 &&
( " " + getClass( elem ) + " " ).replace( rclass, " " )
.indexOf( className ) > -1 .indexOf( className ) > -1
) { ) {
return true; return true;
...@@ -172,6 +169,6 @@ jQuery.fn.extend({ ...@@ -172,6 +169,6 @@ jQuery.fn.extend({
return false; return false;
} }
}); } );
}); } );
define([ define( [
"../core", "../core",
"../core/access", "../core/access",
"./support", "./support",
"../selector" "../selector"
], function( jQuery, access, support ) { ], function( jQuery, access, support ) {
var rfocusable = /^(?:input|select|textarea|button)$/i; var rfocusable = /^(?:input|select|textarea|button|object)$/i,
rclickable = /^(?:a|area)$/i;
jQuery.fn.extend({ jQuery.fn.extend( {
prop: function( name, value ) { prop: function( name, value ) {
return access( this, jQuery.prop, name, value, arguments.length > 1 ); return access( this, jQuery.prop, name, value, arguments.length > 1 );
}, },
removeProp: function( name ) { removeProp: function( name ) {
return this.each(function() { name = jQuery.propFix[ name ] || name;
delete this[ jQuery.propFix[ name ] || name ]; return this.each( function() {
});
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch ( e ) {}
} );
} }
}); } );
jQuery.extend({ jQuery.extend( {
prop: function( elem, name, value ) { prop: function( elem, name, value ) {
var ret, hooks, var ret, hooks,
nType = elem.nodeType; nType = elem.nodeType;
...@@ -55,9 +62,18 @@ jQuery.extend({ ...@@ -55,9 +62,18 @@ jQuery.extend({
propHooks: { propHooks: {
tabIndex: { tabIndex: {
get: function( elem ) { get: function( elem ) {
return elem.hasAttribute( "tabindex" ) ||
rfocusable.test( elem.nodeName ) || elem.href ? // elem.tabIndex doesn't always return the
elem.tabIndex : // correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
// Use proper attribute retrieval(#12072)
var tabindex = jQuery.find.attr( elem, "tabindex" );
return tabindex ?
parseInt( tabindex, 10 ) :
rfocusable.test( elem.nodeName ) ||
rclickable.test( elem.nodeName ) && elem.href ?
0 :
-1; -1;
} }
} }
...@@ -67,21 +83,44 @@ jQuery.extend({ ...@@ -67,21 +83,44 @@ jQuery.extend({
"for": "htmlFor", "for": "htmlFor",
"class": "className" "class": "className"
} }
}); } );
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !support.hrefNormalized ) {
// href/src property should get the full normalized URL (#10299/#12915)
jQuery.each( [ "href", "src" ], function( i, name ) {
jQuery.propHooks[ name ] = {
get: function( elem ) {
return elem.getAttribute( name, 4 );
}
};
} );
}
// Support: Safari, IE9+
// mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !support.optSelected ) { if ( !support.optSelected ) {
jQuery.propHooks.selected = { jQuery.propHooks.selected = {
get: function( elem ) { get: function( elem ) {
var parent = elem.parentNode; var parent = elem.parentNode;
if ( parent && parent.parentNode ) {
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex; parent.parentNode.selectedIndex;
} }
}
return null; return null;
} }
}; };
} }
jQuery.each([ jQuery.each( [
"tabIndex", "tabIndex",
"readOnly", "readOnly",
"maxLength", "maxLength",
...@@ -94,6 +133,11 @@ jQuery.each([ ...@@ -94,6 +133,11 @@ jQuery.each([
"contentEditable" "contentEditable"
], function() { ], function() {
jQuery.propFix[ this.toLowerCase() ] = this; jQuery.propFix[ this.toLowerCase() ] = this;
}); } );
// IE6/7 call enctype encoding
if ( !support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
}); } );
define([ define( [
"../var/document", "../var/document",
"../var/support" "../var/support"
], function( document, support ) { ], function( document, support ) {
(function() { ( function() {
var input = document.createElement( "input" ), var a,
input = document.createElement( "input" ),
div = document.createElement( "div" ),
select = document.createElement( "select" ), select = document.createElement( "select" ),
opt = select.appendChild( document.createElement( "option" ) ); opt = select.appendChild( document.createElement( "option" ) );
input.type = "checkbox"; // Setup
div = document.createElement( "div" );
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
a = div.getElementsByTagName( "a" )[ 0 ];
// Support: Android<4.4 // Support: Windows Web Apps (WWA)
// Default value for a checkbox should be "on" // `type` must use .setAttribute for WWA (#14901)
support.checkOn = input.value !== ""; input.setAttribute( "type", "checkbox" );
div.appendChild( input );
// Support: IE<=11+ a = div.getElementsByTagName( "a" )[ 0 ];
// Must access selectedIndex to make default options select
// First batch of tests.
a.style.cssText = "top:1px";
// Test setAttribute on camelCase class.
// If it works, we need attrFixes when doing get/setAttribute (ie6/7)
support.getSetAttribute = div.className !== "t";
// Get the style information from getAttribute
// (IE uses .cssText instead)
support.style = /top/.test( a.getAttribute( "style" ) );
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
support.hrefNormalized = a.getAttribute( "href" ) === "/a";
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
support.checkOn = !!input.value;
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
support.optSelected = opt.selected; support.optSelected = opt.selected;
// Support: Android<=2.3 // Tests for enctype support on a form (#6743)
// Options inside disabled selects are incorrectly marked as disabled support.enctype = !!document.createElement( "form" ).enctype;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true; select.disabled = true;
support.optDisabled = !opt.disabled; support.optDisabled = !opt.disabled;
// Support: IE<=11+ // Support: IE8 only
// An input loses its value after becoming a radio // Check if we can trust getAttribute("value")
input = document.createElement( "input" ); input = document.createElement( "input" );
input.setAttribute( "value", "" );
support.input = input.getAttribute( "value" ) === "";
// Check if an input maintains its value after becoming a radio
input.value = "t"; input.value = "t";
input.type = "radio"; input.setAttribute( "type", "radio" );
support.radioValue = input.value === "t"; support.radioValue = input.value === "t";
})(); } )();
return support; return support;
}); } );
define([ define( [
"../core", "../core",
"./support", "./support",
"../core/init" "../core/init"
...@@ -6,26 +6,32 @@ define([ ...@@ -6,26 +6,32 @@ define([
var rreturn = /\r/g; var rreturn = /\r/g;
jQuery.fn.extend({ jQuery.fn.extend( {
val: function( value ) { val: function( value ) {
var hooks, ret, isFunction, var hooks, ret, isFunction,
elem = this[0]; elem = this[ 0 ];
if ( !arguments.length ) { if ( !arguments.length ) {
if ( elem ) { if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || hooks = jQuery.valHooks[ elem.type ] ||
jQuery.valHooks[ elem.nodeName.toLowerCase() ]; jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { if (
hooks &&
"get" in hooks &&
( ret = hooks.get( elem, "value" ) ) !== undefined
) {
return ret; return ret;
} }
ret = elem.value; ret = elem.value;
return typeof ret === "string" ? return typeof ret === "string" ?
// Handle most common string cases
ret.replace(rreturn, "") : // handle most common string cases
// Handle cases where value is null/undef or number ret.replace( rreturn, "" ) :
// handle cases where value is null/undef or number
ret == null ? "" : ret; ret == null ? "" : ret;
} }
...@@ -34,7 +40,7 @@ jQuery.fn.extend({ ...@@ -34,7 +40,7 @@ jQuery.fn.extend({
isFunction = jQuery.isFunction( value ); isFunction = jQuery.isFunction( value );
return this.each(function( i ) { return this.each( function( i ) {
var val; var val;
if ( this.nodeType !== 1 ) { if ( this.nodeType !== 1 ) {
...@@ -50,33 +56,35 @@ jQuery.fn.extend({ ...@@ -50,33 +56,35 @@ jQuery.fn.extend({
// Treat null/undefined as ""; convert numbers to string // Treat null/undefined as ""; convert numbers to string
if ( val == null ) { if ( val == null ) {
val = ""; val = "";
} else if ( typeof val === "number" ) { } else if ( typeof val === "number" ) {
val += ""; val += "";
} else if ( jQuery.isArray( val ) ) { } else if ( jQuery.isArray( val ) ) {
val = jQuery.map( val, function( value ) { val = jQuery.map( val, function( value ) {
return value == null ? "" : value + ""; return value == null ? "" : value + "";
}); } );
} }
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting // If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val; this.value = val;
} }
}); } );
} }
}); } );
jQuery.extend({ jQuery.extend( {
valHooks: { valHooks: {
option: { option: {
get: function( elem ) { get: function( elem ) {
// Support: IE<11 var val = jQuery.find.attr( elem, "value" );
// option.value not trimmed (#14858) return val != null ?
return jQuery.trim( elem.value ); val :
// Support: IE10-11+
// option.text throws exceptions (#14686, #14858)
jQuery.trim( jQuery.text( elem ) );
} }
}, },
select: { select: {
...@@ -95,11 +103,13 @@ jQuery.extend({ ...@@ -95,11 +103,13 @@ jQuery.extend({
for ( ; i < max; i++ ) { for ( ; i < max; i++ ) {
option = options[ i ]; option = options[ i ];
// IE8-9 doesn't update selected after form reset (#2551) // oldIE doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) && if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup // Don't return options that are disabled or in a disabled optgroup
( support.optDisabled ? ( support.optDisabled ?
!option.disabled : option.getAttribute( "disabled" ) === null ) && !option.disabled :
option.getAttribute( "disabled" ) === null ) &&
( !option.parentNode.disabled || ( !option.parentNode.disabled ||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
...@@ -127,9 +137,24 @@ jQuery.extend({ ...@@ -127,9 +137,24 @@ jQuery.extend({
while ( i-- ) { while ( i-- ) {
option = options[ i ]; option = options[ i ];
if ( (option.selected =
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1) ) { if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
optionSet = true;
// Support: IE6
// When new option element is added to select box we need to
// force reflow of newly added node in order to workaround delay
// of initialization properties
try {
option.selected = optionSet = true;
} catch ( _ ) {
// Will be executed only in IE6
option.scrollHeight;
}
} else {
option.selected = false;
} }
} }
...@@ -137,26 +162,27 @@ jQuery.extend({ ...@@ -137,26 +162,27 @@ jQuery.extend({
if ( !optionSet ) { if ( !optionSet ) {
elem.selectedIndex = -1; elem.selectedIndex = -1;
} }
return values;
return options;
} }
} }
} }
}); } );
// Radios and checkboxes getter/setter // Radios and checkboxes getter/setter
jQuery.each([ "radio", "checkbox" ], function() { jQuery.each( [ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = { jQuery.valHooks[ this ] = {
set: function( elem, value ) { set: function( elem, value ) {
if ( jQuery.isArray( value ) ) { if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) > -1 ); return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
} }
} }
}; };
if ( !support.checkOn ) { if ( !support.checkOn ) {
jQuery.valHooks[ this ].get = function( elem ) { jQuery.valHooks[ this ].get = function( elem ) {
return elem.getAttribute("value") === null ? "on" : elem.value; return elem.getAttribute( "value" ) === null ? "on" : elem.value;
}; };
} }
}); } );
}); } );
define([ define( [
"./core", "./core",
"./var/rnotwhite" "./var/rnotwhite"
], function( jQuery, rnotwhite ) { ], function( jQuery, rnotwhite ) {
...@@ -8,7 +8,7 @@ function createOptions( options ) { ...@@ -8,7 +8,7 @@ function createOptions( options ) {
var object = {}; var object = {};
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true; object[ flag ] = true;
}); } );
return object; return object;
} }
...@@ -44,18 +44,25 @@ jQuery.Callbacks = function( options ) { ...@@ -44,18 +44,25 @@ jQuery.Callbacks = function( options ) {
var // Flag to know if list is currently firing var // Flag to know if list is currently firing
firing, firing,
// Last fire value for non-forgettable lists // Last fire value for non-forgettable lists
memory, memory,
// Flag to know if list was already fired // Flag to know if list was already fired
fired, fired,
// Flag to prevent firing // Flag to prevent firing
locked, locked,
// Actual callback list // Actual callback list
list = [], list = [],
// Queue of execution data for repeatable lists // Queue of execution data for repeatable lists
queue = [], queue = [],
// Index of currently firing callback (modified by add/remove as needed) // Index of currently firing callback (modified by add/remove as needed)
firingIndex = -1, firingIndex = -1,
// Fire callbacks // Fire callbacks
fire = function() { fire = function() {
...@@ -114,18 +121,19 @@ jQuery.Callbacks = function( options ) { ...@@ -114,18 +121,19 @@ jQuery.Callbacks = function( options ) {
queue.push( memory ); queue.push( memory );
} }
(function add( args ) { ( function add( args ) {
jQuery.each( args, function( _, arg ) { jQuery.each( args, function( _, arg ) {
if ( jQuery.isFunction( arg ) ) { if ( jQuery.isFunction( arg ) ) {
if ( !options.unique || !self.has( arg ) ) { if ( !options.unique || !self.has( arg ) ) {
list.push( arg ); list.push( arg );
} }
} else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
// Inspect recursively // Inspect recursively
add( arg ); add( arg );
} }
}); } );
})( arguments ); } )( arguments );
if ( memory && !firing ) { if ( memory && !firing ) {
fire(); fire();
...@@ -146,7 +154,7 @@ jQuery.Callbacks = function( options ) { ...@@ -146,7 +154,7 @@ jQuery.Callbacks = function( options ) {
firingIndex--; firingIndex--;
} }
} }
}); } );
return this; return this;
}, },
...@@ -182,9 +190,9 @@ jQuery.Callbacks = function( options ) { ...@@ -182,9 +190,9 @@ jQuery.Callbacks = function( options ) {
// Also disable .add unless we have memory (since it would have no effect) // Also disable .add unless we have memory (since it would have no effect)
// Abort any pending executions // Abort any pending executions
lock: function() { lock: function() {
locked = queue = []; locked = true;
if ( !memory && !firing ) { if ( !memory ) {
list = memory = ""; self.disable();
} }
return this; return this;
}, },
...@@ -221,4 +229,4 @@ jQuery.Callbacks = function( options ) { ...@@ -221,4 +229,4 @@ jQuery.Callbacks = function( options ) {
}; };
return jQuery; return jQuery;
}); } );
This diff is collapsed.
define([ define( [
"../core" "../core"
], function( jQuery ) { ], function( jQuery ) {
// Multifunctional method to get and set values of a collection // Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function // 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 access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0, var i = 0,
len = elems.length, length = elems.length,
bulk = key == null; bulk = key == null;
// Sets many values // Sets many values
if ( jQuery.type( key ) === "object" ) { if ( jQuery.type( key ) === "object" ) {
chainable = true; chainable = true;
for ( i in key ) { for ( i in key ) {
access( elems, fn, i, key[i], true, emptyGet, raw ); access( elems, fn, i, key[ i ], true, emptyGet, raw );
} }
// Sets one value // Sets one value
...@@ -25,6 +25,7 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe ...@@ -25,6 +25,7 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe
} }
if ( bulk ) { if ( bulk ) {
// Bulk operations run against the entire set // Bulk operations run against the entire set
if ( raw ) { if ( raw ) {
fn.call( elems, value ); fn.call( elems, value );
...@@ -40,8 +41,12 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe ...@@ -40,8 +41,12 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe
} }
if ( fn ) { if ( fn ) {
for ( ; i < len; i++ ) { for ( ; i < length; i++ ) {
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); fn(
elems[ i ],
key,
raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
);
} }
} }
} }
...@@ -52,9 +57,9 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe ...@@ -52,9 +57,9 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe
// Gets // Gets
bulk ? bulk ?
fn.call( elems ) : fn.call( elems ) :
len ? fn( elems[0], key ) : emptyGet; length ? fn( elems[ 0 ], key ) : emptyGet;
}; };
return access; return access;
}); } );
// Initialize a jQuery object // Initialize a jQuery object
define([ define( [
"../core", "../core",
"../var/document", "../var/document",
"./var/rsingleTag", "./var/rsingleTag",
...@@ -12,8 +12,7 @@ var rootjQuery, ...@@ -12,8 +12,7 @@ var rootjQuery,
// A simple way to check for HTML strings // A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <) // Strict HTML recognition (#11290: must start with <)
// Shortcut simple #id case for speed rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
init = jQuery.fn.init = function( selector, context, root ) { init = jQuery.fn.init = function( selector, context, root ) {
var match, elem; var match, elem;
...@@ -29,8 +28,8 @@ var rootjQuery, ...@@ -29,8 +28,8 @@ var rootjQuery,
// Handle HTML strings // Handle HTML strings
if ( typeof selector === "string" ) { if ( typeof selector === "string" ) {
if ( selector[0] === "<" && if ( selector.charAt( 0 ) === "<" &&
selector[ selector.length - 1 ] === ">" && selector.charAt( selector.length - 1 ) === ">" &&
selector.length >= 3 ) { selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check // Assume that strings that start and end with <> are HTML and skip the regex check
...@@ -41,23 +40,24 @@ var rootjQuery, ...@@ -41,23 +40,24 @@ var rootjQuery,
} }
// Match html or make sure no context is specified for #id // Match html or make sure no context is specified for #id
if ( match && (match[1] || !context) ) { if ( match && ( match[ 1 ] || !context ) ) {
// HANDLE: $(html) -> $(array) // HANDLE: $(html) -> $(array)
if ( match[1] ) { if ( match[ 1 ] ) {
context = context instanceof jQuery ? context[0] : context; context = context instanceof jQuery ? context[ 0 ] : context;
// Option to run scripts is true for back-compat // scripts is true for back-compat
// Intentionally let the error be thrown if parseHTML is not present // Intentionally let the error be thrown if parseHTML is not present
jQuery.merge( this, jQuery.parseHTML( jQuery.merge( this, jQuery.parseHTML(
match[1], match[ 1 ],
context && context.nodeType ? context.ownerDocument || context : document, context && context.nodeType ? context.ownerDocument || context : document,
true true
) ); ) );
// HANDLE: $(html, props) // HANDLE: $(html, props)
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
for ( match in context ) { for ( match in context ) {
// Properties of context are called as methods if possible // Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) { if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] ); this[ match ]( context[ match ] );
...@@ -73,13 +73,25 @@ var rootjQuery, ...@@ -73,13 +73,25 @@ var rootjQuery,
// HANDLE: $(#id) // HANDLE: $(#id)
} else { } else {
elem = document.getElementById( match[2] ); elem = document.getElementById( match[ 2 ] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[ 2 ] ) {
return rootjQuery.find( selector );
}
if ( elem ) { // Otherwise, we inject the element directly into the jQuery object
// Inject the element directly into the jQuery object
this[0] = elem;
this.length = 1; this.length = 1;
this[ 0 ] = elem;
} }
this.context = document;
this.selector = selector;
return this; return this;
} }
...@@ -95,19 +107,25 @@ var rootjQuery, ...@@ -95,19 +107,25 @@ var rootjQuery,
// HANDLE: $(DOMElement) // HANDLE: $(DOMElement)
} else if ( selector.nodeType ) { } else if ( selector.nodeType ) {
this[0] = selector; this.context = this[ 0 ] = selector;
this.length = 1; this.length = 1;
return this; return this;
// HANDLE: $(function) // HANDLE: $(function)
// Shortcut for document ready // Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) { } else if ( jQuery.isFunction( selector ) ) {
return root.ready !== undefined ? return typeof root.ready !== "undefined" ?
root.ready( selector ) : root.ready( selector ) :
// Execute immediately if ready is not present // Execute immediately if ready is not present
selector( jQuery ); selector( jQuery );
} }
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this ); return jQuery.makeArray( selector, this );
}; };
...@@ -119,4 +137,4 @@ rootjQuery = jQuery( document ); ...@@ -119,4 +137,4 @@ rootjQuery = jQuery( document );
return init; return init;
}); } );
define([ define( [
"../core", "../core",
"../var/document", "../var/document",
"./var/rsingleTag", "./var/rsingleTag",
...@@ -13,13 +13,14 @@ define([ ...@@ -13,13 +13,14 @@ define([
// defaults to document // 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 ( typeof data !== "string" ) { if ( !data || typeof data !== "string" ) {
return []; return null;
} }
if ( typeof context === "boolean" ) { if ( typeof context === "boolean" ) {
keepScripts = context; keepScripts = context;
context = false; context = false;
} }
// document.implementation stops scripts or inline event handlers from // document.implementation stops scripts or inline event handlers from
// being executed immediately // being executed immediately
context = context || ( support.createHTMLDocument ? context = context || ( support.createHTMLDocument ?
...@@ -31,7 +32,7 @@ jQuery.parseHTML = function( data, context, keepScripts ) { ...@@ -31,7 +32,7 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
// Single tag // Single tag
if ( parsed ) { if ( parsed ) {
return [ context.createElement( parsed[1] ) ]; return [ context.createElement( parsed[ 1 ] ) ];
} }
parsed = buildFragment( [ data ], context, scripts ); parsed = buildFragment( [ data ], context, scripts );
...@@ -45,4 +46,4 @@ jQuery.parseHTML = function( data, context, keepScripts ) { ...@@ -45,4 +46,4 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
return jQuery.parseHTML; return jQuery.parseHTML;
}); } );
define([ define( [
"../core", "../core",
"../var/document", "../var/document",
"../core/init",
"../deferred" "../deferred"
], function( jQuery, document ) { ], function( jQuery, document ) {
...@@ -8,13 +9,15 @@ define([ ...@@ -8,13 +9,15 @@ define([
var readyList; var readyList;
jQuery.fn.ready = function( fn ) { jQuery.fn.ready = function( fn ) {
// Add the callback // Add the callback
jQuery.ready.promise().done( fn ); jQuery.ready.promise().done( fn );
return this; return this;
}; };
jQuery.extend({ jQuery.extend( {
// Is the DOM ready to be used? Set to true once it occurs. // Is the DOM ready to be used? Set to true once it occurs.
isReady: false, isReady: false,
...@@ -49,16 +52,42 @@ jQuery.extend({ ...@@ -49,16 +52,42 @@ jQuery.extend({
// If there are functions bound, to execute // If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] ); readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.triggerHandler ) {
jQuery( document ).triggerHandler( "ready" );
jQuery( document ).off( "ready" );
} }
}); }
} );
/** /**
* The ready event handler and self cleanup method * Clean-up method for dom ready events
*/ */
function completed() { function detach() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed ); document.removeEventListener( "DOMContentLoaded", completed );
window.removeEventListener( "load", completed ); window.removeEventListener( "load", completed );
} else {
document.detachEvent( "onreadystatechange", completed );
window.detachEvent( "onload", completed );
}
}
/**
* The ready event handler and self cleanup method
*/
function completed() {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( document.addEventListener ||
window.event.type === "load" ||
document.readyState === "complete" ) {
detach();
jQuery.ready(); jQuery.ready();
}
} }
jQuery.ready.promise = function( obj ) { jQuery.ready.promise = function( obj ) {
...@@ -68,20 +97,62 @@ jQuery.ready.promise = function( obj ) { ...@@ -68,20 +97,62 @@ jQuery.ready.promise = function( obj ) {
// Catch cases where $(document).ready() is called // Catch cases where $(document).ready() is called
// after the browser event has already occurred. // after the browser event has already occurred.
// We once tried to use readyState "interactive" here, // we once tried to use readyState "interactive" here,
// but it caused issues like the one // but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 // discovered by ChrisS here:
// http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) { if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready // Handle it asynchronously to allow scripts the opportunity to delay ready
window.setTimeout( jQuery.ready ); window.setTimeout( jQuery.ready );
} else { // Standards-based browsers support DOMContentLoaded
} else if ( document.addEventListener ) {
// Use the handy event callback // Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed ); document.addEventListener( "DOMContentLoaded", completed );
// A fallback to window.onload, that will always work // A fallback to window.onload, that will always work
window.addEventListener( "load", completed ); window.addEventListener( "load", completed );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", completed );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", completed );
// If IE and not a frame
// continually check to see if the document is ready
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch ( e ) {}
if ( top && top.doScroll ) {
( function doScrollCheck() {
if ( !jQuery.isReady ) {
try {
// Use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
top.doScroll( "left" );
} catch ( e ) {
return window.setTimeout( doScrollCheck, 50 );
}
// detach all dom ready events
detach();
// and execute any waiting functions
jQuery.ready();
}
} )();
}
} }
} }
return readyList.promise( obj ); return readyList.promise( obj );
...@@ -90,4 +161,4 @@ jQuery.ready.promise = function( obj ) { ...@@ -90,4 +161,4 @@ jQuery.ready.promise = function( obj ) {
// Kick off the DOM ready check even if the user does not // Kick off the DOM ready check even if the user does not
jQuery.ready.promise(); jQuery.ready.promise();
}); } );
define([ define( [
"../var/document", "../var/document",
"../var/support" "../var/support"
], function( document, support ) { ], function( document, support ) {
support.createHTMLDocument = (function() { // Support: Safari 8+
var body = document.implementation.createHTMLDocument( "" ).body; // In Safari 8 documents created via document.implementation.createHTMLDocument
body.innerHTML = "<form></form><form></form>"; // collapse sibling forms: the second one becomes a child of the first one.
return body.childNodes.length === 2; // Because of that, this security measure has to be disabled in Safari 8.
})(); // https://bugs.webkit.org/show_bug.cgi?id=137337
support.createHTMLDocument = ( function() {
if ( !document.implementation.createHTMLDocument ) {
return false;
}
var doc = document.implementation.createHTMLDocument( "" );
doc.body.innerHTML = "<form></form><form></form>";
return doc.body.childNodes.length === 2;
} )();
return support; return support;
}); } );
define(function() { define( function() {
// Match a standalone tag // Match a standalone tag
return (/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/); return ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
}); } );
This diff is collapsed.
define(function() { define( function() {
function addGetHookIf( conditionFn, hookFn ) { function addGetHookIf( conditionFn, hookFn ) {
// Define the hook, we'll check on the first run if it's really needed. // Define the hook, we'll check on the first run if it's really needed.
return { return {
get: function() { get: function() {
if ( conditionFn() ) { if ( conditionFn() ) {
// Hook not needed (or it's not possible to use it due // Hook not needed (or it's not possible to use it due
// to missing dependency), remove it. // to missing dependency), remove it.
delete this.get; delete this.get;
...@@ -12,11 +14,11 @@ function addGetHookIf( conditionFn, hookFn ) { ...@@ -12,11 +14,11 @@ function addGetHookIf( conditionFn, hookFn ) {
} }
// Hook needed; redefine it so that the support test is not executed again. // Hook needed; redefine it so that the support test is not executed again.
return (this.get = hookFn).apply( this, arguments ); return ( this.get = hookFn ).apply( this, arguments );
} }
}; };
} }
return addGetHookIf; return addGetHookIf;
}); } );
define([ define( [
"../core", "../core",
"../var/rcssNum" "../var/rcssNum"
], function( jQuery, rcssNum ) { ], function( jQuery, rcssNum ) {
...@@ -12,11 +12,13 @@ function adjustCSS( elem, prop, valueParts, tween ) { ...@@ -12,11 +12,13 @@ function adjustCSS( elem, prop, valueParts, tween ) {
function() { return jQuery.css( elem, prop, "" ); }, function() { return jQuery.css( elem, prop, "" ); },
initial = currentValue(), initial = currentValue(),
unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
// Starting value computation is required for potential unit mismatches // Starting value computation is required for potential unit mismatches
initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
rcssNum.exec( jQuery.css( elem, prop ) ); rcssNum.exec( jQuery.css( elem, prop ) );
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
// Trust units reported by jQuery.css // Trust units reported by jQuery.css
unit = unit || initialInUnit[ 3 ]; unit = unit || initialInUnit[ 3 ];
...@@ -27,6 +29,7 @@ function adjustCSS( elem, prop, valueParts, tween ) { ...@@ -27,6 +29,7 @@ function adjustCSS( elem, prop, valueParts, tween ) {
initialInUnit = +initial || 1; initialInUnit = +initial || 1;
do { do {
// If previous iteration zeroed out, double until we get *something*. // If previous iteration zeroed out, double until we get *something*.
// Use string for doubling so we don't accidentally see scale as unchanged below // Use string for doubling so we don't accidentally see scale as unchanged below
scale = scale || ".5"; scale = scale || ".5";
...@@ -38,12 +41,13 @@ function adjustCSS( elem, prop, valueParts, tween ) { ...@@ -38,12 +41,13 @@ function adjustCSS( elem, prop, valueParts, tween ) {
// Update scale, tolerating zero or NaN from tween.cur() // Update scale, tolerating zero or NaN from tween.cur()
// Break the loop if scale is unchanged or perfect, or if we've just had enough. // Break the loop if scale is unchanged or perfect, or if we've just had enough.
} while ( } while (
scale !== (scale = currentValue() / initial) && scale !== 1 && --maxIterations scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
); );
} }
if ( valueParts ) { if ( valueParts ) {
initialInUnit = +initialInUnit || +initial || 0; initialInUnit = +initialInUnit || +initial || 0;
// Apply relative offset (+=/-=) if specified // Apply relative offset (+=/-=) if specified
adjusted = valueParts[ 1 ] ? adjusted = valueParts[ 1 ] ?
initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
...@@ -58,4 +62,4 @@ function adjustCSS( elem, prop, valueParts, tween ) { ...@@ -58,4 +62,4 @@ function adjustCSS( elem, prop, valueParts, tween ) {
} }
return adjustCSS; return adjustCSS;
}); } );
define([ define( [
"exports",
"../core", "../core",
"../var/documentElement",
"./var/rnumnonpx", "./var/rnumnonpx",
"./var/rmargin", "./var/rmargin",
"./var/getStyles",
"./support", "./support",
"../selector" // contains "../selector" // contains
], function( jQuery, rnumnonpx, rmargin, getStyles, support ) { ], function( exports, jQuery, documentElement, rnumnonpx, rmargin, support ) {
function curCSS( elem, name, computed ) { var getStyles, curCSS,
rposition = /^(top|right|bottom|left)$/;
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
var view = elem.ownerDocument.defaultView;
if ( !view.opener ) {
view = window;
}
return view.getComputedStyle( elem );
};
curCSS = function( elem, name, computed ) {
var width, minWidth, maxWidth, ret, var width, minWidth, maxWidth, ret,
style = elem.style; style = elem.style;
computed = computed || getStyles( elem ); computed = computed || getStyles( elem );
// Support: IE9 // getPropertyValue is only needed for .css('filter') in IE9, see #12537
// getPropertyValue is only needed for .css('filter') (#12537) ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
if ( computed ) { if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name ); ret = jQuery.style( elem, name );
} }
// A tribute to the "awesome hack by Dean Edwards" // A tribute to the "awesome hack by Dean Edwards"
// Android Browser returns percentage for some values, // Chrome < 17 and Safari 5.0 uses "computed value"
// but width seems to be reliably pixels. // instead of "used value" for margin-right
// This is against the CSSOM draft spec: // Safari 5.1.7 (at least) returns percentage for a larger set of values,
// but width seems to be reliably pixels
// this is against the CSSOM draft spec:
// http://dev.w3.org/csswg/cssom/#resolved-values // http://dev.w3.org/csswg/cssom/#resolved-values
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
...@@ -45,12 +66,69 @@ function curCSS( elem, name, computed ) { ...@@ -45,12 +66,69 @@ function curCSS( elem, name, computed ) {
} }
} }
return ret !== undefined ? // Support: IE
// Support: IE9-11+
// IE returns zIndex value as an integer. // IE returns zIndex value as an integer.
ret + "" : return ret === undefined ?
ret; ret :
ret + "";
};
} else if ( documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, computed ) {
var left, rs, rsLeft, ret,
style = elem.style;
computed = computed || getStyles( elem );
ret = computed ? computed[ name ] : undefined;
// Avoid setting ret to empty string here
// so we don't default to auto
if ( ret == null && style && style[ name ] ) {
ret = style[ name ];
}
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// but not position css attributes, as those are
// proportional to the parent element instead
// and we can't measure the parent instead because it
// might trigger a "stacking dolls" problem
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
// Remember the original values
left = style.left;
rs = elem.runtimeStyle;
rsLeft = rs && rs.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
rs.left = elem.currentStyle.left;
}
style.left = name === "fontSize" ? "1em" : ret;
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
if ( rsLeft ) {
rs.left = rsLeft;
}
}
// Support: IE
// IE returns zIndex value as an integer.
return ret === undefined ?
ret :
ret + "" || "auto";
};
} }
return curCSS; exports.getStyles = getStyles;
}); exports.curCSS = curCSS;
} );
define( [
"../core",
"../var/document",
"../manipulation" // appendTo
], function( jQuery, document ) {
var iframe,
elemdisplay = {
// Support: Firefox
// We have to pre-define these values for FF (#10227)
HTML: "block",
BODY: "block"
};
/**
* Retrieve the actual display of a element
* @param {String} name nodeName of the element
* @param {Object} doc Document object
*/
// Called only from within defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[ 0 ], "display" );
// We don't have any data stored on the element,
// so use "detach" method as fast way to get rid of the element
elem.detach();
return display;
}
/**
* Try to determine the default display value of an element
* @param {String} nodeName
*/
function defaultDisplay( nodeName ) {
var doc = document,
display = elemdisplay[ nodeName ];
if ( !display ) {
display = actualDisplay( nodeName, doc );
// If the simple way fails, read from inside an iframe
if ( display === "none" || !display ) {
// Use the already-created iframe if possible
iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
.appendTo( doc.documentElement );
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
// Support: IE
doc.write();
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
return defaultDisplay;
} );
define([ define( [
"../core", "../core",
"../selector" "./support",
], function( jQuery ) { "../selector",
"../css"
], function( jQuery, support ) {
function getDisplay( elem ) {
return elem.style && elem.style.display || jQuery.css( elem, "display" );
}
function filterHidden( elem ) {
while ( elem && elem.nodeType === 1 ) {
if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
return true;
}
elem = elem.parentNode;
}
return false;
}
jQuery.expr.filters.hidden = function( elem ) { jQuery.expr.filters.hidden = function( elem ) {
return !jQuery.expr.filters.visible( elem );
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return support.reliableHiddenOffsets() ?
( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 &&
!elem.getClientRects().length ) :
filterHidden( elem );
}; };
jQuery.expr.filters.visible = function( elem ) { jQuery.expr.filters.visible = function( elem ) {
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); return !jQuery.expr.filters.hidden( elem );
}; };
}); } );
define([ define( [], function() {
"../data/var/dataPriv"
], function( dataPriv ) {
function showHide( elements, show ) { function showHide( elements, show ) {
var display, elem, var display, elem,
values = [], values = [],
...@@ -18,15 +15,16 @@ function showHide( elements, show ) { ...@@ -18,15 +15,16 @@ function showHide( elements, show ) {
display = elem.style.display; display = elem.style.display;
if ( show ) { if ( show ) {
if ( display === "none" ) { if ( display === "none" ) {
// Restore a pre-hide() value if we have one // Restore a pre-hide() value if we have one
values[ index ] = dataPriv.get( elem, "display" ) || ""; values[ index ] = jQuery._data( elem, "display" ) || "";
} }
} else { } else {
if ( display !== "none" ) { if ( display !== "none" ) {
values[ index ] = "none"; values[ index ] = "none";
// Remember the value we're replacing // Remember the value we're replacing
dataPriv.set( elem, "display", display ); jQuery._data( elem, "display", display );
} }
} }
} }
...@@ -44,4 +42,4 @@ function showHide( elements, show ) { ...@@ -44,4 +42,4 @@ function showHide( elements, show ) {
return showHide; return showHide;
}); } );
define([ define( [
"../core", "../core",
"../var/document", "../var/document",
"../var/documentElement", "../var/documentElement",
"../var/support" "../var/support"
], function( jQuery, document, documentElement, support ) { ], function( jQuery, document, documentElement, support ) {
(function() { ( function() {
var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal,
reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal,
container = document.createElement( "div" ), container = document.createElement( "div" ),
div = document.createElement( "div" ); div = document.createElement( "div" );
...@@ -15,91 +16,168 @@ define([ ...@@ -15,91 +16,168 @@ define([
return; return;
} }
// Support: IE9-11+ div.style.cssText = "float:left;opacity:.5";
// Style of cloned element affects source element cloned (#8908)
// Support: IE<9
// Make sure that element opacity exists (as opposed to filter)
support.opacity = div.style.opacity === "0.5";
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
support.cssFloat = !!div.style.cssFloat;
div.style.backgroundClip = "content-box"; div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = ""; div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box"; support.clearCloneStyle = div.style.backgroundClip === "content-box";
container = document.createElement( "div" );
container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
"padding:0;margin-top:1px;position:absolute"; "padding:0;margin-top:1px;position:absolute";
div.innerHTML = "";
container.appendChild( div ); container.appendChild( div );
// Executing both pixelPosition & boxSizingReliable tests require only one layout // Support: Firefox<29, Android 2.3
// so they're executed at the same time to save the second computation.
function computeStyleTests() {
div.style.cssText =
// Support: Android 2.3
// Vendor-prefix box-sizing // Vendor-prefix box-sizing
"-webkit-box-sizing:border-box;box-sizing:border-box;" + support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" ||
"display:block;position:absolute;" + div.style.WebkitBoxSizing === "";
"margin:0;margin-top:1%;margin-right:50%;" +
"border:1px;padding:1px;" +
"top:1%;width:50%;height:4px";
div.innerHTML = "";
documentElement.appendChild( container );
var divStyle = window.getComputedStyle( div );
pixelPositionVal = divStyle.top !== "1%";
boxSizingReliableVal = divStyle.height === "4px";
pixelMarginRightVal = divStyle.marginRight === "4px";
documentElement.removeChild( container );
}
jQuery.extend( support, { jQuery.extend( support, {
pixelPosition: function() { reliableHiddenOffsets: function() {
// This test is executed only once but we still do memoizing if ( pixelPositionVal == null ) {
// since we can use the boxSizingReliable pre-computing.
// No need to check if the test was already performed, though.
computeStyleTests(); computeStyleTests();
return pixelPositionVal; }
return reliableHiddenOffsetsVal;
}, },
boxSizingReliable: function() { boxSizingReliable: function() {
if ( boxSizingReliableVal == null ) {
// We're checking for pixelPositionVal here instead of boxSizingReliableVal
// since that compresses better and they're computed together anyway.
if ( pixelPositionVal == null ) {
computeStyleTests(); computeStyleTests();
} }
return boxSizingReliableVal; return boxSizingReliableVal;
}, },
pixelMarginRight: function() { pixelMarginRight: function() {
// Support: Android 4.0-4.3 // Support: Android 4.0-4.3
// We're checking for boxSizingReliableVal here instead of pixelMarginRightVal if ( pixelPositionVal == null ) {
// since that compresses better and they're computed together anyway.
if ( boxSizingReliableVal == null ) {
computeStyleTests(); computeStyleTests();
} }
return pixelMarginRightVal; return pixelMarginRightVal;
}, },
pixelPosition: function() {
if ( pixelPositionVal == null ) {
computeStyleTests();
}
return pixelPositionVal;
},
reliableMarginRight: function() { reliableMarginRight: function() {
// Support: Android 2.3 // Support: Android 2.3
// Check if div with explicit width and no margin-right incorrectly if ( pixelPositionVal == null ) {
// gets computed margin-right based on width of container. (#3333) computeStyleTests();
}
return reliableMarginRightVal;
},
reliableMarginLeft: function() {
// Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
if ( pixelPositionVal == null ) {
computeStyleTests();
}
return reliableMarginLeftVal;
}
} );
function computeStyleTests() {
var contents, divStyle,
documentElement = document.documentElement;
// Setup
documentElement.appendChild( container );
div.style.cssText =
// Support: Android 2.3
// Vendor-prefix box-sizing
"-webkit-box-sizing:border-box;box-sizing:border-box;" +
"position:relative;display:block;" +
"margin:auto;border:1px;padding:1px;" +
"top:1%;width:50%";
// Support: IE<9
// Assume reasonable values in the absence of getComputedStyle
pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false;
pixelMarginRightVal = reliableMarginRightVal = true;
// Check for getComputedStyle so that this code is not run in IE<9.
if ( window.getComputedStyle ) {
divStyle = window.getComputedStyle( div );
pixelPositionVal = ( divStyle || {} ).top !== "1%";
reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px";
boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px";
// Support: Android 4.0 - 4.3 only
// Some styles come back with percentage values, even though they shouldn't
div.style.marginRight = "50%";
pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
// Support: Android 2.3 only
// Div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container (#3333)
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// This support function is only executed once so no memoizing is needed. contents = div.appendChild( document.createElement( "div" ) );
var ret,
marginDiv = div.appendChild( document.createElement( "div" ) );
// Reset CSS: box-sizing; display; margin; border; padding // Reset CSS: box-sizing; display; margin; border; padding
marginDiv.style.cssText = div.style.cssText = contents.style.cssText = div.style.cssText =
// Support: Android 2.3 // Support: Android 2.3
// Vendor-prefix box-sizing // Vendor-prefix box-sizing
"-webkit-box-sizing:content-box;box-sizing:content-box;" + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
"display:block;margin:0;border:0;padding:0"; "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
marginDiv.style.marginRight = marginDiv.style.width = "0"; contents.style.marginRight = contents.style.width = "0";
div.style.width = "1px"; div.style.width = "1px";
documentElement.appendChild( container );
ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight ); reliableMarginRightVal =
!parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
documentElement.removeChild( container ); div.removeChild( contents );
div.removeChild( marginDiv ); }
return ret; // Support: IE6-8
// First check that getClientRects works as expected
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
div.style.display = "none";
reliableHiddenOffsetsVal = div.getClientRects().length === 0;
if ( reliableHiddenOffsetsVal ) {
div.style.display = "";
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
contents = div.getElementsByTagName( "td" );
contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
if ( reliableHiddenOffsetsVal ) {
contents[ 0 ].style.display = "";
contents[ 1 ].style.display = "none";
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
} }
}); }
})();
// Teardown
documentElement.removeChild( container );
}
} )();
return support; return support;
}); } );
define(function() { define( function() {
return [ "Top", "Right", "Bottom", "Left" ]; return [ "Top", "Right", "Bottom", "Left" ];
}); } );
define([ define( [
"../../core", "../../core",
"../../selector" "../../selector"
// css is assumed // css is assumed
], function( jQuery ) { ], function( jQuery ) {
return function( elem, el ) { return function( elem, el ) {
// isHidden might be called from jQuery#filter function; // isHidden might be called from jQuery#filter function;
// in that case, element will be second argument // in that case, element will be second argument
elem = el || elem; elem = el || elem;
return jQuery.css( elem, "display" ) === "none" || return jQuery.css( elem, "display" ) === "none" ||
!jQuery.contains( elem.ownerDocument, elem ); !jQuery.contains( elem.ownerDocument, elem );
}; };
}); } );
define(function() { define( function() {
return (/^margin/); return ( /^margin/ );
}); } );
define([ define( [
"../../var/pnum" "../../var/pnum"
], function( pnum ) { ], function( pnum ) {
return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
}); } );
define(function() { define( function() {
// 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.
return function( elem, options, callback, args ) { return function( elem, options, callback, args ) {
...@@ -21,4 +21,4 @@ return function( elem, options, callback, args ) { ...@@ -21,4 +21,4 @@ return function( elem, options, callback, args ) {
return ret; return ret;
}; };
}); } );
This diff is collapsed.
define( [
"../var/document",
"../var/support"
], function( document, support ) {
( function() {
var div = document.createElement( "div" );
// Support: IE<9
support.deleteExpando = true;
try {
delete div.test;
} catch ( e ) {
support.deleteExpando = false;
}
// Null elements to avoid leaks in IE.
div = null;
} )();
return support;
} );
define( [
"../../core"
], function( jQuery ) {
/**
* Determines whether an object can have data
*/
return function( elem ) {
var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ],
nodeType = +elem.nodeType || 1;
// Do not set data on non-element DOM nodes because it will not be cleared (#8335).
return nodeType !== 1 && nodeType !== 9 ?
false :
// Nodes accept data unless otherwise specified; rejection can be conditional
!noData || noData !== true && elem.getAttribute( "classid" ) === noData;
};
} );
This diff is collapsed.
define(function() { define( [
}); "./core",
"./traversing"
], function( jQuery ) {
jQuery.fn.extend( {
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
}
} );
// The number of elements contained in the matched element set
jQuery.fn.size = function() {
return this.length;
};
jQuery.fn.andSelf = jQuery.fn.addBack;
} );
define([ define( [
"./core", "./core",
"./core/access", "./core/access",
"./css" "./css"
...@@ -9,7 +9,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { ...@@ -9,7 +9,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
function( defaultExtra, funcName ) { function( defaultExtra, funcName ) {
// Margin is only for outerHeight, outerWidth // margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) { jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
...@@ -18,6 +18,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { ...@@ -18,6 +18,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
var doc; var doc;
if ( jQuery.isWindow( elem ) ) { if ( jQuery.isWindow( elem ) ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion: // isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764 // https://github.com/jquery/jquery/pull/764
...@@ -30,6 +31,8 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { ...@@ -30,6 +31,8 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
// whichever is greatest // whichever is greatest
// unfortunately, this causes bug #3838 in IE6/8 only,
// but there is currently no good, small way to fix it.
return Math.max( return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ],
...@@ -38,6 +41,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { ...@@ -38,6 +41,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
} }
return value === undefined ? return value === undefined ?
// Get width or height on the element, requesting but not forcing parseFloat // Get width or height on the element, requesting but not forcing parseFloat
jQuery.css( elem, type, extra ) : jQuery.css( elem, type, extra ) :
...@@ -45,8 +49,8 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { ...@@ -45,8 +49,8 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.style( elem, type, value, extra ); jQuery.style( elem, type, value, extra );
}, type, chainable ? margin : undefined, chainable, null ); }, type, chainable ? margin : undefined, chainable, null );
}; };
}); } );
}); } );
return jQuery; return jQuery;
}); } );
This diff is collapsed.
define([ define( [
"../core", "../core",
"../css" "../css"
], function( jQuery ) { ], function( jQuery ) {
...@@ -66,18 +66,19 @@ Tween.propHooks = { ...@@ -66,18 +66,19 @@ Tween.propHooks = {
return tween.elem[ tween.prop ]; return tween.elem[ tween.prop ];
} }
// Passing an empty string as a 3rd parameter to .css will automatically // passing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails. // attempt a parseFloat and fallback to a string if the parse fails
// Simple values such as "10px" are parsed to Float; // so, simple values such as "10px" are parsed to Float.
// complex values such as "rotate(1rad)" are returned as-is. // complex values such as "rotate(1rad)" are returned as is.
result = jQuery.css( tween.elem, tween.prop, "" ); result = jQuery.css( tween.elem, tween.prop, "" );
// Empty strings, null, undefined and "auto" are converted to 0. // Empty strings, null, undefined and "auto" are converted to 0.
return !result || result === "auto" ? 0 : result; return !result || result === "auto" ? 0 : result;
}, },
set: function( tween ) { set: function( tween ) {
// Use step hook for back compat.
// Use cssHook if its there. // use step hook for back compat - use cssHook if its there - use .style if its
// Use .style if available and use plain properties where available. // available and use plain properties where available
if ( jQuery.fx.step[ tween.prop ] ) { if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween ); jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.nodeType === 1 && } else if ( tween.elem.nodeType === 1 &&
...@@ -91,8 +92,9 @@ Tween.propHooks = { ...@@ -91,8 +92,9 @@ Tween.propHooks = {
} }
}; };
// Support: IE9 // Support: IE <=9
// Panic based approach to setting things on disconnected nodes // Panic based approach to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) { set: function( tween ) {
if ( tween.elem.nodeType && tween.elem.parentNode ) { if ( tween.elem.nodeType && tween.elem.parentNode ) {
...@@ -116,4 +118,4 @@ jQuery.fx = Tween.prototype.init; ...@@ -116,4 +118,4 @@ jQuery.fx = Tween.prototype.init;
// Back Compat <1.8 extension point // Back Compat <1.8 extension point
jQuery.fx.step = {}; jQuery.fx.step = {};
}); } );
define([ define( [
"../core", "../core",
"../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;
}; };
}); } );
define( [
"../var/support",
"../var/document"
], function( support, document ) {
( function() {
var shrinkWrapBlocksVal;
support.shrinkWrapBlocks = function() {
if ( shrinkWrapBlocksVal != null ) {
return shrinkWrapBlocksVal;
}
// Will be changed later if needed.
shrinkWrapBlocksVal = false;
// Minified: var b,c,d
var div, body, container;
body = document.getElementsByTagName( "body" )[ 0 ];
if ( !body || !body.style ) {
// Test fired too early or in an unsupported environment, exit.
return;
}
// Setup
div = document.createElement( "div" );
container = document.createElement( "div" );
container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
body.appendChild( container ).appendChild( div );
// Support: IE6
// Check if elements with layout shrink-wrap their children
if ( typeof div.style.zoom !== "undefined" ) {
// Reset CSS: box-sizing; display; margin; border
div.style.cssText =
// Support: Firefox<29, Android 2.3
// Vendor-prefix box-sizing
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
"box-sizing:content-box;display:block;margin:0;border:0;" +
"padding:1px;width:1px;zoom:1";
div.appendChild( document.createElement( "div" ) ).style.width = "5px";
shrinkWrapBlocksVal = div.offsetWidth !== 3;
}
body.removeChild( container );
return shrinkWrapBlocksVal;
};
} )();
return support;
} );
This diff is collapsed.
define([ define( [
"../core", "../core",
"../event" "../event"
], function( jQuery ) { ], function( jQuery ) {
// Attach a bunch of functions for handling common AJAX events // Attach a bunch of functions for handling common AJAX events
jQuery.each([ jQuery.each( [
"ajaxStart", "ajaxStart",
"ajaxStop", "ajaxStop",
"ajaxComplete", "ajaxComplete",
...@@ -15,6 +15,6 @@ jQuery.each([ ...@@ -15,6 +15,6 @@ jQuery.each([
jQuery.fn[ type ] = function( fn ) { jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn ); return this.on( type, fn );
}; };
}); } );
}); } );
define([ define( [
"../core", "../core",
"../event" "../event"
], function( jQuery ) { ], function( jQuery ) {
jQuery.each( ("blur focus focusin focusout resize scroll click dblclick " + jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup contextmenu").split(" "), "change select submit keydown keypress keyup error contextmenu" ).split( " " ),
function( i, name ) { function( i, name ) {
// Handle event binding // Handle event binding
...@@ -14,29 +14,12 @@ jQuery.each( ("blur focus focusin focusout resize scroll click dblclick " + ...@@ -14,29 +14,12 @@ jQuery.each( ("blur focus focusin focusout resize scroll click dblclick " +
this.on( name, null, data, fn ) : this.on( name, null, data, fn ) :
this.trigger( name ); this.trigger( name );
}; };
}); } );
jQuery.fn.extend({ jQuery.fn.extend( {
hover: function( fnOver, fnOut ) { hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
} }
}); } );
}); } );
define([ define( [
"../var/document",
"../var/support" "../var/support"
], function( support ) { ], function( document, support ) {
support.focusin = "onfocusin" in window; ( function() {
var i, eventName,
div = document.createElement( "div" );
// Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events)
for ( i in { submit: true, change: true, focusin: true } ) {
eventName = "on" + i;
if ( !( support[ i ] = eventName in window ) ) {
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
div.setAttribute( eventName, "t" );
support[ i ] = div.attributes[ eventName ].expando === false;
}
}
// Null elements to avoid leaks in IE.
div = null;
} )();
return support; return support;
}); } );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
define( function() {
return "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
"details|dialog|figcaption|figure|footer|header|hgroup|main|" +
"mark|meter|nav|output|picture|progress|section|summary|template|time|video";
} );
define(function() { define( function() {
return (/^(?:checkbox|radio)$/i); return ( /^(?:checkbox|radio)$/i );
}); } );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
define([ "./selector-sizzle" ], function() {}); define( [ "./selector-sizzle" ], function() {} );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment