social_stream 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Rakefile +2 -0
- data/app/controllers/contacts_controller.rb +28 -0
- data/app/controllers/groups_controller.rb +11 -0
- data/app/controllers/users_controller.rb +11 -0
- data/app/helpers/contacts_helper.rb +2 -0
- data/app/models/group.rb +21 -2
- data/app/models/profile.rb +26 -0
- data/app/views/contacts/index.html.erb +2 -0
- data/app/views/groups/_index.html.erb +2 -4
- data/app/views/groups/_middle_index.html.erb +74 -0
- data/app/views/groups/_new.html.erb +22 -3
- data/app/views/groups/_right_index.html.erb +19 -0
- data/app/views/groups/_right_show.html.erb +3 -3
- data/app/views/groups/index.html.erb +15 -51
- data/app/views/groups/index.js.erb +1 -0
- data/app/views/home/_options.html.erb +1 -1
- data/app/views/layouts/application.html.erb +5 -10
- data/app/views/users/_index.html.erb +2 -4
- data/app/views/users/_middle_index.html.erb +6 -0
- data/app/views/users/_profile.html.erb +60 -10
- data/app/views/users/_right_index.html.erb +19 -0
- data/app/views/users/edit.html.erb +19 -14
- data/app/views/users/index.html.erb +14 -33
- data/app/views/users/index.js.erb +1 -0
- data/app/views/users/update.js.erb +32 -10
- data/config/locales/en.yml +7 -1
- data/config/routes.rb +1 -1
- data/lib/generators/social_stream/templates/migration.rb +1 -0
- data/lib/generators/social_stream/templates/public/images/btn/search.png +0 -0
- data/lib/generators/social_stream/templates/public/images/fcbkcomplete/close.gif +0 -0
- data/lib/generators/social_stream/templates/public/images/loader.gif +0 -0
- data/lib/generators/social_stream/templates/public/javascripts/ajax.paginate.js +53 -0
- data/lib/generators/social_stream/templates/public/javascripts/jqcloud-0.1.3.min.js +11 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.ba-url.js +1091 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.fcbkcomplete.min.js +77 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.js +640 -344
- data/lib/generators/social_stream/templates/public/javascripts/jquery.min.js +16 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.validate.js +31 -19
- data/lib/generators/social_stream/templates/public/javascripts/rails.js +157 -146
- data/lib/generators/social_stream/templates/public/stylesheets/edit_user.css +14 -3
- data/lib/generators/social_stream/templates/public/stylesheets/fcbkComplete.css +36 -0
- data/lib/generators/social_stream/templates/public/stylesheets/jqcloud.css +62 -0
- data/lib/generators/social_stream/templates/public/stylesheets/social_stream.css +3 -0
- data/lib/generators/social_stream/templates/public/stylesheets/users.css +22 -0
- data/lib/social_stream/models/subject.rb +2 -1
- data/lib/social_stream/version.rb +1 -1
- data/social_stream.gemspec +2 -1
- data/spec/controllers/contacts_controller_spec.rb +12 -0
- metadata +40 -7
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* jQuery JavaScript Library v1.4.
|
2
|
+
* jQuery JavaScript Library v1.4.4
|
3
3
|
* http://jquery.com/
|
4
4
|
*
|
5
5
|
* Copyright 2010, John Resig
|
@@ -11,7 +11,7 @@
|
|
11
11
|
* Copyright 2010, The Dojo Foundation
|
12
12
|
* Released under the MIT, BSD, and GPL Licenses.
|
13
13
|
*
|
14
|
-
* Date: Thu
|
14
|
+
* Date: Thu Nov 11 19:04:53 2010 -0500
|
15
15
|
*/
|
16
16
|
(function( window, undefined ) {
|
17
17
|
|
@@ -211,7 +211,7 @@ jQuery.fn = jQuery.prototype = {
|
|
211
211
|
selector: "",
|
212
212
|
|
213
213
|
// The current version of jQuery being used
|
214
|
-
jquery: "1.4.
|
214
|
+
jquery: "1.4.4",
|
215
215
|
|
216
216
|
// The default length of a jQuery object is 0
|
217
217
|
length: 0,
|
@@ -330,8 +330,11 @@ jQuery.fn = jQuery.prototype = {
|
|
330
330
|
jQuery.fn.init.prototype = jQuery.fn;
|
331
331
|
|
332
332
|
jQuery.extend = jQuery.fn.extend = function() {
|
333
|
-
|
334
|
-
|
333
|
+
var options, name, src, copy, copyIsArray, clone,
|
334
|
+
target = arguments[0] || {},
|
335
|
+
i = 1,
|
336
|
+
length = arguments.length,
|
337
|
+
deep = false;
|
335
338
|
|
336
339
|
// Handle a deep copy situation
|
337
340
|
if ( typeof target === "boolean" ) {
|
@@ -433,18 +436,21 @@ jQuery.extend({
|
|
433
436
|
// If there are functions bound, to execute
|
434
437
|
if ( readyList ) {
|
435
438
|
// Execute all of them
|
436
|
-
var fn,
|
437
|
-
|
438
|
-
|
439
|
-
}
|
439
|
+
var fn,
|
440
|
+
i = 0,
|
441
|
+
ready = readyList;
|
440
442
|
|
441
443
|
// Reset the list of functions
|
442
444
|
readyList = null;
|
443
|
-
}
|
444
445
|
|
445
|
-
|
446
|
-
|
447
|
-
|
446
|
+
while ( (fn = ready[ i++ ]) ) {
|
447
|
+
fn.call( document, jQuery );
|
448
|
+
}
|
449
|
+
|
450
|
+
// Trigger any bound ready events
|
451
|
+
if ( jQuery.fn.trigger ) {
|
452
|
+
jQuery( document ).trigger( "ready" ).unbind( "ready" );
|
453
|
+
}
|
448
454
|
}
|
449
455
|
}
|
450
456
|
},
|
@@ -697,7 +703,8 @@ jQuery.extend({
|
|
697
703
|
},
|
698
704
|
|
699
705
|
merge: function( first, second ) {
|
700
|
-
var i = first.length,
|
706
|
+
var i = first.length,
|
707
|
+
j = 0;
|
701
708
|
|
702
709
|
if ( typeof second.length === "number" ) {
|
703
710
|
for ( var l = second.length; j < l; j++ ) {
|
@@ -964,6 +971,7 @@ return (window.jQuery = window.$ = jQuery);
|
|
964
971
|
optSelected: opt.selected,
|
965
972
|
|
966
973
|
// Will be defined later
|
974
|
+
deleteExpando: true,
|
967
975
|
optDisabled: false,
|
968
976
|
checkClone: false,
|
969
977
|
scriptEval: false,
|
@@ -994,6 +1002,15 @@ return (window.jQuery = window.$ = jQuery);
|
|
994
1002
|
delete window[ id ];
|
995
1003
|
}
|
996
1004
|
|
1005
|
+
// Test to see if it's possible to delete an expando from an element
|
1006
|
+
// Fails in Internet Explorer
|
1007
|
+
try {
|
1008
|
+
delete script.test;
|
1009
|
+
|
1010
|
+
} catch(e) {
|
1011
|
+
jQuery.support.deleteExpando = false;
|
1012
|
+
}
|
1013
|
+
|
997
1014
|
root.removeChild( script );
|
998
1015
|
|
999
1016
|
if ( div.attachEvent && div.fireEvent ) {
|
@@ -1087,20 +1104,6 @@ return (window.jQuery = window.$ = jQuery);
|
|
1087
1104
|
root = script = div = all = a = null;
|
1088
1105
|
})();
|
1089
1106
|
|
1090
|
-
jQuery.props = {
|
1091
|
-
"for": "htmlFor",
|
1092
|
-
"class": "className",
|
1093
|
-
readonly: "readOnly",
|
1094
|
-
maxlength: "maxLength",
|
1095
|
-
cellspacing: "cellSpacing",
|
1096
|
-
rowspan: "rowSpan",
|
1097
|
-
colspan: "colSpan",
|
1098
|
-
tabindex: "tabIndex",
|
1099
|
-
usemap: "useMap",
|
1100
|
-
frameborder: "frameBorder"
|
1101
|
-
};
|
1102
|
-
|
1103
|
-
|
1104
1107
|
|
1105
1108
|
|
1106
1109
|
var windowData = {},
|
@@ -1237,8 +1240,24 @@ jQuery.extend({
|
|
1237
1240
|
|
1238
1241
|
jQuery.fn.extend({
|
1239
1242
|
data: function( key, value ) {
|
1243
|
+
var data = null;
|
1244
|
+
|
1240
1245
|
if ( typeof key === "undefined" ) {
|
1241
|
-
|
1246
|
+
if ( this.length ) {
|
1247
|
+
var attr = this[0].attributes, name;
|
1248
|
+
data = jQuery.data( this[0] );
|
1249
|
+
|
1250
|
+
for ( var i = 0, l = attr.length; i < l; i++ ) {
|
1251
|
+
name = attr[i].name;
|
1252
|
+
|
1253
|
+
if ( name.indexOf( "data-" ) === 0 ) {
|
1254
|
+
name = name.substr( 5 );
|
1255
|
+
dataAttr( this[0], name, data[ name ] );
|
1256
|
+
}
|
1257
|
+
}
|
1258
|
+
}
|
1259
|
+
|
1260
|
+
return data;
|
1242
1261
|
|
1243
1262
|
} else if ( typeof key === "object" ) {
|
1244
1263
|
return this.each(function() {
|
@@ -1250,31 +1269,12 @@ jQuery.fn.extend({
|
|
1250
1269
|
parts[1] = parts[1] ? "." + parts[1] : "";
|
1251
1270
|
|
1252
1271
|
if ( value === undefined ) {
|
1253
|
-
|
1272
|
+
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
1254
1273
|
|
1255
1274
|
// Try to fetch any internally stored data first
|
1256
1275
|
if ( data === undefined && this.length ) {
|
1257
1276
|
data = jQuery.data( this[0], key );
|
1258
|
-
|
1259
|
-
// If nothing was found internally, try to fetch any
|
1260
|
-
// data from the HTML5 data-* attribute
|
1261
|
-
if ( data === undefined && this[0].nodeType === 1 ) {
|
1262
|
-
data = this[0].getAttribute( "data-" + key );
|
1263
|
-
|
1264
|
-
if ( typeof data === "string" ) {
|
1265
|
-
try {
|
1266
|
-
data = data === "true" ? true :
|
1267
|
-
data === "false" ? false :
|
1268
|
-
data === "null" ? null :
|
1269
|
-
!jQuery.isNaN( data ) ? parseFloat( data ) :
|
1270
|
-
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
1271
|
-
data;
|
1272
|
-
} catch( e ) {}
|
1273
|
-
|
1274
|
-
} else {
|
1275
|
-
data = undefined;
|
1276
|
-
}
|
1277
|
-
}
|
1277
|
+
data = dataAttr( this[0], key, data );
|
1278
1278
|
}
|
1279
1279
|
|
1280
1280
|
return data === undefined && parts[1] ?
|
@@ -1283,7 +1283,8 @@ jQuery.fn.extend({
|
|
1283
1283
|
|
1284
1284
|
} else {
|
1285
1285
|
return this.each(function() {
|
1286
|
-
var $this = jQuery( this ),
|
1286
|
+
var $this = jQuery( this ),
|
1287
|
+
args = [ parts[0], value ];
|
1287
1288
|
|
1288
1289
|
$this.triggerHandler( "setData" + parts[1] + "!", args );
|
1289
1290
|
jQuery.data( this, key, value );
|
@@ -1299,6 +1300,33 @@ jQuery.fn.extend({
|
|
1299
1300
|
}
|
1300
1301
|
});
|
1301
1302
|
|
1303
|
+
function dataAttr( elem, key, data ) {
|
1304
|
+
// If nothing was found internally, try to fetch any
|
1305
|
+
// data from the HTML5 data-* attribute
|
1306
|
+
if ( data === undefined && elem.nodeType === 1 ) {
|
1307
|
+
data = elem.getAttribute( "data-" + key );
|
1308
|
+
|
1309
|
+
if ( typeof data === "string" ) {
|
1310
|
+
try {
|
1311
|
+
data = data === "true" ? true :
|
1312
|
+
data === "false" ? false :
|
1313
|
+
data === "null" ? null :
|
1314
|
+
!jQuery.isNaN( data ) ? parseFloat( data ) :
|
1315
|
+
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
1316
|
+
data;
|
1317
|
+
} catch( e ) {}
|
1318
|
+
|
1319
|
+
// Make sure we set the data so it isn't changed later
|
1320
|
+
jQuery.data( elem, key, data );
|
1321
|
+
|
1322
|
+
} else {
|
1323
|
+
data = undefined;
|
1324
|
+
}
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
return data;
|
1328
|
+
}
|
1329
|
+
|
1302
1330
|
|
1303
1331
|
|
1304
1332
|
|
@@ -1329,7 +1357,8 @@ jQuery.extend({
|
|
1329
1357
|
dequeue: function( elem, type ) {
|
1330
1358
|
type = type || "fx";
|
1331
1359
|
|
1332
|
-
var queue = jQuery.queue( elem, type ),
|
1360
|
+
var queue = jQuery.queue( elem, type ),
|
1361
|
+
fn = queue.shift();
|
1333
1362
|
|
1334
1363
|
// If the fx queue is dequeued, always remove the progress sentinel
|
1335
1364
|
if ( fn === "inprogress" ) {
|
@@ -1405,6 +1434,19 @@ var rclass = /[\n\t]/g,
|
|
1405
1434
|
rclickable = /^a(?:rea)?$/i,
|
1406
1435
|
rradiocheck = /^(?:radio|checkbox)$/i;
|
1407
1436
|
|
1437
|
+
jQuery.props = {
|
1438
|
+
"for": "htmlFor",
|
1439
|
+
"class": "className",
|
1440
|
+
readonly: "readOnly",
|
1441
|
+
maxlength: "maxLength",
|
1442
|
+
cellspacing: "cellSpacing",
|
1443
|
+
rowspan: "rowSpan",
|
1444
|
+
colspan: "colSpan",
|
1445
|
+
tabindex: "tabIndex",
|
1446
|
+
usemap: "useMap",
|
1447
|
+
frameborder: "frameBorder"
|
1448
|
+
};
|
1449
|
+
|
1408
1450
|
jQuery.fn.extend({
|
1409
1451
|
attr: function( name, value ) {
|
1410
1452
|
return jQuery.access( this, name, value, true, jQuery.attr );
|
@@ -1438,7 +1480,9 @@ jQuery.fn.extend({
|
|
1438
1480
|
elem.className = value;
|
1439
1481
|
|
1440
1482
|
} else {
|
1441
|
-
var className = " " + elem.className + " ",
|
1483
|
+
var className = " " + elem.className + " ",
|
1484
|
+
setClass = elem.className;
|
1485
|
+
|
1442
1486
|
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
|
1443
1487
|
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
|
1444
1488
|
setClass += " " + classNames[c];
|
@@ -1486,7 +1530,8 @@ jQuery.fn.extend({
|
|
1486
1530
|
},
|
1487
1531
|
|
1488
1532
|
toggleClass: function( value, stateVal ) {
|
1489
|
-
var type = typeof value,
|
1533
|
+
var type = typeof value,
|
1534
|
+
isBool = typeof stateVal === "boolean";
|
1490
1535
|
|
1491
1536
|
if ( jQuery.isFunction( value ) ) {
|
1492
1537
|
return this.each(function(i) {
|
@@ -1498,7 +1543,9 @@ jQuery.fn.extend({
|
|
1498
1543
|
return this.each(function() {
|
1499
1544
|
if ( type === "string" ) {
|
1500
1545
|
// toggle individual class names
|
1501
|
-
var className,
|
1546
|
+
var className,
|
1547
|
+
i = 0,
|
1548
|
+
self = jQuery( this ),
|
1502
1549
|
state = stateVal,
|
1503
1550
|
classNames = value.split( rspaces );
|
1504
1551
|
|
@@ -1667,91 +1714,88 @@ jQuery.extend({
|
|
1667
1714
|
// Try to normalize/fix the name
|
1668
1715
|
name = notxml && jQuery.props[ name ] || name;
|
1669
1716
|
|
1670
|
-
//
|
1671
|
-
|
1672
|
-
// These attributes require special treatment
|
1673
|
-
var special = rspecialurl.test( name );
|
1674
|
-
|
1675
|
-
// Safari mis-reports the default selected property of an option
|
1676
|
-
// Accessing the parent's selectedIndex property fixes it
|
1677
|
-
if ( name === "selected" && !jQuery.support.optSelected ) {
|
1678
|
-
var parent = elem.parentNode;
|
1679
|
-
if ( parent ) {
|
1680
|
-
parent.selectedIndex;
|
1681
|
-
|
1682
|
-
// Make sure that it also works with optgroups, see #5701
|
1683
|
-
if ( parent.parentNode ) {
|
1684
|
-
parent.parentNode.selectedIndex;
|
1685
|
-
}
|
1686
|
-
}
|
1687
|
-
}
|
1717
|
+
// These attributes require special treatment
|
1718
|
+
var special = rspecialurl.test( name );
|
1688
1719
|
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
jQuery.error( "type property can't be changed" );
|
1696
|
-
}
|
1720
|
+
// Safari mis-reports the default selected property of an option
|
1721
|
+
// Accessing the parent's selectedIndex property fixes it
|
1722
|
+
if ( name === "selected" && !jQuery.support.optSelected ) {
|
1723
|
+
var parent = elem.parentNode;
|
1724
|
+
if ( parent ) {
|
1725
|
+
parent.selectedIndex;
|
1697
1726
|
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
}
|
1702
|
-
|
1703
|
-
} else {
|
1704
|
-
elem[ name ] = value;
|
1705
|
-
}
|
1727
|
+
// Make sure that it also works with optgroups, see #5701
|
1728
|
+
if ( parent.parentNode ) {
|
1729
|
+
parent.parentNode.selectedIndex;
|
1706
1730
|
}
|
1731
|
+
}
|
1732
|
+
}
|
1707
1733
|
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1734
|
+
// If applicable, access the attribute via the DOM 0 way
|
1735
|
+
// 'in' checks fail in Blackberry 4.7 #6931
|
1736
|
+
if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
|
1737
|
+
if ( set ) {
|
1738
|
+
// We can't allow the type property to be changed (since it causes problems in IE)
|
1739
|
+
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
|
1740
|
+
jQuery.error( "type property can't be changed" );
|
1711
1741
|
}
|
1712
1742
|
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1743
|
+
if ( value === null ) {
|
1744
|
+
if ( elem.nodeType === 1 ) {
|
1745
|
+
elem.removeAttribute( name );
|
1746
|
+
}
|
1717
1747
|
|
1718
|
-
|
1719
|
-
|
1720
|
-
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
|
1721
|
-
0 :
|
1722
|
-
undefined;
|
1748
|
+
} else {
|
1749
|
+
elem[ name ] = value;
|
1723
1750
|
}
|
1751
|
+
}
|
1724
1752
|
|
1725
|
-
|
1753
|
+
// browsers index elements by id/name on forms, give priority to attributes.
|
1754
|
+
if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
|
1755
|
+
return elem.getAttributeNode( name ).nodeValue;
|
1726
1756
|
}
|
1727
1757
|
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1758
|
+
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
|
1759
|
+
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
1760
|
+
if ( name === "tabIndex" ) {
|
1761
|
+
var attributeNode = elem.getAttributeNode( "tabIndex" );
|
1732
1762
|
|
1733
|
-
return
|
1763
|
+
return attributeNode && attributeNode.specified ?
|
1764
|
+
attributeNode.value :
|
1765
|
+
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
|
1766
|
+
0 :
|
1767
|
+
undefined;
|
1734
1768
|
}
|
1735
1769
|
|
1770
|
+
return elem[ name ];
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
if ( !jQuery.support.style && notxml && name === "style" ) {
|
1736
1774
|
if ( set ) {
|
1737
|
-
|
1738
|
-
elem.setAttribute( name, "" + value );
|
1775
|
+
elem.style.cssText = "" + value;
|
1739
1776
|
}
|
1740
1777
|
|
1741
|
-
|
1742
|
-
|
1743
|
-
if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
|
1744
|
-
return undefined;
|
1745
|
-
}
|
1778
|
+
return elem.style.cssText;
|
1779
|
+
}
|
1746
1780
|
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1781
|
+
if ( set ) {
|
1782
|
+
// convert the value to a string (all browsers do this but IE) see #1070
|
1783
|
+
elem.setAttribute( name, "" + value );
|
1784
|
+
}
|
1751
1785
|
|
1752
|
-
|
1753
|
-
|
1786
|
+
// Ensure that missing attributes return undefined
|
1787
|
+
// Blackberry 4.7 returns "" from getAttribute #6938
|
1788
|
+
if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
|
1789
|
+
return undefined;
|
1754
1790
|
}
|
1791
|
+
|
1792
|
+
var attr = !jQuery.support.hrefNormalized && notxml && special ?
|
1793
|
+
// Some attributes require a special call on IE
|
1794
|
+
elem.getAttribute( name, 2 ) :
|
1795
|
+
elem.getAttribute( name );
|
1796
|
+
|
1797
|
+
// Non-existent attributes return null, we normalize to undefined
|
1798
|
+
return attr === null ? undefined : attr;
|
1755
1799
|
}
|
1756
1800
|
});
|
1757
1801
|
|
@@ -1790,6 +1834,9 @@ jQuery.event = {
|
|
1790
1834
|
|
1791
1835
|
if ( handler === false ) {
|
1792
1836
|
handler = returnFalse;
|
1837
|
+
} else if ( !handler ) {
|
1838
|
+
// Fixes bug #7229. Fix recommended by jdalton
|
1839
|
+
return;
|
1793
1840
|
}
|
1794
1841
|
|
1795
1842
|
var handleObjIn, handleObj;
|
@@ -2133,8 +2180,10 @@ jQuery.event = {
|
|
2133
2180
|
jQuery.event.trigger( event, data, parent, true );
|
2134
2181
|
|
2135
2182
|
} else if ( !event.isDefaultPrevented() ) {
|
2136
|
-
var
|
2137
|
-
|
2183
|
+
var old,
|
2184
|
+
target = event.target,
|
2185
|
+
targetType = type.replace( rnamespaces, "" ),
|
2186
|
+
isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
|
2138
2187
|
special = jQuery.event.special[ targetType ] || {};
|
2139
2188
|
|
2140
2189
|
if ( (!special._default || special._default.call( elem, event ) === false) &&
|
@@ -2166,7 +2215,9 @@ jQuery.event = {
|
|
2166
2215
|
},
|
2167
2216
|
|
2168
2217
|
handle: function( event ) {
|
2169
|
-
var all, handlers, namespaces,
|
2218
|
+
var all, handlers, namespaces, namespace_re, events,
|
2219
|
+
namespace_sort = [],
|
2220
|
+
args = jQuery.makeArray( arguments );
|
2170
2221
|
|
2171
2222
|
event = args[0] = jQuery.event.fix( event || window.event );
|
2172
2223
|
event.currentTarget = this;
|
@@ -2245,7 +2296,8 @@ jQuery.event = {
|
|
2245
2296
|
|
2246
2297
|
// Fix target property, if necessary
|
2247
2298
|
if ( !event.target ) {
|
2248
|
-
|
2299
|
+
// Fixes #1925 where srcElement might not be defined either
|
2300
|
+
event.target = event.srcElement || document;
|
2249
2301
|
}
|
2250
2302
|
|
2251
2303
|
// check if target is a textnode (safari)
|
@@ -2260,7 +2312,9 @@ jQuery.event = {
|
|
2260
2312
|
|
2261
2313
|
// Calculate pageX/Y if missing and clientX/Y available
|
2262
2314
|
if ( event.pageX == null && event.clientX != null ) {
|
2263
|
-
var doc = document.documentElement,
|
2315
|
+
var doc = document.documentElement,
|
2316
|
+
body = document.body;
|
2317
|
+
|
2264
2318
|
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
|
2265
2319
|
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
|
2266
2320
|
}
|
@@ -2466,7 +2520,8 @@ if ( !jQuery.support.submitBubbles ) {
|
|
2466
2520
|
setup: function( data, namespaces ) {
|
2467
2521
|
if ( this.nodeName.toLowerCase() !== "form" ) {
|
2468
2522
|
jQuery.event.add(this, "click.specialSubmit", function( e ) {
|
2469
|
-
var elem = e.target,
|
2523
|
+
var elem = e.target,
|
2524
|
+
type = elem.type;
|
2470
2525
|
|
2471
2526
|
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
|
2472
2527
|
e.liveFired = undefined;
|
@@ -2475,7 +2530,8 @@ if ( !jQuery.support.submitBubbles ) {
|
|
2475
2530
|
});
|
2476
2531
|
|
2477
2532
|
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
|
2478
|
-
var elem = e.target,
|
2533
|
+
var elem = e.target,
|
2534
|
+
type = elem.type;
|
2479
2535
|
|
2480
2536
|
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
|
2481
2537
|
e.liveFired = undefined;
|
@@ -2716,7 +2772,8 @@ jQuery.fn.extend({
|
|
2716
2772
|
|
2717
2773
|
toggle: function( fn ) {
|
2718
2774
|
// Save reference to arguments for access in closure
|
2719
|
-
var args = arguments,
|
2775
|
+
var args = arguments,
|
2776
|
+
i = 1;
|
2720
2777
|
|
2721
2778
|
// link all the functions, so any of them can unbind this click handler
|
2722
2779
|
while ( i < args.length ) {
|
@@ -2811,8 +2868,9 @@ jQuery.each(["live", "die"], function( i, name ) {
|
|
2811
2868
|
});
|
2812
2869
|
|
2813
2870
|
function liveHandler( event ) {
|
2814
|
-
var stop, maxLevel,
|
2815
|
-
|
2871
|
+
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
|
2872
|
+
elems = [],
|
2873
|
+
selectors = [],
|
2816
2874
|
events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
|
2817
2875
|
|
2818
2876
|
if ( typeof events === "function" ) {
|
@@ -2823,7 +2881,7 @@ function liveHandler( event ) {
|
|
2823
2881
|
if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
|
2824
2882
|
return;
|
2825
2883
|
}
|
2826
|
-
|
2884
|
+
|
2827
2885
|
if ( event.namespace ) {
|
2828
2886
|
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
|
2829
2887
|
}
|
@@ -2887,6 +2945,9 @@ function liveHandler( event ) {
|
|
2887
2945
|
if ( ret === false ) {
|
2888
2946
|
stop = false;
|
2889
2947
|
}
|
2948
|
+
if ( event.isImmediatePropagationStopped() ) {
|
2949
|
+
break;
|
2950
|
+
}
|
2890
2951
|
}
|
2891
2952
|
}
|
2892
2953
|
|
@@ -2954,12 +3015,12 @@ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[
|
|
2954
3015
|
// optimization where it does not always call our comparision
|
2955
3016
|
// function. If that is the case, discard the hasDuplicate value.
|
2956
3017
|
// Thus far that includes Google Chrome.
|
2957
|
-
[0, 0].sort(function(){
|
3018
|
+
[0, 0].sort(function() {
|
2958
3019
|
baseHasDuplicate = false;
|
2959
3020
|
return 0;
|
2960
3021
|
});
|
2961
3022
|
|
2962
|
-
var Sizzle = function(selector, context, results, seed) {
|
3023
|
+
var Sizzle = function( selector, context, results, seed ) {
|
2963
3024
|
results = results || [];
|
2964
3025
|
context = context || document;
|
2965
3026
|
|
@@ -2973,13 +3034,16 @@ var Sizzle = function(selector, context, results, seed) {
|
|
2973
3034
|
return results;
|
2974
3035
|
}
|
2975
3036
|
|
2976
|
-
var
|
2977
|
-
|
3037
|
+
var m, set, checkSet, extra, ret, cur, pop, i,
|
3038
|
+
prune = true,
|
3039
|
+
contextXML = Sizzle.isXML( context ),
|
3040
|
+
parts = [],
|
3041
|
+
soFar = selector;
|
2978
3042
|
|
2979
3043
|
// Reset the position of the chunker regexp (start from head)
|
2980
3044
|
do {
|
2981
|
-
chunker.exec("");
|
2982
|
-
m = chunker.exec(soFar);
|
3045
|
+
chunker.exec( "" );
|
3046
|
+
m = chunker.exec( soFar );
|
2983
3047
|
|
2984
3048
|
if ( m ) {
|
2985
3049
|
soFar = m[3];
|
@@ -2994,8 +3058,10 @@ var Sizzle = function(selector, context, results, seed) {
|
|
2994
3058
|
} while ( m );
|
2995
3059
|
|
2996
3060
|
if ( parts.length > 1 && origPOS.exec( selector ) ) {
|
3061
|
+
|
2997
3062
|
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
|
2998
3063
|
set = posProcess( parts[0] + parts[1], context );
|
3064
|
+
|
2999
3065
|
} else {
|
3000
3066
|
set = Expr.relative[ parts[0] ] ?
|
3001
3067
|
[ context ] :
|
@@ -3011,23 +3077,31 @@ var Sizzle = function(selector, context, results, seed) {
|
|
3011
3077
|
set = posProcess( selector, set );
|
3012
3078
|
}
|
3013
3079
|
}
|
3080
|
+
|
3014
3081
|
} else {
|
3015
3082
|
// Take a shortcut and set the context if the root selector is an ID
|
3016
3083
|
// (but not if it'll be faster if the inner selector is an ID)
|
3017
3084
|
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
|
3018
3085
|
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
|
3086
|
+
|
3019
3087
|
ret = Sizzle.find( parts.shift(), context, contextXML );
|
3020
|
-
context = ret.expr ?
|
3088
|
+
context = ret.expr ?
|
3089
|
+
Sizzle.filter( ret.expr, ret.set )[0] :
|
3090
|
+
ret.set[0];
|
3021
3091
|
}
|
3022
3092
|
|
3023
3093
|
if ( context ) {
|
3024
3094
|
ret = seed ?
|
3025
3095
|
{ expr: parts.pop(), set: makeArray(seed) } :
|
3026
3096
|
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
|
3027
|
-
|
3097
|
+
|
3098
|
+
set = ret.expr ?
|
3099
|
+
Sizzle.filter( ret.expr, ret.set ) :
|
3100
|
+
ret.set;
|
3028
3101
|
|
3029
3102
|
if ( parts.length > 0 ) {
|
3030
|
-
checkSet = makeArray(set);
|
3103
|
+
checkSet = makeArray( set );
|
3104
|
+
|
3031
3105
|
} else {
|
3032
3106
|
prune = false;
|
3033
3107
|
}
|
@@ -3048,6 +3122,7 @@ var Sizzle = function(selector, context, results, seed) {
|
|
3048
3122
|
|
3049
3123
|
Expr.relative[ cur ]( checkSet, pop, contextXML );
|
3050
3124
|
}
|
3125
|
+
|
3051
3126
|
} else {
|
3052
3127
|
checkSet = parts = [];
|
3053
3128
|
}
|
@@ -3064,12 +3139,14 @@ var Sizzle = function(selector, context, results, seed) {
|
|
3064
3139
|
if ( toString.call(checkSet) === "[object Array]" ) {
|
3065
3140
|
if ( !prune ) {
|
3066
3141
|
results.push.apply( results, checkSet );
|
3142
|
+
|
3067
3143
|
} else if ( context && context.nodeType === 1 ) {
|
3068
3144
|
for ( i = 0; checkSet[i] != null; i++ ) {
|
3069
3145
|
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
|
3070
3146
|
results.push( set[i] );
|
3071
3147
|
}
|
3072
3148
|
}
|
3149
|
+
|
3073
3150
|
} else {
|
3074
3151
|
for ( i = 0; checkSet[i] != null; i++ ) {
|
3075
3152
|
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
|
@@ -3077,6 +3154,7 @@ var Sizzle = function(selector, context, results, seed) {
|
|
3077
3154
|
}
|
3078
3155
|
}
|
3079
3156
|
}
|
3157
|
+
|
3080
3158
|
} else {
|
3081
3159
|
makeArray( checkSet, results );
|
3082
3160
|
}
|
@@ -3089,15 +3167,15 @@ var Sizzle = function(selector, context, results, seed) {
|
|
3089
3167
|
return results;
|
3090
3168
|
};
|
3091
3169
|
|
3092
|
-
Sizzle.uniqueSort = function(results){
|
3170
|
+
Sizzle.uniqueSort = function( results ) {
|
3093
3171
|
if ( sortOrder ) {
|
3094
3172
|
hasDuplicate = baseHasDuplicate;
|
3095
|
-
results.sort(sortOrder);
|
3173
|
+
results.sort( sortOrder );
|
3096
3174
|
|
3097
3175
|
if ( hasDuplicate ) {
|
3098
3176
|
for ( var i = 1; i < results.length; i++ ) {
|
3099
|
-
if ( results[i] === results[i-1] ) {
|
3100
|
-
results.splice(i--, 1);
|
3177
|
+
if ( results[i] === results[ i - 1 ] ) {
|
3178
|
+
results.splice( i--, 1 );
|
3101
3179
|
}
|
3102
3180
|
}
|
3103
3181
|
}
|
@@ -3106,15 +3184,15 @@ Sizzle.uniqueSort = function(results){
|
|
3106
3184
|
return results;
|
3107
3185
|
};
|
3108
3186
|
|
3109
|
-
Sizzle.matches = function(expr, set){
|
3110
|
-
return Sizzle(expr, null, null, set);
|
3187
|
+
Sizzle.matches = function( expr, set ) {
|
3188
|
+
return Sizzle( expr, null, null, set );
|
3111
3189
|
};
|
3112
3190
|
|
3113
|
-
Sizzle.matchesSelector = function(node, expr){
|
3114
|
-
return Sizzle(expr, null, null, [node]).length > 0;
|
3191
|
+
Sizzle.matchesSelector = function( node, expr ) {
|
3192
|
+
return Sizzle( expr, null, null, [node] ).length > 0;
|
3115
3193
|
};
|
3116
3194
|
|
3117
|
-
Sizzle.find = function(expr, context, isXML){
|
3195
|
+
Sizzle.find = function( expr, context, isXML ) {
|
3118
3196
|
var set;
|
3119
3197
|
|
3120
3198
|
if ( !expr ) {
|
@@ -3122,15 +3200,17 @@ Sizzle.find = function(expr, context, isXML){
|
|
3122
3200
|
}
|
3123
3201
|
|
3124
3202
|
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
|
3125
|
-
var
|
3203
|
+
var match,
|
3204
|
+
type = Expr.order[i];
|
3126
3205
|
|
3127
3206
|
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
|
3128
3207
|
var left = match[1];
|
3129
|
-
match.splice(1,1);
|
3208
|
+
match.splice( 1, 1 );
|
3130
3209
|
|
3131
3210
|
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
3132
3211
|
match[1] = (match[1] || "").replace(/\\/g, "");
|
3133
3212
|
set = Expr.find[ type ]( match, context, isXML );
|
3213
|
+
|
3134
3214
|
if ( set != null ) {
|
3135
3215
|
expr = expr.replace( Expr.match[ type ], "" );
|
3136
3216
|
break;
|
@@ -3140,20 +3220,26 @@ Sizzle.find = function(expr, context, isXML){
|
|
3140
3220
|
}
|
3141
3221
|
|
3142
3222
|
if ( !set ) {
|
3143
|
-
set = context.getElementsByTagName("*");
|
3223
|
+
set = context.getElementsByTagName( "*" );
|
3144
3224
|
}
|
3145
3225
|
|
3146
|
-
return {set: set, expr: expr};
|
3226
|
+
return { set: set, expr: expr };
|
3147
3227
|
};
|
3148
3228
|
|
3149
|
-
Sizzle.filter = function(expr, set, inplace, not){
|
3150
|
-
var
|
3151
|
-
|
3229
|
+
Sizzle.filter = function( expr, set, inplace, not ) {
|
3230
|
+
var match, anyFound,
|
3231
|
+
old = expr,
|
3232
|
+
result = [],
|
3233
|
+
curLoop = set,
|
3234
|
+
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
|
3152
3235
|
|
3153
3236
|
while ( expr && set.length ) {
|
3154
3237
|
for ( var type in Expr.filter ) {
|
3155
3238
|
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
|
3156
|
-
var
|
3239
|
+
var found, item,
|
3240
|
+
filter = Expr.filter[ type ],
|
3241
|
+
left = match[1];
|
3242
|
+
|
3157
3243
|
anyFound = false;
|
3158
3244
|
|
3159
3245
|
match.splice(1,1);
|
@@ -3171,6 +3257,7 @@ Sizzle.filter = function(expr, set, inplace, not){
|
|
3171
3257
|
|
3172
3258
|
if ( !match ) {
|
3173
3259
|
anyFound = found = true;
|
3260
|
+
|
3174
3261
|
} else if ( match === true ) {
|
3175
3262
|
continue;
|
3176
3263
|
}
|
@@ -3185,9 +3272,11 @@ Sizzle.filter = function(expr, set, inplace, not){
|
|
3185
3272
|
if ( inplace && found != null ) {
|
3186
3273
|
if ( pass ) {
|
3187
3274
|
anyFound = true;
|
3275
|
+
|
3188
3276
|
} else {
|
3189
3277
|
curLoop[i] = false;
|
3190
3278
|
}
|
3279
|
+
|
3191
3280
|
} else if ( pass ) {
|
3192
3281
|
result.push( item );
|
3193
3282
|
anyFound = true;
|
@@ -3216,6 +3305,7 @@ Sizzle.filter = function(expr, set, inplace, not){
|
|
3216
3305
|
if ( expr === old ) {
|
3217
3306
|
if ( anyFound == null ) {
|
3218
3307
|
Sizzle.error( expr );
|
3308
|
+
|
3219
3309
|
} else {
|
3220
3310
|
break;
|
3221
3311
|
}
|
@@ -3233,6 +3323,7 @@ Sizzle.error = function( msg ) {
|
|
3233
3323
|
|
3234
3324
|
var Expr = Sizzle.selectors = {
|
3235
3325
|
order: [ "ID", "NAME", "TAG" ],
|
3326
|
+
|
3236
3327
|
match: {
|
3237
3328
|
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
3238
3329
|
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
@@ -3243,20 +3334,24 @@ var Expr = Sizzle.selectors = {
|
|
3243
3334
|
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
|
3244
3335
|
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
|
3245
3336
|
},
|
3337
|
+
|
3246
3338
|
leftMatch: {},
|
3339
|
+
|
3247
3340
|
attrMap: {
|
3248
3341
|
"class": "className",
|
3249
3342
|
"for": "htmlFor"
|
3250
3343
|
},
|
3344
|
+
|
3251
3345
|
attrHandle: {
|
3252
|
-
href: function(elem){
|
3253
|
-
return elem.getAttribute("href");
|
3346
|
+
href: function( elem ) {
|
3347
|
+
return elem.getAttribute( "href" );
|
3254
3348
|
}
|
3255
3349
|
},
|
3350
|
+
|
3256
3351
|
relative: {
|
3257
3352
|
"+": function(checkSet, part){
|
3258
3353
|
var isPartStr = typeof part === "string",
|
3259
|
-
isTag = isPartStr && !/\W/.test(part),
|
3354
|
+
isTag = isPartStr && !/\W/.test( part ),
|
3260
3355
|
isPartStrNotTag = isPartStr && !isTag;
|
3261
3356
|
|
3262
3357
|
if ( isTag ) {
|
@@ -3277,23 +3372,29 @@ var Expr = Sizzle.selectors = {
|
|
3277
3372
|
Sizzle.filter( part, checkSet, true );
|
3278
3373
|
}
|
3279
3374
|
},
|
3280
|
-
">": function(checkSet, part){
|
3281
|
-
var isPartStr = typeof part === "string",
|
3282
|
-
elem, i = 0, l = checkSet.length;
|
3283
3375
|
|
3284
|
-
|
3376
|
+
">": function( checkSet, part ) {
|
3377
|
+
var elem,
|
3378
|
+
isPartStr = typeof part === "string",
|
3379
|
+
i = 0,
|
3380
|
+
l = checkSet.length;
|
3381
|
+
|
3382
|
+
if ( isPartStr && !/\W/.test( part ) ) {
|
3285
3383
|
part = part.toLowerCase();
|
3286
3384
|
|
3287
3385
|
for ( ; i < l; i++ ) {
|
3288
3386
|
elem = checkSet[i];
|
3387
|
+
|
3289
3388
|
if ( elem ) {
|
3290
3389
|
var parent = elem.parentNode;
|
3291
3390
|
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
|
3292
3391
|
}
|
3293
3392
|
}
|
3393
|
+
|
3294
3394
|
} else {
|
3295
3395
|
for ( ; i < l; i++ ) {
|
3296
3396
|
elem = checkSet[i];
|
3397
|
+
|
3297
3398
|
if ( elem ) {
|
3298
3399
|
checkSet[i] = isPartStr ?
|
3299
3400
|
elem.parentNode :
|
@@ -3306,8 +3407,11 @@ var Expr = Sizzle.selectors = {
|
|
3306
3407
|
}
|
3307
3408
|
}
|
3308
3409
|
},
|
3410
|
+
|
3309
3411
|
"": function(checkSet, part, isXML){
|
3310
|
-
var
|
3412
|
+
var nodeCheck,
|
3413
|
+
doneName = done++,
|
3414
|
+
checkFn = dirCheck;
|
3311
3415
|
|
3312
3416
|
if ( typeof part === "string" && !/\W/.test(part) ) {
|
3313
3417
|
part = part.toLowerCase();
|
@@ -3315,22 +3419,26 @@ var Expr = Sizzle.selectors = {
|
|
3315
3419
|
checkFn = dirNodeCheck;
|
3316
3420
|
}
|
3317
3421
|
|
3318
|
-
checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
|
3422
|
+
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
|
3319
3423
|
},
|
3320
|
-
"~": function(checkSet, part, isXML){
|
3321
|
-
var doneName = done++, checkFn = dirCheck, nodeCheck;
|
3322
3424
|
|
3323
|
-
|
3425
|
+
"~": function( checkSet, part, isXML ) {
|
3426
|
+
var nodeCheck,
|
3427
|
+
doneName = done++,
|
3428
|
+
checkFn = dirCheck;
|
3429
|
+
|
3430
|
+
if ( typeof part === "string" && !/\W/.test( part ) ) {
|
3324
3431
|
part = part.toLowerCase();
|
3325
3432
|
nodeCheck = part;
|
3326
3433
|
checkFn = dirNodeCheck;
|
3327
3434
|
}
|
3328
3435
|
|
3329
|
-
checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
|
3436
|
+
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
|
3330
3437
|
}
|
3331
3438
|
},
|
3439
|
+
|
3332
3440
|
find: {
|
3333
|
-
ID: function(match, context, isXML){
|
3441
|
+
ID: function( match, context, isXML ) {
|
3334
3442
|
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
3335
3443
|
var m = context.getElementById(match[1]);
|
3336
3444
|
// Check parentNode to catch when Blackberry 4.6 returns
|
@@ -3338,9 +3446,11 @@ var Expr = Sizzle.selectors = {
|
|
3338
3446
|
return m && m.parentNode ? [m] : [];
|
3339
3447
|
}
|
3340
3448
|
},
|
3341
|
-
|
3449
|
+
|
3450
|
+
NAME: function( match, context ) {
|
3342
3451
|
if ( typeof context.getElementsByName !== "undefined" ) {
|
3343
|
-
var ret = [],
|
3452
|
+
var ret = [],
|
3453
|
+
results = context.getElementsByName( match[1] );
|
3344
3454
|
|
3345
3455
|
for ( var i = 0, l = results.length; i < l; i++ ) {
|
3346
3456
|
if ( results[i].getAttribute("name") === match[1] ) {
|
@@ -3351,12 +3461,13 @@ var Expr = Sizzle.selectors = {
|
|
3351
3461
|
return ret.length === 0 ? null : ret;
|
3352
3462
|
}
|
3353
3463
|
},
|
3354
|
-
|
3355
|
-
|
3464
|
+
|
3465
|
+
TAG: function( match, context ) {
|
3466
|
+
return context.getElementsByTagName( match[1] );
|
3356
3467
|
}
|
3357
3468
|
},
|
3358
3469
|
preFilter: {
|
3359
|
-
CLASS: function(match, curLoop, inplace, result, not, isXML){
|
3470
|
+
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
|
3360
3471
|
match = " " + match[1].replace(/\\/g, "") + " ";
|
3361
3472
|
|
3362
3473
|
if ( isXML ) {
|
@@ -3369,6 +3480,7 @@ var Expr = Sizzle.selectors = {
|
|
3369
3480
|
if ( !inplace ) {
|
3370
3481
|
result.push( elem );
|
3371
3482
|
}
|
3483
|
+
|
3372
3484
|
} else if ( inplace ) {
|
3373
3485
|
curLoop[i] = false;
|
3374
3486
|
}
|
@@ -3377,13 +3489,16 @@ var Expr = Sizzle.selectors = {
|
|
3377
3489
|
|
3378
3490
|
return false;
|
3379
3491
|
},
|
3380
|
-
|
3492
|
+
|
3493
|
+
ID: function( match ) {
|
3381
3494
|
return match[1].replace(/\\/g, "");
|
3382
3495
|
},
|
3383
|
-
|
3496
|
+
|
3497
|
+
TAG: function( match, curLoop ) {
|
3384
3498
|
return match[1].toLowerCase();
|
3385
3499
|
},
|
3386
|
-
|
3500
|
+
|
3501
|
+
CHILD: function( match ) {
|
3387
3502
|
if ( match[1] === "nth" ) {
|
3388
3503
|
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
|
3389
3504
|
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
|
@@ -3400,7 +3515,8 @@ var Expr = Sizzle.selectors = {
|
|
3400
3515
|
|
3401
3516
|
return match;
|
3402
3517
|
},
|
3403
|
-
|
3518
|
+
|
3519
|
+
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
|
3404
3520
|
var name = match[1].replace(/\\/g, "");
|
3405
3521
|
|
3406
3522
|
if ( !isXML && Expr.attrMap[name] ) {
|
@@ -3413,122 +3529,156 @@ var Expr = Sizzle.selectors = {
|
|
3413
3529
|
|
3414
3530
|
return match;
|
3415
3531
|
},
|
3416
|
-
|
3532
|
+
|
3533
|
+
PSEUDO: function( match, curLoop, inplace, result, not ) {
|
3417
3534
|
if ( match[1] === "not" ) {
|
3418
3535
|
// If we're dealing with a complex expression, or a simple one
|
3419
3536
|
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
|
3420
3537
|
match[3] = Sizzle(match[3], null, null, curLoop);
|
3538
|
+
|
3421
3539
|
} else {
|
3422
3540
|
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
|
3541
|
+
|
3423
3542
|
if ( !inplace ) {
|
3424
3543
|
result.push.apply( result, ret );
|
3425
3544
|
}
|
3545
|
+
|
3426
3546
|
return false;
|
3427
3547
|
}
|
3548
|
+
|
3428
3549
|
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
|
3429
3550
|
return true;
|
3430
3551
|
}
|
3431
3552
|
|
3432
3553
|
return match;
|
3433
3554
|
},
|
3434
|
-
|
3555
|
+
|
3556
|
+
POS: function( match ) {
|
3435
3557
|
match.unshift( true );
|
3558
|
+
|
3436
3559
|
return match;
|
3437
3560
|
}
|
3438
3561
|
},
|
3562
|
+
|
3439
3563
|
filters: {
|
3440
|
-
enabled: function(elem){
|
3564
|
+
enabled: function( elem ) {
|
3441
3565
|
return elem.disabled === false && elem.type !== "hidden";
|
3442
3566
|
},
|
3443
|
-
|
3567
|
+
|
3568
|
+
disabled: function( elem ) {
|
3444
3569
|
return elem.disabled === true;
|
3445
3570
|
},
|
3446
|
-
|
3571
|
+
|
3572
|
+
checked: function( elem ) {
|
3447
3573
|
return elem.checked === true;
|
3448
3574
|
},
|
3449
|
-
|
3575
|
+
|
3576
|
+
selected: function( elem ) {
|
3450
3577
|
// Accessing this property makes selected-by-default
|
3451
3578
|
// options in Safari work properly
|
3452
3579
|
elem.parentNode.selectedIndex;
|
3580
|
+
|
3453
3581
|
return elem.selected === true;
|
3454
3582
|
},
|
3455
|
-
|
3583
|
+
|
3584
|
+
parent: function( elem ) {
|
3456
3585
|
return !!elem.firstChild;
|
3457
3586
|
},
|
3458
|
-
|
3587
|
+
|
3588
|
+
empty: function( elem ) {
|
3459
3589
|
return !elem.firstChild;
|
3460
3590
|
},
|
3461
|
-
|
3591
|
+
|
3592
|
+
has: function( elem, i, match ) {
|
3462
3593
|
return !!Sizzle( match[3], elem ).length;
|
3463
3594
|
},
|
3464
|
-
|
3595
|
+
|
3596
|
+
header: function( elem ) {
|
3465
3597
|
return (/h\d/i).test( elem.nodeName );
|
3466
3598
|
},
|
3467
|
-
|
3599
|
+
|
3600
|
+
text: function( elem ) {
|
3468
3601
|
return "text" === elem.type;
|
3469
3602
|
},
|
3470
|
-
radio: function(elem){
|
3603
|
+
radio: function( elem ) {
|
3471
3604
|
return "radio" === elem.type;
|
3472
3605
|
},
|
3473
|
-
|
3606
|
+
|
3607
|
+
checkbox: function( elem ) {
|
3474
3608
|
return "checkbox" === elem.type;
|
3475
3609
|
},
|
3476
|
-
|
3610
|
+
|
3611
|
+
file: function( elem ) {
|
3477
3612
|
return "file" === elem.type;
|
3478
3613
|
},
|
3479
|
-
password: function(elem){
|
3614
|
+
password: function( elem ) {
|
3480
3615
|
return "password" === elem.type;
|
3481
3616
|
},
|
3482
|
-
|
3617
|
+
|
3618
|
+
submit: function( elem ) {
|
3483
3619
|
return "submit" === elem.type;
|
3484
3620
|
},
|
3485
|
-
|
3621
|
+
|
3622
|
+
image: function( elem ) {
|
3486
3623
|
return "image" === elem.type;
|
3487
3624
|
},
|
3488
|
-
|
3625
|
+
|
3626
|
+
reset: function( elem ) {
|
3489
3627
|
return "reset" === elem.type;
|
3490
3628
|
},
|
3491
|
-
|
3629
|
+
|
3630
|
+
button: function( elem ) {
|
3492
3631
|
return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
|
3493
3632
|
},
|
3494
|
-
|
3495
|
-
|
3633
|
+
|
3634
|
+
input: function( elem ) {
|
3635
|
+
return (/input|select|textarea|button/i).test( elem.nodeName );
|
3496
3636
|
}
|
3497
3637
|
},
|
3498
3638
|
setFilters: {
|
3499
|
-
first: function(elem, i){
|
3639
|
+
first: function( elem, i ) {
|
3500
3640
|
return i === 0;
|
3501
3641
|
},
|
3502
|
-
|
3642
|
+
|
3643
|
+
last: function( elem, i, match, array ) {
|
3503
3644
|
return i === array.length - 1;
|
3504
3645
|
},
|
3505
|
-
|
3646
|
+
|
3647
|
+
even: function( elem, i ) {
|
3506
3648
|
return i % 2 === 0;
|
3507
3649
|
},
|
3508
|
-
|
3650
|
+
|
3651
|
+
odd: function( elem, i ) {
|
3509
3652
|
return i % 2 === 1;
|
3510
3653
|
},
|
3511
|
-
|
3654
|
+
|
3655
|
+
lt: function( elem, i, match ) {
|
3512
3656
|
return i < match[3] - 0;
|
3513
3657
|
},
|
3514
|
-
|
3658
|
+
|
3659
|
+
gt: function( elem, i, match ) {
|
3515
3660
|
return i > match[3] - 0;
|
3516
3661
|
},
|
3517
|
-
|
3662
|
+
|
3663
|
+
nth: function( elem, i, match ) {
|
3518
3664
|
return match[3] - 0 === i;
|
3519
3665
|
},
|
3520
|
-
|
3666
|
+
|
3667
|
+
eq: function( elem, i, match ) {
|
3521
3668
|
return match[3] - 0 === i;
|
3522
3669
|
}
|
3523
3670
|
},
|
3524
3671
|
filter: {
|
3525
|
-
PSEUDO: function(elem, match, i, array){
|
3526
|
-
var name = match[1],
|
3672
|
+
PSEUDO: function( elem, match, i, array ) {
|
3673
|
+
var name = match[1],
|
3674
|
+
filter = Expr.filters[ name ];
|
3527
3675
|
|
3528
3676
|
if ( filter ) {
|
3529
3677
|
return filter( elem, i, match, array );
|
3678
|
+
|
3530
3679
|
} else if ( name === "contains" ) {
|
3531
3680
|
return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
|
3681
|
+
|
3532
3682
|
} else if ( name === "not" ) {
|
3533
3683
|
var not = match[3];
|
3534
3684
|
|
@@ -3539,33 +3689,43 @@ var Expr = Sizzle.selectors = {
|
|
3539
3689
|
}
|
3540
3690
|
|
3541
3691
|
return true;
|
3692
|
+
|
3542
3693
|
} else {
|
3543
3694
|
Sizzle.error( "Syntax error, unrecognized expression: " + name );
|
3544
3695
|
}
|
3545
3696
|
},
|
3546
|
-
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
|
3697
|
+
|
3698
|
+
CHILD: function( elem, match ) {
|
3699
|
+
var type = match[1],
|
3700
|
+
node = elem;
|
3701
|
+
|
3702
|
+
switch ( type ) {
|
3703
|
+
case "only":
|
3704
|
+
case "first":
|
3551
3705
|
while ( (node = node.previousSibling) ) {
|
3552
3706
|
if ( node.nodeType === 1 ) {
|
3553
3707
|
return false;
|
3554
3708
|
}
|
3555
3709
|
}
|
3710
|
+
|
3556
3711
|
if ( type === "first" ) {
|
3557
3712
|
return true;
|
3558
3713
|
}
|
3714
|
+
|
3559
3715
|
node = elem;
|
3560
|
-
|
3716
|
+
|
3717
|
+
case "last":
|
3561
3718
|
while ( (node = node.nextSibling) ) {
|
3562
3719
|
if ( node.nodeType === 1 ) {
|
3563
3720
|
return false;
|
3564
3721
|
}
|
3565
3722
|
}
|
3723
|
+
|
3566
3724
|
return true;
|
3567
|
-
|
3568
|
-
|
3725
|
+
|
3726
|
+
case "nth":
|
3727
|
+
var first = match[2],
|
3728
|
+
last = match[3];
|
3569
3729
|
|
3570
3730
|
if ( first === 1 && last === 0 ) {
|
3571
3731
|
return true;
|
@@ -3576,33 +3736,41 @@ var Expr = Sizzle.selectors = {
|
|
3576
3736
|
|
3577
3737
|
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
|
3578
3738
|
var count = 0;
|
3739
|
+
|
3579
3740
|
for ( node = parent.firstChild; node; node = node.nextSibling ) {
|
3580
3741
|
if ( node.nodeType === 1 ) {
|
3581
3742
|
node.nodeIndex = ++count;
|
3582
3743
|
}
|
3583
3744
|
}
|
3745
|
+
|
3584
3746
|
parent.sizcache = doneName;
|
3585
3747
|
}
|
3586
3748
|
|
3587
3749
|
var diff = elem.nodeIndex - last;
|
3750
|
+
|
3588
3751
|
if ( first === 0 ) {
|
3589
3752
|
return diff === 0;
|
3753
|
+
|
3590
3754
|
} else {
|
3591
3755
|
return ( diff % first === 0 && diff / first >= 0 );
|
3592
3756
|
}
|
3593
3757
|
}
|
3594
3758
|
},
|
3595
|
-
|
3759
|
+
|
3760
|
+
ID: function( elem, match ) {
|
3596
3761
|
return elem.nodeType === 1 && elem.getAttribute("id") === match;
|
3597
3762
|
},
|
3598
|
-
|
3763
|
+
|
3764
|
+
TAG: function( elem, match ) {
|
3599
3765
|
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
|
3600
3766
|
},
|
3601
|
-
|
3767
|
+
|
3768
|
+
CLASS: function( elem, match ) {
|
3602
3769
|
return (" " + (elem.className || elem.getAttribute("class")) + " ")
|
3603
3770
|
.indexOf( match ) > -1;
|
3604
3771
|
},
|
3605
|
-
|
3772
|
+
|
3773
|
+
ATTR: function( elem, match ) {
|
3606
3774
|
var name = match[1],
|
3607
3775
|
result = Expr.attrHandle[ name ] ?
|
3608
3776
|
Expr.attrHandle[ name ]( elem ) :
|
@@ -3633,8 +3801,10 @@ var Expr = Sizzle.selectors = {
|
|
3633
3801
|
value === check || value.substr(0, check.length + 1) === check + "-" :
|
3634
3802
|
false;
|
3635
3803
|
},
|
3636
|
-
|
3637
|
-
|
3804
|
+
|
3805
|
+
POS: function( elem, match, i, array ) {
|
3806
|
+
var name = match[2],
|
3807
|
+
filter = Expr.setFilters[ name ];
|
3638
3808
|
|
3639
3809
|
if ( filter ) {
|
3640
3810
|
return filter( elem, i, match, array );
|
@@ -3653,7 +3823,7 @@ for ( var type in Expr.match ) {
|
|
3653
3823
|
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
|
3654
3824
|
}
|
3655
3825
|
|
3656
|
-
var makeArray = function(array, results) {
|
3826
|
+
var makeArray = function( array, results ) {
|
3657
3827
|
array = Array.prototype.slice.call( array, 0 );
|
3658
3828
|
|
3659
3829
|
if ( results ) {
|
@@ -3672,17 +3842,20 @@ try {
|
|
3672
3842
|
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
|
3673
3843
|
|
3674
3844
|
// Provide a fallback method if it does not work
|
3675
|
-
} catch(e){
|
3676
|
-
makeArray = function(array, results) {
|
3677
|
-
var
|
3845
|
+
} catch( e ) {
|
3846
|
+
makeArray = function( array, results ) {
|
3847
|
+
var i = 0,
|
3848
|
+
ret = results || [];
|
3678
3849
|
|
3679
3850
|
if ( toString.call(array) === "[object Array]" ) {
|
3680
3851
|
Array.prototype.push.apply( ret, array );
|
3852
|
+
|
3681
3853
|
} else {
|
3682
3854
|
if ( typeof array.length === "number" ) {
|
3683
3855
|
for ( var l = array.length; i < l; i++ ) {
|
3684
3856
|
ret.push( array[i] );
|
3685
3857
|
}
|
3858
|
+
|
3686
3859
|
} else {
|
3687
3860
|
for ( ; array[i]; i++ ) {
|
3688
3861
|
ret.push( array[i] );
|
@@ -3709,10 +3882,15 @@ if ( document.documentElement.compareDocumentPosition ) {
|
|
3709
3882
|
|
3710
3883
|
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
|
3711
3884
|
};
|
3885
|
+
|
3712
3886
|
} else {
|
3713
3887
|
sortOrder = function( a, b ) {
|
3714
|
-
var
|
3715
|
-
|
3888
|
+
var al, bl,
|
3889
|
+
ap = [],
|
3890
|
+
bp = [],
|
3891
|
+
aup = a.parentNode,
|
3892
|
+
bup = b.parentNode,
|
3893
|
+
cur = aup;
|
3716
3894
|
|
3717
3895
|
// The nodes are identical, we can exit early
|
3718
3896
|
if ( a === b ) {
|
@@ -3805,31 +3983,40 @@ Sizzle.getText = function( elems ) {
|
|
3805
3983
|
(function(){
|
3806
3984
|
// We're going to inject a fake input element with a specified name
|
3807
3985
|
var form = document.createElement("div"),
|
3808
|
-
id = "script" + (new Date()).getTime()
|
3986
|
+
id = "script" + (new Date()).getTime(),
|
3987
|
+
root = document.documentElement;
|
3988
|
+
|
3809
3989
|
form.innerHTML = "<a name='" + id + "'/>";
|
3810
3990
|
|
3811
3991
|
// Inject it into the root element, check its status, and remove it quickly
|
3812
|
-
var root = document.documentElement;
|
3813
3992
|
root.insertBefore( form, root.firstChild );
|
3814
3993
|
|
3815
3994
|
// The workaround has to do additional checks after a getElementById
|
3816
3995
|
// Which slows things down for other browsers (hence the branching)
|
3817
3996
|
if ( document.getElementById( id ) ) {
|
3818
|
-
Expr.find.ID = function(match, context, isXML){
|
3997
|
+
Expr.find.ID = function( match, context, isXML ) {
|
3819
3998
|
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
3820
3999
|
var m = context.getElementById(match[1]);
|
3821
|
-
|
4000
|
+
|
4001
|
+
return m ?
|
4002
|
+
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
|
4003
|
+
[m] :
|
4004
|
+
undefined :
|
4005
|
+
[];
|
3822
4006
|
}
|
3823
4007
|
};
|
3824
4008
|
|
3825
|
-
Expr.filter.ID = function(elem, match){
|
4009
|
+
Expr.filter.ID = function( elem, match ) {
|
3826
4010
|
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
|
4011
|
+
|
3827
4012
|
return elem.nodeType === 1 && node && node.nodeValue === match;
|
3828
4013
|
};
|
3829
4014
|
}
|
3830
4015
|
|
3831
4016
|
root.removeChild( form );
|
3832
|
-
|
4017
|
+
|
4018
|
+
// release memory in IE
|
4019
|
+
root = form = null;
|
3833
4020
|
})();
|
3834
4021
|
|
3835
4022
|
(function(){
|
@@ -3842,8 +4029,8 @@ Sizzle.getText = function( elems ) {
|
|
3842
4029
|
|
3843
4030
|
// Make sure no comments are found
|
3844
4031
|
if ( div.getElementsByTagName("*").length > 0 ) {
|
3845
|
-
Expr.find.TAG = function(match, context){
|
3846
|
-
var results = context.getElementsByTagName(match[1]);
|
4032
|
+
Expr.find.TAG = function( match, context ) {
|
4033
|
+
var results = context.getElementsByTagName( match[1] );
|
3847
4034
|
|
3848
4035
|
// Filter out possible comments
|
3849
4036
|
if ( match[1] === "*" ) {
|
@@ -3864,19 +4051,25 @@ Sizzle.getText = function( elems ) {
|
|
3864
4051
|
|
3865
4052
|
// Check to see if an attribute returns normalized href attributes
|
3866
4053
|
div.innerHTML = "<a href='#'></a>";
|
4054
|
+
|
3867
4055
|
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
|
3868
4056
|
div.firstChild.getAttribute("href") !== "#" ) {
|
3869
|
-
|
3870
|
-
|
4057
|
+
|
4058
|
+
Expr.attrHandle.href = function( elem ) {
|
4059
|
+
return elem.getAttribute( "href", 2 );
|
3871
4060
|
};
|
3872
4061
|
}
|
3873
4062
|
|
3874
|
-
|
4063
|
+
// release memory in IE
|
4064
|
+
div = null;
|
3875
4065
|
})();
|
3876
4066
|
|
3877
4067
|
if ( document.querySelectorAll ) {
|
3878
4068
|
(function(){
|
3879
|
-
var oldSizzle = Sizzle,
|
4069
|
+
var oldSizzle = Sizzle,
|
4070
|
+
div = document.createElement("div"),
|
4071
|
+
id = "__sizzle__";
|
4072
|
+
|
3880
4073
|
div.innerHTML = "<p class='TEST'></p>";
|
3881
4074
|
|
3882
4075
|
// Safari can't handle uppercase or unicode characters when
|
@@ -3885,9 +4078,12 @@ if ( document.querySelectorAll ) {
|
|
3885
4078
|
return;
|
3886
4079
|
}
|
3887
4080
|
|
3888
|
-
Sizzle = function(query, context, extra, seed){
|
4081
|
+
Sizzle = function( query, context, extra, seed ) {
|
3889
4082
|
context = context || document;
|
3890
4083
|
|
4084
|
+
// Make sure that attribute selectors are quoted
|
4085
|
+
query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
|
4086
|
+
|
3891
4087
|
// Only use querySelectorAll on non-XML documents
|
3892
4088
|
// (ID selectors don't work in non-HTML documents)
|
3893
4089
|
if ( !seed && !Sizzle.isXML(context) ) {
|
@@ -3901,17 +4097,19 @@ if ( document.querySelectorAll ) {
|
|
3901
4097
|
// and working up from there (Thanks to Andrew Dupont for the technique)
|
3902
4098
|
// IE 8 doesn't work on object elements
|
3903
4099
|
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
3904
|
-
var old = context.
|
4100
|
+
var old = context.getAttribute( "id" ),
|
4101
|
+
nid = old || id;
|
4102
|
+
|
4103
|
+
if ( !old ) {
|
4104
|
+
context.setAttribute( "id", nid );
|
4105
|
+
}
|
3905
4106
|
|
3906
4107
|
try {
|
3907
|
-
return makeArray( context.querySelectorAll( "#" +
|
4108
|
+
return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra );
|
3908
4109
|
|
3909
4110
|
} catch(pseudoError) {
|
3910
4111
|
} finally {
|
3911
|
-
if ( old ) {
|
3912
|
-
context.id = old;
|
3913
|
-
|
3914
|
-
} else {
|
4112
|
+
if ( !old ) {
|
3915
4113
|
context.removeAttribute( "id" );
|
3916
4114
|
}
|
3917
4115
|
}
|
@@ -3925,7 +4123,8 @@ if ( document.querySelectorAll ) {
|
|
3925
4123
|
Sizzle[ prop ] = oldSizzle[ prop ];
|
3926
4124
|
}
|
3927
4125
|
|
3928
|
-
|
4126
|
+
// release memory in IE
|
4127
|
+
div = null;
|
3929
4128
|
})();
|
3930
4129
|
}
|
3931
4130
|
|
@@ -3937,7 +4136,7 @@ if ( document.querySelectorAll ) {
|
|
3937
4136
|
try {
|
3938
4137
|
// This should fail with an exception
|
3939
4138
|
// Gecko does not error, returns false instead
|
3940
|
-
matches.call( document.documentElement, ":sizzle" );
|
4139
|
+
matches.call( document.documentElement, "[test!='']:sizzle" );
|
3941
4140
|
|
3942
4141
|
} catch( pseudoError ) {
|
3943
4142
|
pseudoWorks = true;
|
@@ -3945,13 +4144,18 @@ if ( document.querySelectorAll ) {
|
|
3945
4144
|
|
3946
4145
|
if ( matches ) {
|
3947
4146
|
Sizzle.matchesSelector = function( node, expr ) {
|
4147
|
+
// Make sure that attribute selectors are quoted
|
4148
|
+
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
|
4149
|
+
|
4150
|
+
if ( !Sizzle.isXML( node ) ) {
|
3948
4151
|
try {
|
3949
|
-
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) ) {
|
4152
|
+
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
|
3950
4153
|
return matches.call( node, expr );
|
3951
4154
|
}
|
3952
4155
|
} catch(e) {}
|
4156
|
+
}
|
3953
4157
|
|
3954
|
-
|
4158
|
+
return Sizzle(expr, null, null, [node]).length > 0;
|
3955
4159
|
};
|
3956
4160
|
}
|
3957
4161
|
})();
|
@@ -3975,22 +4179,25 @@ if ( document.querySelectorAll ) {
|
|
3975
4179
|
}
|
3976
4180
|
|
3977
4181
|
Expr.order.splice(1, 0, "CLASS");
|
3978
|
-
Expr.find.CLASS = function(match, context, isXML) {
|
4182
|
+
Expr.find.CLASS = function( match, context, isXML ) {
|
3979
4183
|
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
|
3980
4184
|
return context.getElementsByClassName(match[1]);
|
3981
4185
|
}
|
3982
4186
|
};
|
3983
4187
|
|
3984
|
-
|
4188
|
+
// release memory in IE
|
4189
|
+
div = null;
|
3985
4190
|
})();
|
3986
4191
|
|
3987
4192
|
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
3988
4193
|
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
3989
4194
|
var elem = checkSet[i];
|
4195
|
+
|
3990
4196
|
if ( elem ) {
|
3991
|
-
elem = elem[dir];
|
3992
4197
|
var match = false;
|
3993
4198
|
|
4199
|
+
elem = elem[dir];
|
4200
|
+
|
3994
4201
|
while ( elem ) {
|
3995
4202
|
if ( elem.sizcache === doneName ) {
|
3996
4203
|
match = checkSet[elem.sizset];
|
@@ -4018,9 +4225,11 @@ function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
|
4018
4225
|
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
4019
4226
|
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
4020
4227
|
var elem = checkSet[i];
|
4228
|
+
|
4021
4229
|
if ( elem ) {
|
4022
|
-
elem = elem[dir];
|
4023
4230
|
var match = false;
|
4231
|
+
|
4232
|
+
elem = elem[dir];
|
4024
4233
|
|
4025
4234
|
while ( elem ) {
|
4026
4235
|
if ( elem.sizcache === doneName ) {
|
@@ -4033,6 +4242,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
|
4033
4242
|
elem.sizcache = doneName;
|
4034
4243
|
elem.sizset = i;
|
4035
4244
|
}
|
4245
|
+
|
4036
4246
|
if ( typeof cur !== "string" ) {
|
4037
4247
|
if ( elem === cur ) {
|
4038
4248
|
match = true;
|
@@ -4053,21 +4263,34 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
|
4053
4263
|
}
|
4054
4264
|
}
|
4055
4265
|
|
4056
|
-
|
4057
|
-
|
4058
|
-
|
4059
|
-
|
4060
|
-
};
|
4266
|
+
if ( document.documentElement.contains ) {
|
4267
|
+
Sizzle.contains = function( a, b ) {
|
4268
|
+
return a !== b && (a.contains ? a.contains(b) : true);
|
4269
|
+
};
|
4061
4270
|
|
4062
|
-
|
4271
|
+
} else if ( document.documentElement.compareDocumentPosition ) {
|
4272
|
+
Sizzle.contains = function( a, b ) {
|
4273
|
+
return !!(a.compareDocumentPosition(b) & 16);
|
4274
|
+
};
|
4275
|
+
|
4276
|
+
} else {
|
4277
|
+
Sizzle.contains = function() {
|
4278
|
+
return false;
|
4279
|
+
};
|
4280
|
+
}
|
4281
|
+
|
4282
|
+
Sizzle.isXML = function( elem ) {
|
4063
4283
|
// documentElement is verified for cases where it doesn't yet exist
|
4064
4284
|
// (such as loading iframes in IE - #4833)
|
4065
4285
|
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
|
4286
|
+
|
4066
4287
|
return documentElement ? documentElement.nodeName !== "HTML" : false;
|
4067
4288
|
};
|
4068
4289
|
|
4069
|
-
var posProcess = function(selector, context){
|
4070
|
-
var
|
4290
|
+
var posProcess = function( selector, context ) {
|
4291
|
+
var match,
|
4292
|
+
tmpSet = [],
|
4293
|
+
later = "",
|
4071
4294
|
root = context.nodeType ? [context] : context;
|
4072
4295
|
|
4073
4296
|
// Position selectors must be done after the filter
|
@@ -4109,7 +4332,8 @@ var runtil = /Until$/,
|
|
4109
4332
|
|
4110
4333
|
jQuery.fn.extend({
|
4111
4334
|
find: function( selector ) {
|
4112
|
-
var ret = this.pushStack( "", "find", selector ),
|
4335
|
+
var ret = this.pushStack( "", "find", selector ),
|
4336
|
+
length = 0;
|
4113
4337
|
|
4114
4338
|
for ( var i = 0, l = this.length; i < l; i++ ) {
|
4115
4339
|
length = ret.length;
|
@@ -4158,7 +4382,9 @@ jQuery.fn.extend({
|
|
4158
4382
|
var ret = [], i, l, cur = this[0];
|
4159
4383
|
|
4160
4384
|
if ( jQuery.isArray( selectors ) ) {
|
4161
|
-
var match,
|
4385
|
+
var match, selector,
|
4386
|
+
matches = {},
|
4387
|
+
level = 1;
|
4162
4388
|
|
4163
4389
|
if ( cur && selectors.length ) {
|
4164
4390
|
for ( i = 0, l = selectors.length; i < l; i++ ) {
|
@@ -4324,7 +4550,9 @@ jQuery.extend({
|
|
4324
4550
|
},
|
4325
4551
|
|
4326
4552
|
dir: function( elem, dir, until ) {
|
4327
|
-
var matched = [],
|
4553
|
+
var matched = [],
|
4554
|
+
cur = elem[ dir ];
|
4555
|
+
|
4328
4556
|
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
|
4329
4557
|
if ( cur.nodeType === 1 ) {
|
4330
4558
|
matched.push( cur );
|
@@ -4400,7 +4628,8 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
|
4400
4628
|
rtbody = /<tbody/i,
|
4401
4629
|
rhtml = /<|&#?\w+;/,
|
4402
4630
|
rnocache = /<(?:script|object|embed|option|style)/i,
|
4403
|
-
|
4631
|
+
// checked="checked" or checked (html5)
|
4632
|
+
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
4404
4633
|
raction = /\=([^="'>\s]+\/)>/g,
|
4405
4634
|
wrapMap = {
|
4406
4635
|
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
@@ -4426,7 +4655,8 @@ jQuery.fn.extend({
|
|
4426
4655
|
text: function( text ) {
|
4427
4656
|
if ( jQuery.isFunction(text) ) {
|
4428
4657
|
return this.each(function(i) {
|
4429
|
-
var self = jQuery(this);
|
4658
|
+
var self = jQuery( this );
|
4659
|
+
|
4430
4660
|
self.text( text.call(this, i, self.text()) );
|
4431
4661
|
});
|
4432
4662
|
}
|
@@ -4475,7 +4705,8 @@ jQuery.fn.extend({
|
|
4475
4705
|
}
|
4476
4706
|
|
4477
4707
|
return this.each(function() {
|
4478
|
-
var self = jQuery( this ),
|
4708
|
+
var self = jQuery( this ),
|
4709
|
+
contents = self.contents();
|
4479
4710
|
|
4480
4711
|
if ( contents.length ) {
|
4481
4712
|
contents.wrapAll( html );
|
@@ -4586,7 +4817,9 @@ jQuery.fn.extend({
|
|
4586
4817
|
// attributes in IE that are actually only stored
|
4587
4818
|
// as properties will not be copied (such as the
|
4588
4819
|
// the name attribute on an input).
|
4589
|
-
var html = this.outerHTML,
|
4820
|
+
var html = this.outerHTML,
|
4821
|
+
ownerDocument = this.ownerDocument;
|
4822
|
+
|
4590
4823
|
if ( !html ) {
|
4591
4824
|
var div = ownerDocument.createElement("div");
|
4592
4825
|
div.appendChild( this.cloneNode(true) );
|
@@ -4641,7 +4874,8 @@ jQuery.fn.extend({
|
|
4641
4874
|
|
4642
4875
|
} else if ( jQuery.isFunction( value ) ) {
|
4643
4876
|
this.each(function(i){
|
4644
|
-
var self = jQuery(this);
|
4877
|
+
var self = jQuery( this );
|
4878
|
+
|
4645
4879
|
self.html( value.call(this, i, self.html()) );
|
4646
4880
|
});
|
4647
4881
|
|
@@ -4664,13 +4898,14 @@ jQuery.fn.extend({
|
|
4664
4898
|
}
|
4665
4899
|
|
4666
4900
|
if ( typeof value !== "string" ) {
|
4667
|
-
value = jQuery(value).detach();
|
4901
|
+
value = jQuery( value ).detach();
|
4668
4902
|
}
|
4669
4903
|
|
4670
4904
|
return this.each(function() {
|
4671
|
-
var next = this.nextSibling,
|
4905
|
+
var next = this.nextSibling,
|
4906
|
+
parent = this.parentNode;
|
4672
4907
|
|
4673
|
-
jQuery(this).remove();
|
4908
|
+
jQuery( this ).remove();
|
4674
4909
|
|
4675
4910
|
if ( next ) {
|
4676
4911
|
jQuery(next).before( value );
|
@@ -4688,7 +4923,9 @@ jQuery.fn.extend({
|
|
4688
4923
|
},
|
4689
4924
|
|
4690
4925
|
domManip: function( args, table, callback ) {
|
4691
|
-
var results, first,
|
4926
|
+
var results, first, fragment, parent,
|
4927
|
+
value = args[0],
|
4928
|
+
scripts = [];
|
4692
4929
|
|
4693
4930
|
// We can't cloneNode fragments that contain checked, in WebKit
|
4694
4931
|
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
|
@@ -4763,7 +5000,9 @@ function cloneCopyEvent(orig, ret) {
|
|
4763
5000
|
return;
|
4764
5001
|
}
|
4765
5002
|
|
4766
|
-
var oldData = jQuery.data( orig[i++] ),
|
5003
|
+
var oldData = jQuery.data( orig[i++] ),
|
5004
|
+
curData = jQuery.data( this, oldData ),
|
5005
|
+
events = oldData && oldData.events;
|
4767
5006
|
|
4768
5007
|
if ( events ) {
|
4769
5008
|
delete curData.handle;
|
@@ -4820,7 +5059,8 @@ jQuery.each({
|
|
4820
5059
|
replaceAll: "replaceWith"
|
4821
5060
|
}, function( name, original ) {
|
4822
5061
|
jQuery.fn[ name ] = function( selector ) {
|
4823
|
-
var ret = [],
|
5062
|
+
var ret = [],
|
5063
|
+
insert = jQuery( selector ),
|
4824
5064
|
parent = this.length === 1 && this[0].parentNode;
|
4825
5065
|
|
4826
5066
|
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
|
@@ -5004,8 +5244,8 @@ var ralpha = /alpha\([^)]*\)/i,
|
|
5004
5244
|
cssHeight = [ "Top", "Bottom" ],
|
5005
5245
|
curCSS,
|
5006
5246
|
|
5007
|
-
|
5008
|
-
|
5247
|
+
getComputedStyle,
|
5248
|
+
currentStyle,
|
5009
5249
|
|
5010
5250
|
fcamelCase = function( all, letter ) {
|
5011
5251
|
return letter.toUpperCase();
|
@@ -5161,7 +5401,29 @@ jQuery.each(["height", "width"], function( i, name ) {
|
|
5161
5401
|
});
|
5162
5402
|
}
|
5163
5403
|
|
5164
|
-
|
5404
|
+
if ( val <= 0 ) {
|
5405
|
+
val = curCSS( elem, name, name );
|
5406
|
+
|
5407
|
+
if ( val === "0px" && currentStyle ) {
|
5408
|
+
val = currentStyle( elem, name, name );
|
5409
|
+
}
|
5410
|
+
|
5411
|
+
if ( val != null ) {
|
5412
|
+
// Should return "auto" instead of 0, use 0 for
|
5413
|
+
// temporary backwards-compat
|
5414
|
+
return val === "" || val === "auto" ? "0px" : val;
|
5415
|
+
}
|
5416
|
+
}
|
5417
|
+
|
5418
|
+
if ( val < 0 || val == null ) {
|
5419
|
+
val = elem.style[ name ];
|
5420
|
+
|
5421
|
+
// Should return "auto" instead of 0, use 0 for
|
5422
|
+
// temporary backwards-compat
|
5423
|
+
return val === "" || val === "auto" ? "0px" : val;
|
5424
|
+
}
|
5425
|
+
|
5426
|
+
return typeof val === "string" ? val : val + "px";
|
5165
5427
|
}
|
5166
5428
|
},
|
5167
5429
|
|
@@ -5210,8 +5472,8 @@ if ( !jQuery.support.opacity ) {
|
|
5210
5472
|
};
|
5211
5473
|
}
|
5212
5474
|
|
5213
|
-
if ( getComputedStyle ) {
|
5214
|
-
|
5475
|
+
if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
5476
|
+
getComputedStyle = function( elem, newName, name ) {
|
5215
5477
|
var ret, defaultView, computedStyle;
|
5216
5478
|
|
5217
5479
|
name = name.replace( rupper, "-$1" ).toLowerCase();
|
@@ -5229,10 +5491,13 @@ if ( getComputedStyle ) {
|
|
5229
5491
|
|
5230
5492
|
return ret;
|
5231
5493
|
};
|
5494
|
+
}
|
5232
5495
|
|
5233
|
-
|
5234
|
-
|
5235
|
-
var left, rsLeft,
|
5496
|
+
if ( document.documentElement.currentStyle ) {
|
5497
|
+
currentStyle = function( elem, name ) {
|
5498
|
+
var left, rsLeft,
|
5499
|
+
ret = elem.currentStyle && elem.currentStyle[ name ],
|
5500
|
+
style = elem.style;
|
5236
5501
|
|
5237
5502
|
// From the awesome hack by Dean Edwards
|
5238
5503
|
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
@@ -5254,10 +5519,12 @@ if ( getComputedStyle ) {
|
|
5254
5519
|
elem.runtimeStyle.left = rsLeft;
|
5255
5520
|
}
|
5256
5521
|
|
5257
|
-
return ret;
|
5522
|
+
return ret === "" ? "auto" : ret;
|
5258
5523
|
};
|
5259
5524
|
}
|
5260
5525
|
|
5526
|
+
curCSS = getComputedStyle || currentStyle;
|
5527
|
+
|
5261
5528
|
function getWH( elem, name, extra ) {
|
5262
5529
|
var which = name === "width" ? cssWidth : cssHeight,
|
5263
5530
|
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
|
@@ -5284,7 +5551,8 @@ function getWH( elem, name, extra ) {
|
|
5284
5551
|
|
5285
5552
|
if ( jQuery.expr && jQuery.expr.filters ) {
|
5286
5553
|
jQuery.expr.filters.hidden = function( elem ) {
|
5287
|
-
var width = elem.offsetWidth,
|
5554
|
+
var width = elem.offsetWidth,
|
5555
|
+
height = elem.offsetHeight;
|
5288
5556
|
|
5289
5557
|
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
|
5290
5558
|
};
|
@@ -5301,7 +5569,7 @@ var jsc = jQuery.now(),
|
|
5301
5569
|
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
5302
5570
|
rselectTextarea = /^(?:select|textarea)/i,
|
5303
5571
|
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
5304
|
-
rnoContent = /^(?:GET|HEAD
|
5572
|
+
rnoContent = /^(?:GET|HEAD)$/,
|
5305
5573
|
rbracket = /\[\]$/,
|
5306
5574
|
jsre = /\=\?(&|$)/,
|
5307
5575
|
rquery = /\?/,
|
@@ -5536,10 +5804,6 @@ jQuery.extend({
|
|
5536
5804
|
var customJsonp = window[ jsonp ];
|
5537
5805
|
|
5538
5806
|
window[ jsonp ] = function( tmp ) {
|
5539
|
-
data = tmp;
|
5540
|
-
jQuery.handleSuccess( s, xhr, status, data );
|
5541
|
-
jQuery.handleComplete( s, xhr, status, data );
|
5542
|
-
|
5543
5807
|
if ( jQuery.isFunction( customJsonp ) ) {
|
5544
5808
|
customJsonp( tmp );
|
5545
5809
|
|
@@ -5551,6 +5815,10 @@ jQuery.extend({
|
|
5551
5815
|
delete window[ jsonp ];
|
5552
5816
|
} catch( jsonpError ) {}
|
5553
5817
|
}
|
5818
|
+
|
5819
|
+
data = tmp;
|
5820
|
+
jQuery.handleSuccess( s, xhr, status, data );
|
5821
|
+
jQuery.handleComplete( s, xhr, status, data );
|
5554
5822
|
|
5555
5823
|
if ( head ) {
|
5556
5824
|
head.removeChild( script );
|
@@ -5562,7 +5830,7 @@ jQuery.extend({
|
|
5562
5830
|
s.cache = false;
|
5563
5831
|
}
|
5564
5832
|
|
5565
|
-
if ( s.cache === false &&
|
5833
|
+
if ( s.cache === false && noContent ) {
|
5566
5834
|
var ts = jQuery.now();
|
5567
5835
|
|
5568
5836
|
// try replacing _= if it is there
|
@@ -5572,8 +5840,8 @@ jQuery.extend({
|
|
5572
5840
|
s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
|
5573
5841
|
}
|
5574
5842
|
|
5575
|
-
// If data is available, append data to url for
|
5576
|
-
if ( s.data &&
|
5843
|
+
// If data is available, append data to url for GET/HEAD requests
|
5844
|
+
if ( s.data && noContent ) {
|
5577
5845
|
s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
|
5578
5846
|
}
|
5579
5847
|
|
@@ -5584,7 +5852,7 @@ jQuery.extend({
|
|
5584
5852
|
|
5585
5853
|
// Matches an absolute URL, and saves the domain
|
5586
5854
|
var parts = rurl.exec( s.url ),
|
5587
|
-
remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
|
5855
|
+
remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
|
5588
5856
|
|
5589
5857
|
// If we're requesting a remote document
|
5590
5858
|
// and trying to load JSON or Script with a GET
|
@@ -5760,10 +6028,11 @@ jQuery.extend({
|
|
5760
6028
|
try {
|
5761
6029
|
var oldAbort = xhr.abort;
|
5762
6030
|
xhr.abort = function() {
|
5763
|
-
|
5764
|
-
|
5765
|
-
|
5766
|
-
|
6031
|
+
if ( xhr ) {
|
6032
|
+
// oldAbort has no call property in IE7 so
|
6033
|
+
// just do it this way, which works in all
|
6034
|
+
// browsers
|
6035
|
+
Function.prototype.call.call( oldAbort, xhr );
|
5767
6036
|
}
|
5768
6037
|
|
5769
6038
|
onreadystatechange( "abort" );
|
@@ -5803,11 +6072,12 @@ jQuery.extend({
|
|
5803
6072
|
// Serialize an array of form elements or a set of
|
5804
6073
|
// key/values into a query string
|
5805
6074
|
param: function( a, traditional ) {
|
5806
|
-
var s = [],
|
5807
|
-
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
6075
|
+
var s = [],
|
6076
|
+
add = function( key, value ) {
|
6077
|
+
// If value is a function, invoke it and return its value
|
6078
|
+
value = jQuery.isFunction(value) ? value() : value;
|
6079
|
+
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
|
6080
|
+
};
|
5811
6081
|
|
5812
6082
|
// Set traditional to true for jQuery <= 1.3.2 behavior.
|
5813
6083
|
if ( traditional === undefined ) {
|
@@ -6029,28 +6299,39 @@ var elemdisplay = {},
|
|
6029
6299
|
|
6030
6300
|
jQuery.fn.extend({
|
6031
6301
|
show: function( speed, easing, callback ) {
|
6302
|
+
var elem, display;
|
6303
|
+
|
6032
6304
|
if ( speed || speed === 0 ) {
|
6033
6305
|
return this.animate( genFx("show", 3), speed, easing, callback);
|
6306
|
+
|
6034
6307
|
} else {
|
6035
6308
|
for ( var i = 0, j = this.length; i < j; i++ ) {
|
6309
|
+
elem = this[i];
|
6310
|
+
display = elem.style.display;
|
6311
|
+
|
6036
6312
|
// Reset the inline display of this element to learn if it is
|
6037
6313
|
// being hidden by cascaded rules or not
|
6038
|
-
if ( !jQuery.data(
|
6039
|
-
|
6314
|
+
if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
|
6315
|
+
display = elem.style.display = "";
|
6040
6316
|
}
|
6041
6317
|
|
6042
6318
|
// Set elements which have been overridden with display: none
|
6043
6319
|
// in a stylesheet to whatever the default browser style is
|
6044
6320
|
// for such an element
|
6045
|
-
if (
|
6046
|
-
jQuery.data(
|
6321
|
+
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
|
6322
|
+
jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
|
6047
6323
|
}
|
6048
6324
|
}
|
6049
6325
|
|
6050
6326
|
// Set the display of most of the elements in a second loop
|
6051
6327
|
// to avoid the constant reflow
|
6052
6328
|
for ( i = 0; i < j; i++ ) {
|
6053
|
-
|
6329
|
+
elem = this[i];
|
6330
|
+
display = elem.style.display;
|
6331
|
+
|
6332
|
+
if ( display === "" || display === "none" ) {
|
6333
|
+
elem.style.display = jQuery.data(elem, "olddisplay") || "";
|
6334
|
+
}
|
6054
6335
|
}
|
6055
6336
|
|
6056
6337
|
return this;
|
@@ -6115,7 +6396,7 @@ jQuery.fn.extend({
|
|
6115
6396
|
}
|
6116
6397
|
|
6117
6398
|
return this[ optall.queue === false ? "each" : "queue" ](function() {
|
6118
|
-
// XXX
|
6399
|
+
// XXX 'this' does not always have a nodeName when running the
|
6119
6400
|
// test suite
|
6120
6401
|
|
6121
6402
|
var opt = jQuery.extend({}, optall), p,
|
@@ -6188,7 +6469,7 @@ jQuery.fn.extend({
|
|
6188
6469
|
|
6189
6470
|
} else {
|
6190
6471
|
var parts = rfxnum.exec(val),
|
6191
|
-
start = e.cur(
|
6472
|
+
start = e.cur() || 0;
|
6192
6473
|
|
6193
6474
|
if ( parts ) {
|
6194
6475
|
var end = parseFloat( parts[2] ),
|
@@ -6197,7 +6478,7 @@ jQuery.fn.extend({
|
|
6197
6478
|
// We need to compute starting value
|
6198
6479
|
if ( unit !== "px" ) {
|
6199
6480
|
jQuery.style( self, name, (end || 1) + unit);
|
6200
|
-
start = ((end || 1) / e.cur(
|
6481
|
+
start = ((end || 1) / e.cur()) * start;
|
6201
6482
|
jQuery.style( self, name, start + unit);
|
6202
6483
|
}
|
6203
6484
|
|
@@ -6266,7 +6547,8 @@ jQuery.each({
|
|
6266
6547
|
slideUp: genFx("hide", 1),
|
6267
6548
|
slideToggle: genFx("toggle", 1),
|
6268
6549
|
fadeIn: { opacity: "show" },
|
6269
|
-
fadeOut: { opacity: "hide" }
|
6550
|
+
fadeOut: { opacity: "hide" },
|
6551
|
+
fadeToggle: { opacity: "toggle" }
|
6270
6552
|
}, function( name, props ) {
|
6271
6553
|
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
6272
6554
|
return this.animate( props, speed, easing, callback );
|
@@ -6344,6 +6626,9 @@ jQuery.fx.prototype = {
|
|
6344
6626
|
|
6345
6627
|
// Start an animation from one number to another
|
6346
6628
|
custom: function( from, to, unit ) {
|
6629
|
+
var self = this,
|
6630
|
+
fx = jQuery.fx;
|
6631
|
+
|
6347
6632
|
this.startTime = jQuery.now();
|
6348
6633
|
this.start = from;
|
6349
6634
|
this.end = to;
|
@@ -6351,7 +6636,6 @@ jQuery.fx.prototype = {
|
|
6351
6636
|
this.now = this.start;
|
6352
6637
|
this.pos = this.state = 0;
|
6353
6638
|
|
6354
|
-
var self = this, fx = jQuery.fx;
|
6355
6639
|
function t( gotoEnd ) {
|
6356
6640
|
return self.step(gotoEnd);
|
6357
6641
|
}
|
@@ -6408,7 +6692,9 @@ jQuery.fx.prototype = {
|
|
6408
6692
|
if ( done ) {
|
6409
6693
|
// Reset the overflow
|
6410
6694
|
if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
|
6411
|
-
var elem = this.elem,
|
6695
|
+
var elem = this.elem,
|
6696
|
+
options = this.options;
|
6697
|
+
|
6412
6698
|
jQuery.each( [ "", "X", "Y" ], function (index, value) {
|
6413
6699
|
elem.style[ "overflow" + value ] = options.overflow[index];
|
6414
6700
|
} );
|
@@ -6587,11 +6873,16 @@ if ( "getBoundingClientRect" in document.documentElement ) {
|
|
6587
6873
|
|
6588
6874
|
jQuery.offset.initialize();
|
6589
6875
|
|
6590
|
-
var
|
6591
|
-
|
6592
|
-
|
6876
|
+
var computedStyle,
|
6877
|
+
offsetParent = elem.offsetParent,
|
6878
|
+
prevOffsetParent = elem,
|
6879
|
+
doc = elem.ownerDocument,
|
6880
|
+
docElem = doc.documentElement,
|
6881
|
+
body = doc.body,
|
6882
|
+
defaultView = doc.defaultView,
|
6593
6883
|
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
|
6594
|
-
top = elem.offsetTop,
|
6884
|
+
top = elem.offsetTop,
|
6885
|
+
left = elem.offsetLeft;
|
6595
6886
|
|
6596
6887
|
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
|
6597
6888
|
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
|
@@ -6673,7 +6964,8 @@ jQuery.offset = {
|
|
6673
6964
|
},
|
6674
6965
|
|
6675
6966
|
bodyOffset: function( body ) {
|
6676
|
-
var top = body.offsetTop,
|
6967
|
+
var top = body.offsetTop,
|
6968
|
+
left = body.offsetLeft;
|
6677
6969
|
|
6678
6970
|
jQuery.offset.initialize();
|
6679
6971
|
|
@@ -6854,27 +7146,31 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
|
|
6854
7146
|
});
|
6855
7147
|
}
|
6856
7148
|
|
6857
|
-
|
7149
|
+
if ( jQuery.isWindow( elem ) ) {
|
6858
7150
|
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
|
6859
|
-
elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
|
6860
|
-
|
6861
|
-
|
6862
|
-
|
6863
|
-
|
6864
|
-
|
6865
|
-
|
6866
|
-
|
6867
|
-
|
6868
|
-
|
6869
|
-
|
6870
|
-
|
6871
|
-
|
6872
|
-
|
6873
|
-
|
6874
|
-
|
6875
|
-
|
6876
|
-
|
6877
|
-
|
7151
|
+
return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
|
7152
|
+
elem.document.body[ "client" + name ];
|
7153
|
+
|
7154
|
+
// Get document width or height
|
7155
|
+
} else if ( elem.nodeType === 9 ) {
|
7156
|
+
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
|
7157
|
+
return Math.max(
|
7158
|
+
elem.documentElement["client" + name],
|
7159
|
+
elem.body["scroll" + name], elem.documentElement["scroll" + name],
|
7160
|
+
elem.body["offset" + name], elem.documentElement["offset" + name]
|
7161
|
+
);
|
7162
|
+
|
7163
|
+
// Get or set width or height on the element
|
7164
|
+
} else if ( size === undefined ) {
|
7165
|
+
var orig = jQuery.css( elem, type ),
|
7166
|
+
ret = parseFloat( orig );
|
7167
|
+
|
7168
|
+
return jQuery.isNaN( ret ) ? orig : ret;
|
7169
|
+
|
7170
|
+
// Set the width or height on the element (default to pixels if value is unitless)
|
7171
|
+
} else {
|
7172
|
+
return this.css( type, typeof size === "string" ? size : size + "px" );
|
7173
|
+
}
|
6878
7174
|
};
|
6879
7175
|
|
6880
7176
|
});
|