author | Julien Cristau <julien.cristau@logilab.fr> |
Thu, 03 Jul 2014 12:18:34 +0200 | |
changeset 9867 | 7f36f31d8828 |
parent 9388 | 4c34a63bd113 |
permissions | -rw-r--r-- |
6448
8590d82e9b1b
[javascript] update to jQuery 1.4.2 and jQuery-ui 1.8.5
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
5767
diff
changeset
|
1 |
/*! |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2 |
* jQuery JavaScript Library v1.10.2 |
1893
80715c23bacf
use jquery1.3 (this might break a few things)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
3 |
* http://jquery.com/ |
0 | 4 |
* |
6448
8590d82e9b1b
[javascript] update to jQuery 1.4.2 and jQuery-ui 1.8.5
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
5767
diff
changeset
|
5 |
* Includes Sizzle.js |
8590d82e9b1b
[javascript] update to jQuery 1.4.2 and jQuery-ui 1.8.5
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
5767
diff
changeset
|
6 |
* http://sizzlejs.com/ |
0 | 7 |
* |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8 |
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9 |
* Released under the MIT license |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
10 |
* http://jquery.org/license |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
11 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
12 |
* Date: 2013-07-03T13:48Z |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
13 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
14 |
(function( window, undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
15 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
16 |
// Can't do this because several apps including ASP.NET trace |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
17 |
// the stack via arguments.caller.callee and Firefox dies if |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
18 |
// you try to trace through "use strict" call chains. (#13335) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
19 |
// Support: Firefox 18+ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
20 |
//"use strict"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
21 |
var |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
22 |
// The deferred used on DOM ready |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
23 |
readyList, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
24 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
25 |
// A central reference to the root jQuery(document) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
26 |
rootjQuery, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
27 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
28 |
// Support: IE<10 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
29 |
// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
30 |
core_strundefined = typeof undefined, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
31 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
32 |
// Use the correct document accordingly with window argument (sandbox) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
33 |
location = window.location, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
34 |
document = window.document, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
35 |
docElem = document.documentElement, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
36 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
37 |
// Map over jQuery in case of overwrite |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
38 |
_jQuery = window.jQuery, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
39 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
40 |
// Map over the $ in case of overwrite |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
41 |
_$ = window.$, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
42 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
43 |
// [[Class]] -> type pairs |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
44 |
class2type = {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
45 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
46 |
// List of deleted data cache ids, so we can reuse them |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
47 |
core_deletedIds = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
48 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
49 |
core_version = "1.10.2", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
50 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
51 |
// Save a reference to some core methods |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
52 |
core_concat = core_deletedIds.concat, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
53 |
core_push = core_deletedIds.push, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
54 |
core_slice = core_deletedIds.slice, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
55 |
core_indexOf = core_deletedIds.indexOf, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
56 |
core_toString = class2type.toString, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
57 |
core_hasOwn = class2type.hasOwnProperty, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
58 |
core_trim = core_version.trim, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
59 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
60 |
// Define a local copy of jQuery |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
61 |
jQuery = function( selector, context ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
62 |
// The jQuery object is actually just the init constructor 'enhanced' |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
63 |
return new jQuery.fn.init( selector, context, rootjQuery ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
64 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
65 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
66 |
// Used for matching numbers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
67 |
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
68 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
69 |
// Used for splitting on whitespace |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
70 |
core_rnotwhite = /\S+/g, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
71 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
72 |
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
73 |
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
74 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
75 |
// A simple way to check for HTML strings |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
76 |
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521) |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
77 |
// Strict HTML recognition (#11290: must start with <) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
78 |
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
79 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
80 |
// Match a standalone tag |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
81 |
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
82 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
83 |
// JSON RegExp |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
84 |
rvalidchars = /^[\],:{}\s]*$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
85 |
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
86 |
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
87 |
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
88 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
89 |
// Matches dashed string for camelizing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
90 |
rmsPrefix = /^-ms-/, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
91 |
rdashAlpha = /-([\da-z])/gi, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
92 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
93 |
// Used by jQuery.camelCase as callback to replace() |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
94 |
fcamelCase = function( all, letter ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
95 |
return letter.toUpperCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
96 |
}, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
97 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
98 |
// The ready event handler |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
99 |
completed = function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
100 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
101 |
// readyState === "complete" is good enough for us to call the dom ready in oldIE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
102 |
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
103 |
detach(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
104 |
jQuery.ready(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
105 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
106 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
107 |
// Clean-up method for dom ready events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
108 |
detach = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
109 |
if ( document.addEventListener ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
110 |
document.removeEventListener( "DOMContentLoaded", completed, false ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
111 |
window.removeEventListener( "load", completed, false ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
112 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
113 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
114 |
document.detachEvent( "onreadystatechange", completed ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
115 |
window.detachEvent( "onload", completed ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
116 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
117 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
118 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
119 |
jQuery.fn = jQuery.prototype = { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
120 |
// The current version of jQuery being used |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
121 |
jquery: core_version, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
122 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
123 |
constructor: jQuery, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
124 |
init: function( selector, context, rootjQuery ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
125 |
var match, elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
126 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
127 |
// HANDLE: $(""), $(null), $(undefined), $(false) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
128 |
if ( !selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
129 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
130 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
131 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
132 |
// Handle HTML strings |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
133 |
if ( typeof selector === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
134 |
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
135 |
// Assume that strings that start and end with <> are HTML and skip the regex check |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
136 |
match = [ null, selector, null ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
137 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
138 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
139 |
match = rquickExpr.exec( selector ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
140 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
141 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
142 |
// Match html or make sure no context is specified for #id |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
143 |
if ( match && (match[1] || !context) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
144 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
145 |
// HANDLE: $(html) -> $(array) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
146 |
if ( match[1] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
147 |
context = context instanceof jQuery ? context[0] : context; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
148 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
149 |
// scripts is true for back-compat |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
150 |
jQuery.merge( this, jQuery.parseHTML( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
151 |
match[1], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
152 |
context && context.nodeType ? context.ownerDocument || context : document, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
153 |
true |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
154 |
) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
155 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
156 |
// HANDLE: $(html, props) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
157 |
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
158 |
for ( match in context ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
159 |
// Properties of context are called as methods if possible |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
160 |
if ( jQuery.isFunction( this[ match ] ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
161 |
this[ match ]( context[ match ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
162 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
163 |
// ...and otherwise set as attributes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
164 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
165 |
this.attr( match, context[ match ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
166 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
167 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
168 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
169 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
170 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
171 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
172 |
// HANDLE: $(#id) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
173 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
174 |
elem = document.getElementById( match[2] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
175 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
176 |
// Check parentNode to catch when Blackberry 4.6 returns |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
177 |
// nodes that are no longer in the document #6963 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
178 |
if ( elem && elem.parentNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
179 |
// Handle the case where IE and Opera return items |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
180 |
// by name instead of ID |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
181 |
if ( elem.id !== match[2] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
182 |
return rootjQuery.find( selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
183 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
184 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
185 |
// Otherwise, we inject the element directly into the jQuery object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
186 |
this.length = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
187 |
this[0] = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
188 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
189 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
190 |
this.context = document; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
191 |
this.selector = selector; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
192 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
193 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
194 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
195 |
// HANDLE: $(expr, $(...)) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
196 |
} else if ( !context || context.jquery ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
197 |
return ( context || rootjQuery ).find( selector ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
198 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
199 |
// HANDLE: $(expr, context) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
200 |
// (which is just equivalent to: $(context).find(expr) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
201 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
202 |
return this.constructor( context ).find( selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
203 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
204 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
205 |
// HANDLE: $(DOMElement) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
206 |
} else if ( selector.nodeType ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
207 |
this.context = this[0] = selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
208 |
this.length = 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
209 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
210 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
211 |
// HANDLE: $(function) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
212 |
// Shortcut for document ready |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
213 |
} else if ( jQuery.isFunction( selector ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
214 |
return rootjQuery.ready( selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
215 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
216 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
217 |
if ( selector.selector !== undefined ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
218 |
this.selector = selector.selector; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
219 |
this.context = selector.context; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
220 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
221 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
222 |
return jQuery.makeArray( selector, this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
223 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
224 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
225 |
// Start with an empty selector |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
226 |
selector: "", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
227 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
228 |
// The default length of a jQuery object is 0 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
229 |
length: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
230 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
231 |
toArray: function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
232 |
return core_slice.call( this ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
233 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
234 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
235 |
// Get the Nth element in the matched element set OR |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
236 |
// Get the whole matched element set as a clean array |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
237 |
get: function( num ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
238 |
return num == null ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
239 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
240 |
// Return a 'clean' array |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
241 |
this.toArray() : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
242 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
243 |
// Return just the object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
244 |
( num < 0 ? this[ this.length + num ] : this[ num ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
245 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
246 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
247 |
// Take an array of elements and push it onto the stack |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
248 |
// (returning the new matched element set) |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
249 |
pushStack: function( elems ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
250 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
251 |
// Build a new jQuery matched element set |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
252 |
var ret = jQuery.merge( this.constructor(), elems ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
253 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
254 |
// Add the old object onto the stack (as a reference) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
255 |
ret.prevObject = this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
256 |
ret.context = this.context; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
257 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
258 |
// Return the newly-formed element set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
259 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
260 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
261 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
262 |
// Execute a callback for every element in the matched set. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
263 |
// (You can seed the arguments with an array of args, but this is |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
264 |
// only used internally.) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
265 |
each: function( callback, args ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
266 |
return jQuery.each( this, callback, args ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
267 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
268 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
269 |
ready: function( fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
270 |
// Add the callback |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
271 |
jQuery.ready.promise().done( fn ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
272 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
273 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
274 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
275 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
276 |
slice: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
277 |
return this.pushStack( core_slice.apply( this, arguments ) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
278 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
279 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
280 |
first: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
281 |
return this.eq( 0 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
282 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
283 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
284 |
last: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
285 |
return this.eq( -1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
286 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
287 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
288 |
eq: function( i ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
289 |
var len = this.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
290 |
j = +i + ( i < 0 ? len : 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
291 |
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
292 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
293 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
294 |
map: function( callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
295 |
return this.pushStack( jQuery.map(this, function( elem, i ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
296 |
return callback.call( elem, i, elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
297 |
})); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
298 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
299 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
300 |
end: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
301 |
return this.prevObject || this.constructor(null); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
302 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
303 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
304 |
// For internal use only. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
305 |
// Behaves like an Array's method, not like a jQuery method. |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
306 |
push: core_push, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
307 |
sort: [].sort, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
308 |
splice: [].splice |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
309 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
310 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
311 |
// Give the init function the jQuery prototype for later instantiation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
312 |
jQuery.fn.init.prototype = jQuery.fn; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
313 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
314 |
jQuery.extend = jQuery.fn.extend = function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
315 |
var src, copyIsArray, copy, name, options, clone, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
316 |
target = arguments[0] || {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
317 |
i = 1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
318 |
length = arguments.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
319 |
deep = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
320 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
321 |
// Handle a deep copy situation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
322 |
if ( typeof target === "boolean" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
323 |
deep = target; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
324 |
target = arguments[1] || {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
325 |
// skip the boolean and the target |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
326 |
i = 2; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
327 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
328 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
329 |
// Handle case when target is a string or something (possible in deep copy) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
330 |
if ( typeof target !== "object" && !jQuery.isFunction(target) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
331 |
target = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
332 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
333 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
334 |
// extend jQuery itself if only one argument is passed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
335 |
if ( length === i ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
336 |
target = this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
337 |
--i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
338 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
339 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
340 |
for ( ; i < length; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
341 |
// Only deal with non-null/undefined values |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
342 |
if ( (options = arguments[ i ]) != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
343 |
// Extend the base object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
344 |
for ( name in options ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
345 |
src = target[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
346 |
copy = options[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
347 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
348 |
// Prevent never-ending loop |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
349 |
if ( target === copy ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
350 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
351 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
352 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
353 |
// Recurse if we're merging plain objects or arrays |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
354 |
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
355 |
if ( copyIsArray ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
356 |
copyIsArray = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
357 |
clone = src && jQuery.isArray(src) ? src : []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
358 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
359 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
360 |
clone = src && jQuery.isPlainObject(src) ? src : {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
361 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
362 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
363 |
// Never move original objects, clone them |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
364 |
target[ name ] = jQuery.extend( deep, clone, copy ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
365 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
366 |
// Don't bring in undefined values |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
367 |
} else if ( copy !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
368 |
target[ name ] = copy; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
369 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
370 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
371 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
372 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
373 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
374 |
// Return the modified object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
375 |
return target; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
376 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
377 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
378 |
jQuery.extend({ |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
379 |
// Unique for each copy of jQuery on the page |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
380 |
// Non-digits removed to match rinlinejQuery |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
381 |
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
382 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
383 |
noConflict: function( deep ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
384 |
if ( window.$ === jQuery ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
385 |
window.$ = _$; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
386 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
387 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
388 |
if ( deep && window.jQuery === jQuery ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
389 |
window.jQuery = _jQuery; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
390 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
391 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
392 |
return jQuery; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
393 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
394 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
395 |
// Is the DOM ready to be used? Set to true once it occurs. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
396 |
isReady: false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
397 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
398 |
// A counter to track how many items to wait for before |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
399 |
// the ready event fires. See #6781 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
400 |
readyWait: 1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
401 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
402 |
// Hold (or release) the ready event |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
403 |
holdReady: function( hold ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
404 |
if ( hold ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
405 |
jQuery.readyWait++; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
406 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
407 |
jQuery.ready( true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
408 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
409 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
410 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
411 |
// Handle when the DOM is ready |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
412 |
ready: function( wait ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
413 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
414 |
// Abort if there are pending holds or we're already ready |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
415 |
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
416 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
417 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
418 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
419 |
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
420 |
if ( !document.body ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
421 |
return setTimeout( jQuery.ready ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
422 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
423 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
424 |
// Remember that the DOM is ready |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
425 |
jQuery.isReady = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
426 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
427 |
// If a normal DOM Ready event fired, decrement, and wait if need be |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
428 |
if ( wait !== true && --jQuery.readyWait > 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
429 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
430 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
431 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
432 |
// If there are functions bound, to execute |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
433 |
readyList.resolveWith( document, [ jQuery ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
434 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
435 |
// Trigger any bound ready events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
436 |
if ( jQuery.fn.trigger ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
437 |
jQuery( document ).trigger("ready").off("ready"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
438 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
439 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
440 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
441 |
// See test/unit/core.js for details concerning isFunction. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
442 |
// Since version 1.3, DOM methods and functions like alert |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
443 |
// aren't supported. They return false on IE (#2968). |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
444 |
isFunction: function( obj ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
445 |
return jQuery.type(obj) === "function"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
446 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
447 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
448 |
isArray: Array.isArray || function( obj ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
449 |
return jQuery.type(obj) === "array"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
450 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
451 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
452 |
isWindow: function( obj ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
453 |
/* jshint eqeqeq: false */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
454 |
return obj != null && obj == obj.window; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
455 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
456 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
457 |
isNumeric: function( obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
458 |
return !isNaN( parseFloat(obj) ) && isFinite( obj ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
459 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
460 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
461 |
type: function( obj ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
462 |
if ( obj == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
463 |
return String( obj ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
464 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
465 |
return typeof obj === "object" || typeof obj === "function" ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
466 |
class2type[ core_toString.call(obj) ] || "object" : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
467 |
typeof obj; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
468 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
469 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
470 |
isPlainObject: function( obj ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
471 |
var key; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
472 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
473 |
// Must be an Object. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
474 |
// Because of IE, we also have to check the presence of the constructor property. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
475 |
// Make sure that DOM nodes and window objects don't pass through, as well |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
476 |
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
477 |
return false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
478 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
479 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
480 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
481 |
// Not own constructor property must be Object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
482 |
if ( obj.constructor && |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
483 |
!core_hasOwn.call(obj, "constructor") && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
484 |
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
485 |
return false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
486 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
487 |
} catch ( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
488 |
// IE8,9 Will throw exceptions on certain host objects #9897 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
489 |
return false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
490 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
491 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
492 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
493 |
// Handle iteration over inherited properties before own properties. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
494 |
if ( jQuery.support.ownLast ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
495 |
for ( key in obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
496 |
return core_hasOwn.call( obj, key ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
497 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
498 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
499 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
500 |
// Own properties are enumerated firstly, so to speed up, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
501 |
// if last one is own, then all properties are own. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
502 |
for ( key in obj ) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
503 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
504 |
return key === undefined || core_hasOwn.call( obj, key ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
505 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
506 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
507 |
isEmptyObject: function( obj ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
508 |
var name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
509 |
for ( name in obj ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
510 |
return false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
511 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
512 |
return true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
513 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
514 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
515 |
error: function( msg ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
516 |
throw new Error( msg ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
517 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
518 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
519 |
// data: string of html |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
520 |
// context (optional): If specified, the fragment will be created in this context, defaults to document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
521 |
// keepScripts (optional): If true, will include scripts passed in the html string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
522 |
parseHTML: function( data, context, keepScripts ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
523 |
if ( !data || typeof data !== "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
524 |
return null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
525 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
526 |
if ( typeof context === "boolean" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
527 |
keepScripts = context; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
528 |
context = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
529 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
530 |
context = context || document; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
531 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
532 |
var parsed = rsingleTag.exec( data ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
533 |
scripts = !keepScripts && []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
534 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
535 |
// Single tag |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
536 |
if ( parsed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
537 |
return [ context.createElement( parsed[1] ) ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
538 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
539 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
540 |
parsed = jQuery.buildFragment( [ data ], context, scripts ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
541 |
if ( scripts ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
542 |
jQuery( scripts ).remove(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
543 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
544 |
return jQuery.merge( [], parsed.childNodes ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
545 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
546 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
547 |
parseJSON: function( data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
548 |
// Attempt to parse using the native JSON parser first |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
549 |
if ( window.JSON && window.JSON.parse ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
550 |
return window.JSON.parse( data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
551 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
552 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
553 |
if ( data === null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
554 |
return data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
555 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
556 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
557 |
if ( typeof data === "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
558 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
559 |
// Make sure leading/trailing whitespace is removed (IE can't handle it) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
560 |
data = jQuery.trim( data ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
561 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
562 |
if ( data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
563 |
// Make sure the incoming data is actual JSON |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
564 |
// Logic borrowed from http://json.org/json2.js |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
565 |
if ( rvalidchars.test( data.replace( rvalidescape, "@" ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
566 |
.replace( rvalidtokens, "]" ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
567 |
.replace( rvalidbraces, "")) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
568 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
569 |
return ( new Function( "return " + data ) )(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
570 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
571 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
572 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
573 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
574 |
jQuery.error( "Invalid JSON: " + data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
575 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
576 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
577 |
// Cross-browser xml parsing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
578 |
parseXML: function( data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
579 |
var xml, tmp; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
580 |
if ( !data || typeof data !== "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
581 |
return null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
582 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
583 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
584 |
if ( window.DOMParser ) { // Standard |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
585 |
tmp = new DOMParser(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
586 |
xml = tmp.parseFromString( data , "text/xml" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
587 |
} else { // IE |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
588 |
xml = new ActiveXObject( "Microsoft.XMLDOM" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
589 |
xml.async = "false"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
590 |
xml.loadXML( data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
591 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
592 |
} catch( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
593 |
xml = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
594 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
595 |
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
596 |
jQuery.error( "Invalid XML: " + data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
597 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
598 |
return xml; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
599 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
600 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
601 |
noop: function() {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
602 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
603 |
// Evaluates a script in a global context |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
604 |
// Workarounds based on findings by Jim Driscoll |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
605 |
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
606 |
globalEval: function( data ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
607 |
if ( data && jQuery.trim( data ) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
608 |
// We use execScript on Internet Explorer |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
609 |
// We use an anonymous function so that context is window |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
610 |
// rather than jQuery in Firefox |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
611 |
( window.execScript || function( data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
612 |
window[ "eval" ].call( window, data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
613 |
} )( data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
614 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
615 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
616 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
617 |
// Convert dashed to camelCase; used by the css and data modules |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
618 |
// Microsoft forgot to hump their vendor prefix (#9572) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
619 |
camelCase: function( string ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
620 |
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
621 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
622 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
623 |
nodeName: function( elem, name ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
624 |
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
625 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
626 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
627 |
// args is for internal usage only |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
628 |
each: function( obj, callback, args ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
629 |
var value, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
630 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
631 |
length = obj.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
632 |
isArray = isArraylike( obj ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
633 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
634 |
if ( args ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
635 |
if ( isArray ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
636 |
for ( ; i < length; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
637 |
value = callback.apply( obj[ i ], args ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
638 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
639 |
if ( value === false ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
640 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
641 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
642 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
643 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
644 |
for ( i in obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
645 |
value = callback.apply( obj[ i ], args ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
646 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
647 |
if ( value === false ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
648 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
649 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
650 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
651 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
652 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
653 |
// A special, fast, case for the most common use of each |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
654 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
655 |
if ( isArray ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
656 |
for ( ; i < length; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
657 |
value = callback.call( obj[ i ], i, obj[ i ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
658 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
659 |
if ( value === false ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
660 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
661 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
662 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
663 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
664 |
for ( i in obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
665 |
value = callback.call( obj[ i ], i, obj[ i ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
666 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
667 |
if ( value === false ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
668 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
669 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
670 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
671 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
672 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
673 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
674 |
return obj; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
675 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
676 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
677 |
// Use native String.trim function wherever possible |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
678 |
trim: core_trim && !core_trim.call("\uFEFF\xA0") ? |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
679 |
function( text ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
680 |
return text == null ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
681 |
"" : |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
682 |
core_trim.call( text ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
683 |
} : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
684 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
685 |
// Otherwise use our own trimming functionality |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
686 |
function( text ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
687 |
return text == null ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
688 |
"" : |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
689 |
( text + "" ).replace( rtrim, "" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
690 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
691 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
692 |
// results is for internal usage only |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
693 |
makeArray: function( arr, results ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
694 |
var ret = results || []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
695 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
696 |
if ( arr != null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
697 |
if ( isArraylike( Object(arr) ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
698 |
jQuery.merge( ret, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
699 |
typeof arr === "string" ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
700 |
[ arr ] : arr |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
701 |
); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
702 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
703 |
core_push.call( ret, arr ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
704 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
705 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
706 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
707 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
708 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
709 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
710 |
inArray: function( elem, arr, i ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
711 |
var len; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
712 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
713 |
if ( arr ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
714 |
if ( core_indexOf ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
715 |
return core_indexOf.call( arr, elem, i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
716 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
717 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
718 |
len = arr.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
719 |
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
720 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
721 |
for ( ; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
722 |
// Skip accessing in sparse arrays |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
723 |
if ( i in arr && arr[ i ] === elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
724 |
return i; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
725 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
726 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
727 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
728 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
729 |
return -1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
730 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
731 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
732 |
merge: function( first, second ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
733 |
var l = second.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
734 |
i = first.length, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
735 |
j = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
736 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
737 |
if ( typeof l === "number" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
738 |
for ( ; j < l; j++ ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
739 |
first[ i++ ] = second[ j ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
740 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
741 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
742 |
while ( second[j] !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
743 |
first[ i++ ] = second[ j++ ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
744 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
745 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
746 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
747 |
first.length = i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
748 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
749 |
return first; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
750 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
751 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
752 |
grep: function( elems, callback, inv ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
753 |
var retVal, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
754 |
ret = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
755 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
756 |
length = elems.length; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
757 |
inv = !!inv; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
758 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
759 |
// Go through the array, only saving the items |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
760 |
// that pass the validator function |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
761 |
for ( ; i < length; i++ ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
762 |
retVal = !!callback( elems[ i ], i ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
763 |
if ( inv !== retVal ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
764 |
ret.push( elems[ i ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
765 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
766 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
767 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
768 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
769 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
770 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
771 |
// arg is for internal usage only |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
772 |
map: function( elems, callback, arg ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
773 |
var value, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
774 |
i = 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
775 |
length = elems.length, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
776 |
isArray = isArraylike( elems ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
777 |
ret = []; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
778 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
779 |
// Go through the array, translating each of the items to their |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
780 |
if ( isArray ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
781 |
for ( ; i < length; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
782 |
value = callback( elems[ i ], i, arg ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
783 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
784 |
if ( value != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
785 |
ret[ ret.length ] = value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
786 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
787 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
788 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
789 |
// Go through every key on the object, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
790 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
791 |
for ( i in elems ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
792 |
value = callback( elems[ i ], i, arg ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
793 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
794 |
if ( value != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
795 |
ret[ ret.length ] = value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
796 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
797 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
798 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
799 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
800 |
// Flatten any nested arrays |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
801 |
return core_concat.apply( [], ret ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
802 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
803 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
804 |
// A global GUID counter for objects |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
805 |
guid: 1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
806 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
807 |
// Bind a function to a context, optionally partially applying any |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
808 |
// arguments. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
809 |
proxy: function( fn, context ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
810 |
var args, proxy, tmp; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
811 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
812 |
if ( typeof context === "string" ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
813 |
tmp = fn[ context ]; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
814 |
context = fn; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
815 |
fn = tmp; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
816 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
817 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
818 |
// Quick check to determine if target is callable, in the spec |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
819 |
// this throws a TypeError, but we will just return undefined. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
820 |
if ( !jQuery.isFunction( fn ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
821 |
return undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
822 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
823 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
824 |
// Simulated bind |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
825 |
args = core_slice.call( arguments, 2 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
826 |
proxy = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
827 |
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
828 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
829 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
830 |
// Set the guid of unique handler to the same of original handler, so it can be removed |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
831 |
proxy.guid = fn.guid = fn.guid || jQuery.guid++; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
832 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
833 |
return proxy; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
834 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
835 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
836 |
// Multifunctional method to get and set values of a collection |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
837 |
// The value/s can optionally be executed if it's a function |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
838 |
access: function( elems, fn, key, value, chainable, emptyGet, raw ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
839 |
var i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
840 |
length = elems.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
841 |
bulk = key == null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
842 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
843 |
// Sets many values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
844 |
if ( jQuery.type( key ) === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
845 |
chainable = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
846 |
for ( i in key ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
847 |
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
848 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
849 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
850 |
// Sets one value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
851 |
} else if ( value !== undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
852 |
chainable = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
853 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
854 |
if ( !jQuery.isFunction( value ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
855 |
raw = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
856 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
857 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
858 |
if ( bulk ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
859 |
// Bulk operations run against the entire set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
860 |
if ( raw ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
861 |
fn.call( elems, value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
862 |
fn = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
863 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
864 |
// ...except when executing function values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
865 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
866 |
bulk = fn; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
867 |
fn = function( elem, key, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
868 |
return bulk.call( jQuery( elem ), value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
869 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
870 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
871 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
872 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
873 |
if ( fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
874 |
for ( ; i < length; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
875 |
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
876 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
877 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
878 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
879 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
880 |
return chainable ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
881 |
elems : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
882 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
883 |
// Gets |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
884 |
bulk ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
885 |
fn.call( elems ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
886 |
length ? fn( elems[0], key ) : emptyGet; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
887 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
888 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
889 |
now: function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
890 |
return ( new Date() ).getTime(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
891 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
892 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
893 |
// A method for quickly swapping in/out CSS properties to get correct calculations. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
894 |
// Note: this method belongs to the css module but it's needed here for the support module. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
895 |
// If support gets modularized, this method should be moved back to the css module. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
896 |
swap: function( elem, options, callback, args ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
897 |
var ret, name, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
898 |
old = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
899 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
900 |
// Remember the old values, and insert the new ones |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
901 |
for ( name in options ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
902 |
old[ name ] = elem.style[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
903 |
elem.style[ name ] = options[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
904 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
905 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
906 |
ret = callback.apply( elem, args || [] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
907 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
908 |
// Revert the old values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
909 |
for ( name in options ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
910 |
elem.style[ name ] = old[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
911 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
912 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
913 |
return ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
914 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
915 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
916 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
917 |
jQuery.ready.promise = function( obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
918 |
if ( !readyList ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
919 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
920 |
readyList = jQuery.Deferred(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
921 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
922 |
// Catch cases where $(document).ready() is called after the browser event has already occurred. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
923 |
// we once tried to use readyState "interactive" here, but it caused issues like the one |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
924 |
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
925 |
if ( document.readyState === "complete" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
926 |
// Handle it asynchronously to allow scripts the opportunity to delay ready |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
927 |
setTimeout( jQuery.ready ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
928 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
929 |
// Standards-based browsers support DOMContentLoaded |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
930 |
} else if ( document.addEventListener ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
931 |
// Use the handy event callback |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
932 |
document.addEventListener( "DOMContentLoaded", completed, false ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
933 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
934 |
// A fallback to window.onload, that will always work |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
935 |
window.addEventListener( "load", completed, false ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
936 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
937 |
// If IE event model is used |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
938 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
939 |
// Ensure firing before onload, maybe late but safe also for iframes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
940 |
document.attachEvent( "onreadystatechange", completed ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
941 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
942 |
// A fallback to window.onload, that will always work |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
943 |
window.attachEvent( "onload", completed ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
944 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
945 |
// If IE and not a frame |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
946 |
// continually check to see if the document is ready |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
947 |
var top = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
948 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
949 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
950 |
top = window.frameElement == null && document.documentElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
951 |
} catch(e) {} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
952 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
953 |
if ( top && top.doScroll ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
954 |
(function doScrollCheck() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
955 |
if ( !jQuery.isReady ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
956 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
957 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
958 |
// Use the trick by Diego Perini |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
959 |
// http://javascript.nwbox.com/IEContentLoaded/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
960 |
top.doScroll("left"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
961 |
} catch(e) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
962 |
return setTimeout( doScrollCheck, 50 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
963 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
964 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
965 |
// detach all dom ready events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
966 |
detach(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
967 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
968 |
// and execute any waiting functions |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
969 |
jQuery.ready(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
970 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
971 |
})(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
972 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
973 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
974 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
975 |
return readyList.promise( obj ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
976 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
977 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
978 |
// Populate the class2type map |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
979 |
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
980 |
class2type[ "[object " + name + "]" ] = name.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
981 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
982 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
983 |
function isArraylike( obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
984 |
var length = obj.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
985 |
type = jQuery.type( obj ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
986 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
987 |
if ( jQuery.isWindow( obj ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
988 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
989 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
990 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
991 |
if ( obj.nodeType === 1 && length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
992 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
993 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
994 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
995 |
return type === "array" || type !== "function" && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
996 |
( length === 0 || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
997 |
typeof length === "number" && length > 0 && ( length - 1 ) in obj ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
998 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
999 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1000 |
// All jQuery objects should point back to these |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1001 |
rootjQuery = jQuery(document); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1002 |
/*! |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1003 |
* Sizzle CSS Selector Engine v1.10.2 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1004 |
* http://sizzlejs.com/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1005 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1006 |
* Copyright 2013 jQuery Foundation, Inc. and other contributors |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1007 |
* Released under the MIT license |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1008 |
* http://jquery.org/license |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1009 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1010 |
* Date: 2013-07-03 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1011 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1012 |
(function( window, undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1013 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1014 |
var i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1015 |
support, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1016 |
cachedruns, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1017 |
Expr, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1018 |
getText, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1019 |
isXML, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1020 |
compile, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1021 |
outermostContext, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1022 |
sortInput, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1023 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1024 |
// Local document vars |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1025 |
setDocument, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1026 |
document, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1027 |
docElem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1028 |
documentIsHTML, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1029 |
rbuggyQSA, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1030 |
rbuggyMatches, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1031 |
matches, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1032 |
contains, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1033 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1034 |
// Instance-specific data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1035 |
expando = "sizzle" + -(new Date()), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1036 |
preferredDoc = window.document, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1037 |
dirruns = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1038 |
done = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1039 |
classCache = createCache(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1040 |
tokenCache = createCache(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1041 |
compilerCache = createCache(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1042 |
hasDuplicate = false, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1043 |
sortOrder = function( a, b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1044 |
if ( a === b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1045 |
hasDuplicate = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1046 |
return 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1047 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1048 |
return 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1049 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1050 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1051 |
// General-purpose constants |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1052 |
strundefined = typeof undefined, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1053 |
MAX_NEGATIVE = 1 << 31, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1054 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1055 |
// Instance methods |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1056 |
hasOwn = ({}).hasOwnProperty, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1057 |
arr = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1058 |
pop = arr.pop, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1059 |
push_native = arr.push, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1060 |
push = arr.push, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1061 |
slice = arr.slice, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1062 |
// Use a stripped-down indexOf if we can't use a native one |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1063 |
indexOf = arr.indexOf || function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1064 |
var i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1065 |
len = this.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1066 |
for ( ; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1067 |
if ( this[i] === elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1068 |
return i; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1069 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1070 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1071 |
return -1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1072 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1073 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1074 |
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1075 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1076 |
// Regular expressions |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1077 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1078 |
// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1079 |
whitespace = "[\\x20\\t\\r\\n\\f]", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1080 |
// http://www.w3.org/TR/css3-syntax/#characters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1081 |
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1082 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1083 |
// Loosely modeled on CSS identifier characters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1084 |
// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1085 |
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1086 |
identifier = characterEncoding.replace( "w", "w#" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1087 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1088 |
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1089 |
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1090 |
"*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1091 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1092 |
// Prefer arguments quoted, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1093 |
// then not containing pseudos/brackets, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1094 |
// then attribute selectors/non-parenthetical expressions, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1095 |
// then anything else |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1096 |
// These preferences are here to reduce the number of selectors |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1097 |
// needing tokenize in the PSEUDO preFilter |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1098 |
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1099 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1100 |
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1101 |
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1102 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1103 |
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1104 |
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1105 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1106 |
rsibling = new RegExp( whitespace + "*[+~]" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1107 |
rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1108 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1109 |
rpseudo = new RegExp( pseudos ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1110 |
ridentifier = new RegExp( "^" + identifier + "$" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1111 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1112 |
matchExpr = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1113 |
"ID": new RegExp( "^#(" + characterEncoding + ")" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1114 |
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1115 |
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1116 |
"ATTR": new RegExp( "^" + attributes ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1117 |
"PSEUDO": new RegExp( "^" + pseudos ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1118 |
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1119 |
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1120 |
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1121 |
"bool": new RegExp( "^(?:" + booleans + ")$", "i" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1122 |
// For use in libraries implementing .is() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1123 |
// We use this for POS matching in `select` |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1124 |
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1125 |
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1126 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1127 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1128 |
rnative = /^[^{]+\{\s*\[native \w/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1129 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1130 |
// Easily-parseable/retrievable ID or TAG or CLASS selectors |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1131 |
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1132 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1133 |
rinputs = /^(?:input|select|textarea|button)$/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1134 |
rheader = /^h\d$/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1135 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1136 |
rescape = /'|\\/g, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1137 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1138 |
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1139 |
runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1140 |
funescape = function( _, escaped, escapedWhitespace ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1141 |
var high = "0x" + escaped - 0x10000; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1142 |
// NaN means non-codepoint |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1143 |
// Support: Firefox |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1144 |
// Workaround erroneous numeric interpretation of +"0x" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1145 |
return high !== high || escapedWhitespace ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1146 |
escaped : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1147 |
// BMP codepoint |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1148 |
high < 0 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1149 |
String.fromCharCode( high + 0x10000 ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1150 |
// Supplemental Plane codepoint (surrogate pair) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1151 |
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1152 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1153 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1154 |
// Optimize for push.apply( _, NodeList ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1155 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1156 |
push.apply( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1157 |
(arr = slice.call( preferredDoc.childNodes )), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1158 |
preferredDoc.childNodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1159 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1160 |
// Support: Android<4.0 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1161 |
// Detect silently failing push.apply |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1162 |
arr[ preferredDoc.childNodes.length ].nodeType; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1163 |
} catch ( e ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1164 |
push = { apply: arr.length ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1165 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1166 |
// Leverage slice if possible |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1167 |
function( target, els ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1168 |
push_native.apply( target, slice.call(els) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1169 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1170 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1171 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1172 |
// Otherwise append directly |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1173 |
function( target, els ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1174 |
var j = target.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1175 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1176 |
// Can't trust NodeList.length |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1177 |
while ( (target[j++] = els[i++]) ) {} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1178 |
target.length = j - 1; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1179 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1180 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1181 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1182 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1183 |
function Sizzle( selector, context, results, seed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1184 |
var match, elem, m, nodeType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1185 |
// QSA vars |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1186 |
i, groups, old, nid, newContext, newSelector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1187 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1188 |
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1189 |
setDocument( context ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1190 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1191 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1192 |
context = context || document; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1193 |
results = results || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1194 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1195 |
if ( !selector || typeof selector !== "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1196 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1197 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1198 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1199 |
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1200 |
return []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1201 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1202 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1203 |
if ( documentIsHTML && !seed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1204 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1205 |
// Shortcuts |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1206 |
if ( (match = rquickExpr.exec( selector )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1207 |
// Speed-up: Sizzle("#ID") |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1208 |
if ( (m = match[1]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1209 |
if ( nodeType === 9 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1210 |
elem = context.getElementById( m ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1211 |
// Check parentNode to catch when Blackberry 4.6 returns |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1212 |
// nodes that are no longer in the document #6963 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1213 |
if ( elem && elem.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1214 |
// Handle the case where IE, Opera, and Webkit return items |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1215 |
// by name instead of ID |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1216 |
if ( elem.id === m ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1217 |
results.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1218 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1219 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1220 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1221 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1222 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1223 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1224 |
// Context is not a document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1225 |
if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1226 |
contains( context, elem ) && elem.id === m ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1227 |
results.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1228 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1229 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1230 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1231 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1232 |
// Speed-up: Sizzle("TAG") |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1233 |
} else if ( match[2] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1234 |
push.apply( results, context.getElementsByTagName( selector ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1235 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1236 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1237 |
// Speed-up: Sizzle(".CLASS") |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1238 |
} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1239 |
push.apply( results, context.getElementsByClassName( m ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1240 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1241 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1242 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1243 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1244 |
// QSA path |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1245 |
if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1246 |
nid = old = expando; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1247 |
newContext = context; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1248 |
newSelector = nodeType === 9 && selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1249 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1250 |
// qSA works strangely on Element-rooted queries |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1251 |
// We can work around this by specifying an extra ID on the root |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1252 |
// and working up from there (Thanks to Andrew Dupont for the technique) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1253 |
// IE 8 doesn't work on object elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1254 |
if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1255 |
groups = tokenize( selector ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1256 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1257 |
if ( (old = context.getAttribute("id")) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1258 |
nid = old.replace( rescape, "\\$&" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1259 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1260 |
context.setAttribute( "id", nid ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1261 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1262 |
nid = "[id='" + nid + "'] "; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1263 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1264 |
i = groups.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1265 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1266 |
groups[i] = nid + toSelector( groups[i] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1267 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1268 |
newContext = rsibling.test( selector ) && context.parentNode || context; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1269 |
newSelector = groups.join(","); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1270 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1271 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1272 |
if ( newSelector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1273 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1274 |
push.apply( results, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1275 |
newContext.querySelectorAll( newSelector ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1276 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1277 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1278 |
} catch(qsaError) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1279 |
} finally { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1280 |
if ( !old ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1281 |
context.removeAttribute("id"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1282 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1283 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1284 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1285 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1286 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1287 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1288 |
// All others |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1289 |
return select( selector.replace( rtrim, "$1" ), context, results, seed ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1290 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1291 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1292 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1293 |
* Create key-value caches of limited size |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1294 |
* @returns {Function(string, Object)} Returns the Object data after storing it on itself with |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1295 |
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1296 |
* deleting the oldest entry |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1297 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1298 |
function createCache() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1299 |
var keys = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1300 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1301 |
function cache( key, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1302 |
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1303 |
if ( keys.push( key += " " ) > Expr.cacheLength ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1304 |
// Only keep the most recent entries |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1305 |
delete cache[ keys.shift() ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1306 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1307 |
return (cache[ key ] = value); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1308 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1309 |
return cache; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1310 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1311 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1312 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1313 |
* Mark a function for special use by Sizzle |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1314 |
* @param {Function} fn The function to mark |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1315 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1316 |
function markFunction( fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1317 |
fn[ expando ] = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1318 |
return fn; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1319 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1320 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1321 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1322 |
* Support testing using an element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1323 |
* @param {Function} fn Passed the created div and expects a boolean result |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1324 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1325 |
function assert( fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1326 |
var div = document.createElement("div"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1327 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1328 |
try { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1329 |
return !!fn( div ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1330 |
} catch (e) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1331 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1332 |
} finally { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1333 |
// Remove from its parent by default |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1334 |
if ( div.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1335 |
div.parentNode.removeChild( div ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1336 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1337 |
// release memory in IE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1338 |
div = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1339 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1340 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1341 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1342 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1343 |
* Adds the same handler for all of the specified attrs |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1344 |
* @param {String} attrs Pipe-separated list of attributes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1345 |
* @param {Function} handler The method that will be applied |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1346 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1347 |
function addHandle( attrs, handler ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1348 |
var arr = attrs.split("|"), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1349 |
i = attrs.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1350 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1351 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1352 |
Expr.attrHandle[ arr[i] ] = handler; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1353 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1354 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1355 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1356 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1357 |
* Checks document order of two siblings |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1358 |
* @param {Element} a |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1359 |
* @param {Element} b |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1360 |
* @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1361 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1362 |
function siblingCheck( a, b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1363 |
var cur = b && a, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1364 |
diff = cur && a.nodeType === 1 && b.nodeType === 1 && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1365 |
( ~b.sourceIndex || MAX_NEGATIVE ) - |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1366 |
( ~a.sourceIndex || MAX_NEGATIVE ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1367 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1368 |
// Use IE sourceIndex if available on both nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1369 |
if ( diff ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1370 |
return diff; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1371 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1372 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1373 |
// Check if b follows a |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1374 |
if ( cur ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1375 |
while ( (cur = cur.nextSibling) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1376 |
if ( cur === b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1377 |
return -1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1378 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1379 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1380 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1381 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1382 |
return a ? 1 : -1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1383 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1384 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1385 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1386 |
* Returns a function to use in pseudos for input types |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1387 |
* @param {String} type |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1388 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1389 |
function createInputPseudo( type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1390 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1391 |
var name = elem.nodeName.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1392 |
return name === "input" && elem.type === type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1393 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1394 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1395 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1396 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1397 |
* Returns a function to use in pseudos for buttons |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1398 |
* @param {String} type |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1399 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1400 |
function createButtonPseudo( type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1401 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1402 |
var name = elem.nodeName.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1403 |
return (name === "input" || name === "button") && elem.type === type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1404 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1405 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1406 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1407 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1408 |
* Returns a function to use in pseudos for positionals |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1409 |
* @param {Function} fn |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1410 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1411 |
function createPositionalPseudo( fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1412 |
return markFunction(function( argument ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1413 |
argument = +argument; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1414 |
return markFunction(function( seed, matches ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1415 |
var j, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1416 |
matchIndexes = fn( [], seed.length, argument ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1417 |
i = matchIndexes.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1418 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1419 |
// Match elements found at the specified indexes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1420 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1421 |
if ( seed[ (j = matchIndexes[i]) ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1422 |
seed[j] = !(matches[j] = seed[j]); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1423 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1424 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1425 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1426 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1427 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1428 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1429 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1430 |
* Detect xml |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1431 |
* @param {Element|Object} elem An element or a document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1432 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1433 |
isXML = Sizzle.isXML = function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1434 |
// documentElement is verified for cases where it doesn't yet exist |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1435 |
// (such as loading iframes in IE - #4833) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1436 |
var documentElement = elem && (elem.ownerDocument || elem).documentElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1437 |
return documentElement ? documentElement.nodeName !== "HTML" : false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1438 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1439 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1440 |
// Expose support vars for convenience |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1441 |
support = Sizzle.support = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1442 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1443 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1444 |
* Sets document-related variables once based on the current document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1445 |
* @param {Element|Object} [doc] An element or document object to use to set the document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1446 |
* @returns {Object} Returns the current document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1447 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1448 |
setDocument = Sizzle.setDocument = function( node ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1449 |
var doc = node ? node.ownerDocument || node : preferredDoc, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1450 |
parent = doc.defaultView; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1451 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1452 |
// If no document and documentElement is available, return |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1453 |
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1454 |
return document; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1455 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1456 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1457 |
// Set our document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1458 |
document = doc; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1459 |
docElem = doc.documentElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1460 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1461 |
// Support tests |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1462 |
documentIsHTML = !isXML( doc ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1463 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1464 |
// Support: IE>8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1465 |
// If iframe document is assigned to "document" variable and if iframe has been reloaded, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1466 |
// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1467 |
// IE6-8 do not support the defaultView property so parent will be undefined |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1468 |
if ( parent && parent.attachEvent && parent !== parent.top ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1469 |
parent.attachEvent( "onbeforeunload", function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1470 |
setDocument(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1471 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1472 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1473 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1474 |
/* Attributes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1475 |
---------------------------------------------------------------------- */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1476 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1477 |
// Support: IE<8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1478 |
// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1479 |
support.attributes = assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1480 |
div.className = "i"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1481 |
return !div.getAttribute("className"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1482 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1483 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1484 |
/* getElement(s)By* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1485 |
---------------------------------------------------------------------- */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1486 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1487 |
// Check if getElementsByTagName("*") returns only elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1488 |
support.getElementsByTagName = assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1489 |
div.appendChild( doc.createComment("") ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1490 |
return !div.getElementsByTagName("*").length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1491 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1492 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1493 |
// Check if getElementsByClassName can be trusted |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1494 |
support.getElementsByClassName = assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1495 |
div.innerHTML = "<div class='a'></div><div class='a i'></div>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1496 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1497 |
// Support: Safari<4 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1498 |
// Catch class over-caching |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1499 |
div.firstChild.className = "i"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1500 |
// Support: Opera<10 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1501 |
// Catch gEBCN failure to find non-leading classes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1502 |
return div.getElementsByClassName("i").length === 2; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1503 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1504 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1505 |
// Support: IE<10 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1506 |
// Check if getElementById returns elements by name |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1507 |
// The broken getElementById methods don't pick up programatically-set names, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1508 |
// so use a roundabout getElementsByName test |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1509 |
support.getById = assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1510 |
docElem.appendChild( div ).id = expando; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1511 |
return !doc.getElementsByName || !doc.getElementsByName( expando ).length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1512 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1513 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1514 |
// ID find and filter |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1515 |
if ( support.getById ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1516 |
Expr.find["ID"] = function( id, context ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1517 |
if ( typeof context.getElementById !== strundefined && documentIsHTML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1518 |
var m = context.getElementById( id ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1519 |
// Check parentNode to catch when Blackberry 4.6 returns |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1520 |
// nodes that are no longer in the document #6963 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1521 |
return m && m.parentNode ? [m] : []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1522 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1523 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1524 |
Expr.filter["ID"] = function( id ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1525 |
var attrId = id.replace( runescape, funescape ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1526 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1527 |
return elem.getAttribute("id") === attrId; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1528 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1529 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1530 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1531 |
// Support: IE6/7 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1532 |
// getElementById is not reliable as a find shortcut |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1533 |
delete Expr.find["ID"]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1534 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1535 |
Expr.filter["ID"] = function( id ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1536 |
var attrId = id.replace( runescape, funescape ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1537 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1538 |
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1539 |
return node && node.value === attrId; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1540 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1541 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1542 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1543 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1544 |
// Tag |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1545 |
Expr.find["TAG"] = support.getElementsByTagName ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1546 |
function( tag, context ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1547 |
if ( typeof context.getElementsByTagName !== strundefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1548 |
return context.getElementsByTagName( tag ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1549 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1550 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1551 |
function( tag, context ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1552 |
var elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1553 |
tmp = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1554 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1555 |
results = context.getElementsByTagName( tag ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1556 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1557 |
// Filter out possible comments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1558 |
if ( tag === "*" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1559 |
while ( (elem = results[i++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1560 |
if ( elem.nodeType === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1561 |
tmp.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1562 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1563 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1564 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1565 |
return tmp; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1566 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1567 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1568 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1569 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1570 |
// Class |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1571 |
Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1572 |
if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1573 |
return context.getElementsByClassName( className ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1574 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1575 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1576 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1577 |
/* QSA/matchesSelector |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1578 |
---------------------------------------------------------------------- */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1579 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1580 |
// QSA and matchesSelector support |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1581 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1582 |
// matchesSelector(:active) reports false when true (IE9/Opera 11.5) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1583 |
rbuggyMatches = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1584 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1585 |
// qSa(:focus) reports false when true (Chrome 21) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1586 |
// We allow this because of a bug in IE8/9 that throws an error |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1587 |
// whenever `document.activeElement` is accessed on an iframe |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1588 |
// So, we allow :focus to pass through QSA all the time to avoid the IE error |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1589 |
// See http://bugs.jquery.com/ticket/13378 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1590 |
rbuggyQSA = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1591 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1592 |
if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1593 |
// Build QSA regex |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1594 |
// Regex strategy adopted from Diego Perini |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1595 |
assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1596 |
// Select is set to empty string on purpose |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1597 |
// This is to test IE's treatment of not explicitly |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1598 |
// setting a boolean content attribute, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1599 |
// since its presence should be enough |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1600 |
// http://bugs.jquery.com/ticket/12359 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1601 |
div.innerHTML = "<select><option selected=''></option></select>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1602 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1603 |
// Support: IE8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1604 |
// Boolean attributes and "value" are not treated correctly |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1605 |
if ( !div.querySelectorAll("[selected]").length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1606 |
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1607 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1608 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1609 |
// Webkit/Opera - :checked should return selected option elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1610 |
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1611 |
// IE8 throws error here and will not see later tests |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1612 |
if ( !div.querySelectorAll(":checked").length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1613 |
rbuggyQSA.push(":checked"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1614 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1615 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1616 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1617 |
assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1618 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1619 |
// Support: Opera 10-12/IE8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1620 |
// ^= $= *= and empty values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1621 |
// Should not select anything |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1622 |
// Support: Windows 8 Native Apps |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1623 |
// The type attribute is restricted during .innerHTML assignment |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1624 |
var input = doc.createElement("input"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1625 |
input.setAttribute( "type", "hidden" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1626 |
div.appendChild( input ).setAttribute( "t", "" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1627 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1628 |
if ( div.querySelectorAll("[t^='']").length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1629 |
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1630 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1631 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1632 |
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1633 |
// IE8 throws error here and will not see later tests |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1634 |
if ( !div.querySelectorAll(":enabled").length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1635 |
rbuggyQSA.push( ":enabled", ":disabled" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1636 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1637 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1638 |
// Opera 10-11 does not throw on post-comma invalid pseudos |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1639 |
div.querySelectorAll("*,:x"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1640 |
rbuggyQSA.push(",.*:"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1641 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1642 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1643 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1644 |
if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1645 |
docElem.mozMatchesSelector || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1646 |
docElem.oMatchesSelector || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1647 |
docElem.msMatchesSelector) )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1648 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1649 |
assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1650 |
// Check to see if it's possible to do matchesSelector |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1651 |
// on a disconnected node (IE 9) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1652 |
support.disconnectedMatch = matches.call( div, "div" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1653 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1654 |
// This should fail with an exception |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1655 |
// Gecko does not error, returns false instead |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1656 |
matches.call( div, "[s!='']:x" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1657 |
rbuggyMatches.push( "!=", pseudos ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1658 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1659 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1660 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1661 |
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1662 |
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1663 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1664 |
/* Contains |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1665 |
---------------------------------------------------------------------- */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1666 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1667 |
// Element contains another |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1668 |
// Purposefully does not implement inclusive descendent |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1669 |
// As in, an element does not contain itself |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1670 |
contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1671 |
function( a, b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1672 |
var adown = a.nodeType === 9 ? a.documentElement : a, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1673 |
bup = b && b.parentNode; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1674 |
return a === bup || !!( bup && bup.nodeType === 1 && ( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1675 |
adown.contains ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1676 |
adown.contains( bup ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1677 |
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1678 |
)); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1679 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1680 |
function( a, b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1681 |
if ( b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1682 |
while ( (b = b.parentNode) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1683 |
if ( b === a ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1684 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1685 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1686 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1687 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1688 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1689 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1690 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1691 |
/* Sorting |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1692 |
---------------------------------------------------------------------- */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1693 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1694 |
// Document order sorting |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1695 |
sortOrder = docElem.compareDocumentPosition ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1696 |
function( a, b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1697 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1698 |
// Flag for duplicate removal |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1699 |
if ( a === b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1700 |
hasDuplicate = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1701 |
return 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1702 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1703 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1704 |
var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1705 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1706 |
if ( compare ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1707 |
// Disconnected nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1708 |
if ( compare & 1 || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1709 |
(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1710 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1711 |
// Choose the first element that is related to our preferred document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1712 |
if ( a === doc || contains(preferredDoc, a) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1713 |
return -1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1714 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1715 |
if ( b === doc || contains(preferredDoc, b) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1716 |
return 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1717 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1718 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1719 |
// Maintain original order |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1720 |
return sortInput ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1721 |
( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1722 |
0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1723 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1724 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1725 |
return compare & 4 ? -1 : 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1726 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1727 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1728 |
// Not directly comparable, sort on existence of method |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1729 |
return a.compareDocumentPosition ? -1 : 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1730 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1731 |
function( a, b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1732 |
var cur, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1733 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1734 |
aup = a.parentNode, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1735 |
bup = b.parentNode, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1736 |
ap = [ a ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1737 |
bp = [ b ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1738 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1739 |
// Exit early if the nodes are identical |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1740 |
if ( a === b ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1741 |
hasDuplicate = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1742 |
return 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1743 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1744 |
// Parentless nodes are either documents or disconnected |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1745 |
} else if ( !aup || !bup ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1746 |
return a === doc ? -1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1747 |
b === doc ? 1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1748 |
aup ? -1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1749 |
bup ? 1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1750 |
sortInput ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1751 |
( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1752 |
0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1753 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1754 |
// If the nodes are siblings, we can do a quick check |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1755 |
} else if ( aup === bup ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1756 |
return siblingCheck( a, b ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1757 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1758 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1759 |
// Otherwise we need full lists of their ancestors for comparison |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1760 |
cur = a; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1761 |
while ( (cur = cur.parentNode) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1762 |
ap.unshift( cur ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1763 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1764 |
cur = b; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1765 |
while ( (cur = cur.parentNode) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1766 |
bp.unshift( cur ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1767 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1768 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1769 |
// Walk down the tree looking for a discrepancy |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1770 |
while ( ap[i] === bp[i] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1771 |
i++; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1772 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1773 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1774 |
return i ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1775 |
// Do a sibling check if the nodes have a common ancestor |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1776 |
siblingCheck( ap[i], bp[i] ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1777 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1778 |
// Otherwise nodes in our document sort first |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1779 |
ap[i] === preferredDoc ? -1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1780 |
bp[i] === preferredDoc ? 1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1781 |
0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1782 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1783 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1784 |
return doc; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1785 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1786 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1787 |
Sizzle.matches = function( expr, elements ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1788 |
return Sizzle( expr, null, null, elements ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1789 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1790 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1791 |
Sizzle.matchesSelector = function( elem, expr ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1792 |
// Set document vars if needed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1793 |
if ( ( elem.ownerDocument || elem ) !== document ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1794 |
setDocument( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1795 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1796 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1797 |
// Make sure that attribute selectors are quoted |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1798 |
expr = expr.replace( rattributeQuotes, "='$1']" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1799 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1800 |
if ( support.matchesSelector && documentIsHTML && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1801 |
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1802 |
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1803 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1804 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1805 |
var ret = matches.call( elem, expr ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1806 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1807 |
// IE 9's matchesSelector returns false on disconnected nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1808 |
if ( ret || support.disconnectedMatch || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1809 |
// As well, disconnected nodes are said to be in a document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1810 |
// fragment in IE 9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1811 |
elem.document && elem.document.nodeType !== 11 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1812 |
return ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1813 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1814 |
} catch(e) {} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1815 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1816 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1817 |
return Sizzle( expr, document, null, [elem] ).length > 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1818 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1819 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1820 |
Sizzle.contains = function( context, elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1821 |
// Set document vars if needed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1822 |
if ( ( context.ownerDocument || context ) !== document ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1823 |
setDocument( context ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1824 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1825 |
return contains( context, elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1826 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1827 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1828 |
Sizzle.attr = function( elem, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1829 |
// Set document vars if needed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1830 |
if ( ( elem.ownerDocument || elem ) !== document ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1831 |
setDocument( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1832 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1833 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1834 |
var fn = Expr.attrHandle[ name.toLowerCase() ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1835 |
// Don't get fooled by Object.prototype properties (jQuery #13807) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1836 |
val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1837 |
fn( elem, name, !documentIsHTML ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1838 |
undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1839 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1840 |
return val === undefined ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1841 |
support.attributes || !documentIsHTML ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1842 |
elem.getAttribute( name ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1843 |
(val = elem.getAttributeNode(name)) && val.specified ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1844 |
val.value : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1845 |
null : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1846 |
val; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1847 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1848 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1849 |
Sizzle.error = function( msg ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1850 |
throw new Error( "Syntax error, unrecognized expression: " + msg ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1851 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1852 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1853 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1854 |
* Document sorting and removing duplicates |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1855 |
* @param {ArrayLike} results |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1856 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1857 |
Sizzle.uniqueSort = function( results ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1858 |
var elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1859 |
duplicates = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1860 |
j = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1861 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1862 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1863 |
// Unless we *know* we can detect duplicates, assume their presence |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1864 |
hasDuplicate = !support.detectDuplicates; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1865 |
sortInput = !support.sortStable && results.slice( 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1866 |
results.sort( sortOrder ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1867 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1868 |
if ( hasDuplicate ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1869 |
while ( (elem = results[i++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1870 |
if ( elem === results[ i ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1871 |
j = duplicates.push( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1872 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1873 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1874 |
while ( j-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1875 |
results.splice( duplicates[ j ], 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1876 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1877 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1878 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1879 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1880 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1881 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1882 |
/** |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1883 |
* Utility function for retrieving the text value of an array of DOM nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1884 |
* @param {Array|Element} elem |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1885 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1886 |
getText = Sizzle.getText = function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1887 |
var node, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1888 |
ret = "", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1889 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1890 |
nodeType = elem.nodeType; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1891 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1892 |
if ( !nodeType ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1893 |
// If no nodeType, this is expected to be an array |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1894 |
for ( ; (node = elem[i]); i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1895 |
// Do not traverse comment nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1896 |
ret += getText( node ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1897 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1898 |
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1899 |
// Use textContent for elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1900 |
// innerText usage removed for consistency of new lines (see #11153) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1901 |
if ( typeof elem.textContent === "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1902 |
return elem.textContent; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1903 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1904 |
// Traverse its children |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1905 |
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1906 |
ret += getText( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1907 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1908 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1909 |
} else if ( nodeType === 3 || nodeType === 4 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1910 |
return elem.nodeValue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1911 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1912 |
// Do not include comment or processing instruction nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1913 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1914 |
return ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1915 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1916 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1917 |
Expr = Sizzle.selectors = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1918 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1919 |
// Can be adjusted by the user |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1920 |
cacheLength: 50, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1921 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1922 |
createPseudo: markFunction, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1923 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1924 |
match: matchExpr, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1925 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1926 |
attrHandle: {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1927 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1928 |
find: {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1929 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1930 |
relative: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1931 |
">": { dir: "parentNode", first: true }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1932 |
" ": { dir: "parentNode" }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1933 |
"+": { dir: "previousSibling", first: true }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1934 |
"~": { dir: "previousSibling" } |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1935 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1936 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1937 |
preFilter: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1938 |
"ATTR": function( match ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1939 |
match[1] = match[1].replace( runescape, funescape ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1940 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1941 |
// Move the given value to match[3] whether quoted or unquoted |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1942 |
match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1943 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1944 |
if ( match[2] === "~=" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1945 |
match[3] = " " + match[3] + " "; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1946 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1947 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1948 |
return match.slice( 0, 4 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1949 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1950 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1951 |
"CHILD": function( match ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1952 |
/* matches from matchExpr["CHILD"] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1953 |
1 type (only|nth|...) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1954 |
2 what (child|of-type) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1955 |
3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1956 |
4 xn-component of xn+y argument ([+-]?\d*n|) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1957 |
5 sign of xn-component |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1958 |
6 x of xn-component |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1959 |
7 sign of y-component |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1960 |
8 y of y-component |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1961 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1962 |
match[1] = match[1].toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1963 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1964 |
if ( match[1].slice( 0, 3 ) === "nth" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1965 |
// nth-* requires argument |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1966 |
if ( !match[3] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1967 |
Sizzle.error( match[0] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1968 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1969 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1970 |
// numeric x and y parameters for Expr.filter.CHILD |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1971 |
// remember that false/true cast respectively to 0/1 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1972 |
match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1973 |
match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1974 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1975 |
// other types prohibit arguments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1976 |
} else if ( match[3] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1977 |
Sizzle.error( match[0] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1978 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1979 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1980 |
return match; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1981 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1982 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1983 |
"PSEUDO": function( match ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1984 |
var excess, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1985 |
unquoted = !match[5] && match[2]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1986 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1987 |
if ( matchExpr["CHILD"].test( match[0] ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1988 |
return null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1989 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1990 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1991 |
// Accept quoted arguments as-is |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1992 |
if ( match[3] && match[4] !== undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1993 |
match[2] = match[4]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1994 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1995 |
// Strip excess characters from unquoted arguments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1996 |
} else if ( unquoted && rpseudo.test( unquoted ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1997 |
// Get excess from tokenize (recursively) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1998 |
(excess = tokenize( unquoted, true )) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
1999 |
// advance to the next closing parenthesis |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2000 |
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2001 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2002 |
// excess is a negative index |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2003 |
match[0] = match[0].slice( 0, excess ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2004 |
match[2] = unquoted.slice( 0, excess ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2005 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2006 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2007 |
// Return only captures needed by the pseudo filter method (type and argument) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2008 |
return match.slice( 0, 3 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2009 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2010 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2011 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2012 |
filter: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2013 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2014 |
"TAG": function( nodeNameSelector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2015 |
var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2016 |
return nodeNameSelector === "*" ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2017 |
function() { return true; } : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2018 |
function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2019 |
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2020 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2021 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2022 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2023 |
"CLASS": function( className ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2024 |
var pattern = classCache[ className + " " ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2025 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2026 |
return pattern || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2027 |
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2028 |
classCache( className, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2029 |
return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2030 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2031 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2032 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2033 |
"ATTR": function( name, operator, check ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2034 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2035 |
var result = Sizzle.attr( elem, name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2036 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2037 |
if ( result == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2038 |
return operator === "!="; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2039 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2040 |
if ( !operator ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2041 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2042 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2043 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2044 |
result += ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2045 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2046 |
return operator === "=" ? result === check : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2047 |
operator === "!=" ? result !== check : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2048 |
operator === "^=" ? check && result.indexOf( check ) === 0 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2049 |
operator === "*=" ? check && result.indexOf( check ) > -1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2050 |
operator === "$=" ? check && result.slice( -check.length ) === check : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2051 |
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2052 |
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2053 |
false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2054 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2055 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2056 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2057 |
"CHILD": function( type, what, argument, first, last ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2058 |
var simple = type.slice( 0, 3 ) !== "nth", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2059 |
forward = type.slice( -4 ) !== "last", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2060 |
ofType = what === "of-type"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2061 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2062 |
return first === 1 && last === 0 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2063 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2064 |
// Shortcut for :nth-*(n) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2065 |
function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2066 |
return !!elem.parentNode; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2067 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2068 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2069 |
function( elem, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2070 |
var cache, outerCache, node, diff, nodeIndex, start, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2071 |
dir = simple !== forward ? "nextSibling" : "previousSibling", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2072 |
parent = elem.parentNode, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2073 |
name = ofType && elem.nodeName.toLowerCase(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2074 |
useCache = !xml && !ofType; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2075 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2076 |
if ( parent ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2077 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2078 |
// :(first|last|only)-(child|of-type) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2079 |
if ( simple ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2080 |
while ( dir ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2081 |
node = elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2082 |
while ( (node = node[ dir ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2083 |
if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2084 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2085 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2086 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2087 |
// Reverse direction for :only-* (if we haven't yet done so) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2088 |
start = dir = type === "only" && !start && "nextSibling"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2089 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2090 |
return true; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2091 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2092 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2093 |
start = [ forward ? parent.firstChild : parent.lastChild ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2094 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2095 |
// non-xml :nth-child(...) stores cache data on `parent` |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2096 |
if ( forward && useCache ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2097 |
// Seek `elem` from a previously-cached index |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2098 |
outerCache = parent[ expando ] || (parent[ expando ] = {}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2099 |
cache = outerCache[ type ] || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2100 |
nodeIndex = cache[0] === dirruns && cache[1]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2101 |
diff = cache[0] === dirruns && cache[2]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2102 |
node = nodeIndex && parent.childNodes[ nodeIndex ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2103 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2104 |
while ( (node = ++nodeIndex && node && node[ dir ] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2105 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2106 |
// Fallback to seeking `elem` from the start |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2107 |
(diff = nodeIndex = 0) || start.pop()) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2108 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2109 |
// When found, cache indexes on `parent` and break |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2110 |
if ( node.nodeType === 1 && ++diff && node === elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2111 |
outerCache[ type ] = [ dirruns, nodeIndex, diff ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2112 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2113 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2114 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2115 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2116 |
// Use previously-cached element index if available |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2117 |
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2118 |
diff = cache[1]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2119 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2120 |
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2121 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2122 |
// Use the same loop as above to seek `elem` from the start |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2123 |
while ( (node = ++nodeIndex && node && node[ dir ] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2124 |
(diff = nodeIndex = 0) || start.pop()) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2125 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2126 |
if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2127 |
// Cache the index of each encountered element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2128 |
if ( useCache ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2129 |
(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2130 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2131 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2132 |
if ( node === elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2133 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2134 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2135 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2136 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2137 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2138 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2139 |
// Incorporate the offset, then check against cycle size |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2140 |
diff -= last; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2141 |
return diff === first || ( diff % first === 0 && diff / first >= 0 ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2142 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2143 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2144 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2145 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2146 |
"PSEUDO": function( pseudo, argument ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2147 |
// pseudo-class names are case-insensitive |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2148 |
// http://www.w3.org/TR/selectors/#pseudo-classes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2149 |
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2150 |
// Remember that setFilters inherits from pseudos |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2151 |
var args, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2152 |
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2153 |
Sizzle.error( "unsupported pseudo: " + pseudo ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2154 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2155 |
// The user may use createPseudo to indicate that |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2156 |
// arguments are needed to create the filter function |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2157 |
// just as Sizzle does |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2158 |
if ( fn[ expando ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2159 |
return fn( argument ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2160 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2161 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2162 |
// But maintain support for old signatures |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2163 |
if ( fn.length > 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2164 |
args = [ pseudo, pseudo, "", argument ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2165 |
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2166 |
markFunction(function( seed, matches ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2167 |
var idx, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2168 |
matched = fn( seed, argument ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2169 |
i = matched.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2170 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2171 |
idx = indexOf.call( seed, matched[i] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2172 |
seed[ idx ] = !( matches[ idx ] = matched[i] ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2173 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2174 |
}) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2175 |
function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2176 |
return fn( elem, 0, args ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2177 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2178 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2179 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2180 |
return fn; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2181 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2182 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2183 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2184 |
pseudos: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2185 |
// Potentially complex pseudos |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2186 |
"not": markFunction(function( selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2187 |
// Trim the selector passed to compile |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2188 |
// to avoid treating leading and trailing |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2189 |
// spaces as combinators |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2190 |
var input = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2191 |
results = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2192 |
matcher = compile( selector.replace( rtrim, "$1" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2193 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2194 |
return matcher[ expando ] ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2195 |
markFunction(function( seed, matches, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2196 |
var elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2197 |
unmatched = matcher( seed, null, xml, [] ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2198 |
i = seed.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2199 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2200 |
// Match elements unmatched by `matcher` |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2201 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2202 |
if ( (elem = unmatched[i]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2203 |
seed[i] = !(matches[i] = elem); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2204 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2205 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2206 |
}) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2207 |
function( elem, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2208 |
input[0] = elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2209 |
matcher( input, null, xml, results ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2210 |
return !results.pop(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2211 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2212 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2213 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2214 |
"has": markFunction(function( selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2215 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2216 |
return Sizzle( selector, elem ).length > 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2217 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2218 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2219 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2220 |
"contains": markFunction(function( text ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2221 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2222 |
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2223 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2224 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2225 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2226 |
// "Whether an element is represented by a :lang() selector |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2227 |
// is based solely on the element's language value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2228 |
// being equal to the identifier C, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2229 |
// or beginning with the identifier C immediately followed by "-". |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2230 |
// The matching of C against the element's language value is performed case-insensitively. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2231 |
// The identifier C does not have to be a valid language name." |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2232 |
// http://www.w3.org/TR/selectors/#lang-pseudo |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2233 |
"lang": markFunction( function( lang ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2234 |
// lang value must be a valid identifier |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2235 |
if ( !ridentifier.test(lang || "") ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2236 |
Sizzle.error( "unsupported lang: " + lang ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2237 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2238 |
lang = lang.replace( runescape, funescape ).toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2239 |
return function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2240 |
var elemLang; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2241 |
do { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2242 |
if ( (elemLang = documentIsHTML ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2243 |
elem.lang : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2244 |
elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2245 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2246 |
elemLang = elemLang.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2247 |
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2248 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2249 |
} while ( (elem = elem.parentNode) && elem.nodeType === 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2250 |
return false; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2251 |
}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2252 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2253 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2254 |
// Miscellaneous |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2255 |
"target": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2256 |
var hash = window.location && window.location.hash; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2257 |
return hash && hash.slice( 1 ) === elem.id; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2258 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2259 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2260 |
"root": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2261 |
return elem === docElem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2262 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2263 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2264 |
"focus": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2265 |
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2266 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2267 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2268 |
// Boolean properties |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2269 |
"enabled": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2270 |
return elem.disabled === false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2271 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2272 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2273 |
"disabled": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2274 |
return elem.disabled === true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2275 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2276 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2277 |
"checked": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2278 |
// In CSS3, :checked should return both checked and selected elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2279 |
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2280 |
var nodeName = elem.nodeName.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2281 |
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2282 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2283 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2284 |
"selected": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2285 |
// Accessing this property makes selected-by-default |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2286 |
// options in Safari work properly |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2287 |
if ( elem.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2288 |
elem.parentNode.selectedIndex; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2289 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2290 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2291 |
return elem.selected === true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2292 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2293 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2294 |
// Contents |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2295 |
"empty": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2296 |
// http://www.w3.org/TR/selectors/#empty-pseudo |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2297 |
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2298 |
// not comment, processing instructions, or others |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2299 |
// Thanks to Diego Perini for the nodeName shortcut |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2300 |
// Greater than "@" means alpha characters (specifically not starting with "#" or "?") |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2301 |
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2302 |
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2303 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2304 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2305 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2306 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2307 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2308 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2309 |
"parent": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2310 |
return !Expr.pseudos["empty"]( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2311 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2312 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2313 |
// Element/input types |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2314 |
"header": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2315 |
return rheader.test( elem.nodeName ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2316 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2317 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2318 |
"input": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2319 |
return rinputs.test( elem.nodeName ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2320 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2321 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2322 |
"button": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2323 |
var name = elem.nodeName.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2324 |
return name === "input" && elem.type === "button" || name === "button"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2325 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2326 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2327 |
"text": function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2328 |
var attr; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2329 |
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2330 |
// use getAttribute instead to test this case |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2331 |
return elem.nodeName.toLowerCase() === "input" && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2332 |
elem.type === "text" && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2333 |
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2334 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2335 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2336 |
// Position-in-collection |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2337 |
"first": createPositionalPseudo(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2338 |
return [ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2339 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2340 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2341 |
"last": createPositionalPseudo(function( matchIndexes, length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2342 |
return [ length - 1 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2343 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2344 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2345 |
"eq": createPositionalPseudo(function( matchIndexes, length, argument ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2346 |
return [ argument < 0 ? argument + length : argument ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2347 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2348 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2349 |
"even": createPositionalPseudo(function( matchIndexes, length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2350 |
var i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2351 |
for ( ; i < length; i += 2 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2352 |
matchIndexes.push( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2353 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2354 |
return matchIndexes; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2355 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2356 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2357 |
"odd": createPositionalPseudo(function( matchIndexes, length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2358 |
var i = 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2359 |
for ( ; i < length; i += 2 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2360 |
matchIndexes.push( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2361 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2362 |
return matchIndexes; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2363 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2364 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2365 |
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2366 |
var i = argument < 0 ? argument + length : argument; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2367 |
for ( ; --i >= 0; ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2368 |
matchIndexes.push( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2369 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2370 |
return matchIndexes; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2371 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2372 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2373 |
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2374 |
var i = argument < 0 ? argument + length : argument; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2375 |
for ( ; ++i < length; ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2376 |
matchIndexes.push( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2377 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2378 |
return matchIndexes; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2379 |
}) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2380 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2381 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2382 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2383 |
Expr.pseudos["nth"] = Expr.pseudos["eq"]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2384 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2385 |
// Add button/input type pseudos |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2386 |
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2387 |
Expr.pseudos[ i ] = createInputPseudo( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2388 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2389 |
for ( i in { submit: true, reset: true } ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2390 |
Expr.pseudos[ i ] = createButtonPseudo( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2391 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2392 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2393 |
// Easy API for creating new setFilters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2394 |
function setFilters() {} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2395 |
setFilters.prototype = Expr.filters = Expr.pseudos; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2396 |
Expr.setFilters = new setFilters(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2397 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2398 |
function tokenize( selector, parseOnly ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2399 |
var matched, match, tokens, type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2400 |
soFar, groups, preFilters, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2401 |
cached = tokenCache[ selector + " " ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2402 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2403 |
if ( cached ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2404 |
return parseOnly ? 0 : cached.slice( 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2405 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2406 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2407 |
soFar = selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2408 |
groups = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2409 |
preFilters = Expr.preFilter; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2410 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2411 |
while ( soFar ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2412 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2413 |
// Comma and first run |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2414 |
if ( !matched || (match = rcomma.exec( soFar )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2415 |
if ( match ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2416 |
// Don't consume trailing commas as valid |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2417 |
soFar = soFar.slice( match[0].length ) || soFar; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2418 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2419 |
groups.push( tokens = [] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2420 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2421 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2422 |
matched = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2423 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2424 |
// Combinators |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2425 |
if ( (match = rcombinators.exec( soFar )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2426 |
matched = match.shift(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2427 |
tokens.push({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2428 |
value: matched, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2429 |
// Cast descendant combinators to space |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2430 |
type: match[0].replace( rtrim, " " ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2431 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2432 |
soFar = soFar.slice( matched.length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2433 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2434 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2435 |
// Filters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2436 |
for ( type in Expr.filter ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2437 |
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2438 |
(match = preFilters[ type ]( match ))) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2439 |
matched = match.shift(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2440 |
tokens.push({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2441 |
value: matched, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2442 |
type: type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2443 |
matches: match |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2444 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2445 |
soFar = soFar.slice( matched.length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2446 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2447 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2448 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2449 |
if ( !matched ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2450 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2451 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2452 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2453 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2454 |
// Return the length of the invalid excess |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2455 |
// if we're just parsing |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2456 |
// Otherwise, throw an error or return tokens |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2457 |
return parseOnly ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2458 |
soFar.length : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2459 |
soFar ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2460 |
Sizzle.error( selector ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2461 |
// Cache the tokens |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2462 |
tokenCache( selector, groups ).slice( 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2463 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2464 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2465 |
function toSelector( tokens ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2466 |
var i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2467 |
len = tokens.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2468 |
selector = ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2469 |
for ( ; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2470 |
selector += tokens[i].value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2471 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2472 |
return selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2473 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2474 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2475 |
function addCombinator( matcher, combinator, base ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2476 |
var dir = combinator.dir, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2477 |
checkNonElements = base && dir === "parentNode", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2478 |
doneName = done++; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2479 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2480 |
return combinator.first ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2481 |
// Check against closest ancestor/preceding element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2482 |
function( elem, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2483 |
while ( (elem = elem[ dir ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2484 |
if ( elem.nodeType === 1 || checkNonElements ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2485 |
return matcher( elem, context, xml ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2486 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2487 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2488 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2489 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2490 |
// Check against all ancestor/preceding elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2491 |
function( elem, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2492 |
var data, cache, outerCache, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2493 |
dirkey = dirruns + " " + doneName; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2494 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2495 |
// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2496 |
if ( xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2497 |
while ( (elem = elem[ dir ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2498 |
if ( elem.nodeType === 1 || checkNonElements ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2499 |
if ( matcher( elem, context, xml ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2500 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2501 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2502 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2503 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2504 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2505 |
while ( (elem = elem[ dir ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2506 |
if ( elem.nodeType === 1 || checkNonElements ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2507 |
outerCache = elem[ expando ] || (elem[ expando ] = {}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2508 |
if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2509 |
if ( (data = cache[1]) === true || data === cachedruns ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2510 |
return data === true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2511 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2512 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2513 |
cache = outerCache[ dir ] = [ dirkey ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2514 |
cache[1] = matcher( elem, context, xml ) || cachedruns; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2515 |
if ( cache[1] === true ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2516 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2517 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2518 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2519 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2520 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2521 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2522 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2523 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2524 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2525 |
function elementMatcher( matchers ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2526 |
return matchers.length > 1 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2527 |
function( elem, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2528 |
var i = matchers.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2529 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2530 |
if ( !matchers[i]( elem, context, xml ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2531 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2532 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2533 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2534 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2535 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2536 |
matchers[0]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2537 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2538 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2539 |
function condense( unmatched, map, filter, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2540 |
var elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2541 |
newUnmatched = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2542 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2543 |
len = unmatched.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2544 |
mapped = map != null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2545 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2546 |
for ( ; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2547 |
if ( (elem = unmatched[i]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2548 |
if ( !filter || filter( elem, context, xml ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2549 |
newUnmatched.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2550 |
if ( mapped ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2551 |
map.push( i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2552 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2553 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2554 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2555 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2556 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2557 |
return newUnmatched; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2558 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2559 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2560 |
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2561 |
if ( postFilter && !postFilter[ expando ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2562 |
postFilter = setMatcher( postFilter ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2563 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2564 |
if ( postFinder && !postFinder[ expando ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2565 |
postFinder = setMatcher( postFinder, postSelector ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2566 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2567 |
return markFunction(function( seed, results, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2568 |
var temp, i, elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2569 |
preMap = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2570 |
postMap = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2571 |
preexisting = results.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2572 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2573 |
// Get initial elements from seed or context |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2574 |
elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2575 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2576 |
// Prefilter to get matcher input, preserving a map for seed-results synchronization |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2577 |
matcherIn = preFilter && ( seed || !selector ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2578 |
condense( elems, preMap, preFilter, context, xml ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2579 |
elems, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2580 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2581 |
matcherOut = matcher ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2582 |
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2583 |
postFinder || ( seed ? preFilter : preexisting || postFilter ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2584 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2585 |
// ...intermediate processing is necessary |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2586 |
[] : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2587 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2588 |
// ...otherwise use results directly |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2589 |
results : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2590 |
matcherIn; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2591 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2592 |
// Find primary matches |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2593 |
if ( matcher ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2594 |
matcher( matcherIn, matcherOut, context, xml ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2595 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2596 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2597 |
// Apply postFilter |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2598 |
if ( postFilter ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2599 |
temp = condense( matcherOut, postMap ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2600 |
postFilter( temp, [], context, xml ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2601 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2602 |
// Un-match failing elements by moving them back to matcherIn |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2603 |
i = temp.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2604 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2605 |
if ( (elem = temp[i]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2606 |
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2607 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2608 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2609 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2610 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2611 |
if ( seed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2612 |
if ( postFinder || preFilter ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2613 |
if ( postFinder ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2614 |
// Get the final matcherOut by condensing this intermediate into postFinder contexts |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2615 |
temp = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2616 |
i = matcherOut.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2617 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2618 |
if ( (elem = matcherOut[i]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2619 |
// Restore matcherIn since elem is not yet a final match |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2620 |
temp.push( (matcherIn[i] = elem) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2621 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2622 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2623 |
postFinder( null, (matcherOut = []), temp, xml ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2624 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2625 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2626 |
// Move matched elements from seed to results to keep them synchronized |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2627 |
i = matcherOut.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2628 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2629 |
if ( (elem = matcherOut[i]) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2630 |
(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2631 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2632 |
seed[temp] = !(results[temp] = elem); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2633 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2634 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2635 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2636 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2637 |
// Add elements to results, through postFinder if defined |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2638 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2639 |
matcherOut = condense( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2640 |
matcherOut === results ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2641 |
matcherOut.splice( preexisting, matcherOut.length ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2642 |
matcherOut |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2643 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2644 |
if ( postFinder ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2645 |
postFinder( null, results, matcherOut, xml ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2646 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2647 |
push.apply( results, matcherOut ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2648 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2649 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2650 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2651 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2652 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2653 |
function matcherFromTokens( tokens ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2654 |
var checkContext, matcher, j, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2655 |
len = tokens.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2656 |
leadingRelative = Expr.relative[ tokens[0].type ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2657 |
implicitRelative = leadingRelative || Expr.relative[" "], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2658 |
i = leadingRelative ? 1 : 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2659 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2660 |
// The foundational matcher ensures that elements are reachable from top-level context(s) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2661 |
matchContext = addCombinator( function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2662 |
return elem === checkContext; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2663 |
}, implicitRelative, true ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2664 |
matchAnyContext = addCombinator( function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2665 |
return indexOf.call( checkContext, elem ) > -1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2666 |
}, implicitRelative, true ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2667 |
matchers = [ function( elem, context, xml ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2668 |
return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2669 |
(checkContext = context).nodeType ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2670 |
matchContext( elem, context, xml ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2671 |
matchAnyContext( elem, context, xml ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2672 |
} ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2673 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2674 |
for ( ; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2675 |
if ( (matcher = Expr.relative[ tokens[i].type ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2676 |
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2677 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2678 |
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2679 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2680 |
// Return special upon seeing a positional matcher |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2681 |
if ( matcher[ expando ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2682 |
// Find the next relative operator (if any) for proper handling |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2683 |
j = ++i; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2684 |
for ( ; j < len; j++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2685 |
if ( Expr.relative[ tokens[j].type ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2686 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2687 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2688 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2689 |
return setMatcher( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2690 |
i > 1 && elementMatcher( matchers ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2691 |
i > 1 && toSelector( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2692 |
// If the preceding token was a descendant combinator, insert an implicit any-element `*` |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2693 |
tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2694 |
).replace( rtrim, "$1" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2695 |
matcher, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2696 |
i < j && matcherFromTokens( tokens.slice( i, j ) ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2697 |
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2698 |
j < len && toSelector( tokens ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2699 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2700 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2701 |
matchers.push( matcher ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2702 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2703 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2704 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2705 |
return elementMatcher( matchers ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2706 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2707 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2708 |
function matcherFromGroupMatchers( elementMatchers, setMatchers ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2709 |
// A counter to specify which element is currently being matched |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2710 |
var matcherCachedRuns = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2711 |
bySet = setMatchers.length > 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2712 |
byElement = elementMatchers.length > 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2713 |
superMatcher = function( seed, context, xml, results, expandContext ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2714 |
var elem, j, matcher, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2715 |
setMatched = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2716 |
matchedCount = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2717 |
i = "0", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2718 |
unmatched = seed && [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2719 |
outermost = expandContext != null, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2720 |
contextBackup = outermostContext, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2721 |
// We must always have either seed elements or context |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2722 |
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2723 |
// Use integer dirruns iff this is the outermost matcher |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2724 |
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2725 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2726 |
if ( outermost ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2727 |
outermostContext = context !== document && context; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2728 |
cachedruns = matcherCachedRuns; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2729 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2730 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2731 |
// Add elements passing elementMatchers directly to results |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2732 |
// Keep `i` a string if there are no elements so `matchedCount` will be "00" below |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2733 |
for ( ; (elem = elems[i]) != null; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2734 |
if ( byElement && elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2735 |
j = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2736 |
while ( (matcher = elementMatchers[j++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2737 |
if ( matcher( elem, context, xml ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2738 |
results.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2739 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2740 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2741 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2742 |
if ( outermost ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2743 |
dirruns = dirrunsUnique; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2744 |
cachedruns = ++matcherCachedRuns; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2745 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2746 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2747 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2748 |
// Track unmatched elements for set filters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2749 |
if ( bySet ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2750 |
// They will have gone through all possible matchers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2751 |
if ( (elem = !matcher && elem) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2752 |
matchedCount--; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2753 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2754 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2755 |
// Lengthen the array for every element, matched or not |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2756 |
if ( seed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2757 |
unmatched.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2758 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2759 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2760 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2761 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2762 |
// Apply set filters to unmatched elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2763 |
matchedCount += i; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2764 |
if ( bySet && i !== matchedCount ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2765 |
j = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2766 |
while ( (matcher = setMatchers[j++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2767 |
matcher( unmatched, setMatched, context, xml ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2768 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2769 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2770 |
if ( seed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2771 |
// Reintegrate element matches to eliminate the need for sorting |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2772 |
if ( matchedCount > 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2773 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2774 |
if ( !(unmatched[i] || setMatched[i]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2775 |
setMatched[i] = pop.call( results ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2776 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2777 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2778 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2779 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2780 |
// Discard index placeholder values to get only actual matches |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2781 |
setMatched = condense( setMatched ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2782 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2783 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2784 |
// Add matches to results |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2785 |
push.apply( results, setMatched ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2786 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2787 |
// Seedless set matches succeeding multiple successful matchers stipulate sorting |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2788 |
if ( outermost && !seed && setMatched.length > 0 && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2789 |
( matchedCount + setMatchers.length ) > 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2790 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2791 |
Sizzle.uniqueSort( results ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2792 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2793 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2794 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2795 |
// Override manipulation of globals by nested matchers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2796 |
if ( outermost ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2797 |
dirruns = dirrunsUnique; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2798 |
outermostContext = contextBackup; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2799 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2800 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2801 |
return unmatched; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2802 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2803 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2804 |
return bySet ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2805 |
markFunction( superMatcher ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2806 |
superMatcher; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2807 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2808 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2809 |
compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2810 |
var i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2811 |
setMatchers = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2812 |
elementMatchers = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2813 |
cached = compilerCache[ selector + " " ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2814 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2815 |
if ( !cached ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2816 |
// Generate a function of recursive functions that can be used to check each element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2817 |
if ( !group ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2818 |
group = tokenize( selector ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2819 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2820 |
i = group.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2821 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2822 |
cached = matcherFromTokens( group[i] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2823 |
if ( cached[ expando ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2824 |
setMatchers.push( cached ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2825 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2826 |
elementMatchers.push( cached ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2827 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2828 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2829 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2830 |
// Cache the compiled function |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2831 |
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2832 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2833 |
return cached; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2834 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2835 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2836 |
function multipleContexts( selector, contexts, results ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2837 |
var i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2838 |
len = contexts.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2839 |
for ( ; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2840 |
Sizzle( selector, contexts[i], results ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2841 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2842 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2843 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2844 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2845 |
function select( selector, context, results, seed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2846 |
var i, tokens, token, type, find, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2847 |
match = tokenize( selector ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2848 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2849 |
if ( !seed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2850 |
// Try to minimize operations if there is only one group |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2851 |
if ( match.length === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2852 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2853 |
// Take a shortcut and set the context if the root selector is an ID |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2854 |
tokens = match[0] = match[0].slice( 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2855 |
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2856 |
support.getById && context.nodeType === 9 && documentIsHTML && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2857 |
Expr.relative[ tokens[1].type ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2858 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2859 |
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2860 |
if ( !context ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2861 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2862 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2863 |
selector = selector.slice( tokens.shift().value.length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2864 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2865 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2866 |
// Fetch a seed set for right-to-left matching |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2867 |
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2868 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2869 |
token = tokens[i]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2870 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2871 |
// Abort if we hit a combinator |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2872 |
if ( Expr.relative[ (type = token.type) ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2873 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2874 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2875 |
if ( (find = Expr.find[ type ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2876 |
// Search, expanding context for leading sibling combinators |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2877 |
if ( (seed = find( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2878 |
token.matches[0].replace( runescape, funescape ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2879 |
rsibling.test( tokens[0].type ) && context.parentNode || context |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2880 |
)) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2881 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2882 |
// If seed is empty or no tokens remain, we can return early |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2883 |
tokens.splice( i, 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2884 |
selector = seed.length && toSelector( tokens ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2885 |
if ( !selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2886 |
push.apply( results, seed ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2887 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2888 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2889 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2890 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2891 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2892 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2893 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2894 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2895 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2896 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2897 |
// Compile and execute a filtering function |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2898 |
// Provide `match` to avoid retokenization if we modified the selector above |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2899 |
compile( selector, match )( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2900 |
seed, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2901 |
context, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2902 |
!documentIsHTML, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2903 |
results, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2904 |
rsibling.test( selector ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2905 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2906 |
return results; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2907 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2908 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2909 |
// One-time assignments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2910 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2911 |
// Sort stability |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2912 |
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2913 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2914 |
// Support: Chrome<14 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2915 |
// Always assume duplicates if they aren't passed to the comparison function |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2916 |
support.detectDuplicates = hasDuplicate; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2917 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2918 |
// Initialize against the default document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2919 |
setDocument(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2920 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2921 |
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2922 |
// Detached nodes confoundingly follow *each other* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2923 |
support.sortDetached = assert(function( div1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2924 |
// Should return 1, but returns 4 (following) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2925 |
return div1.compareDocumentPosition( document.createElement("div") ) & 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2926 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2927 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2928 |
// Support: IE<8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2929 |
// Prevent attribute/property "interpolation" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2930 |
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2931 |
if ( !assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2932 |
div.innerHTML = "<a href='#'></a>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2933 |
return div.firstChild.getAttribute("href") === "#" ; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2934 |
}) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2935 |
addHandle( "type|href|height|width", function( elem, name, isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2936 |
if ( !isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2937 |
return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2938 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2939 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2940 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2941 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2942 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2943 |
// Use defaultValue in place of getAttribute("value") |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2944 |
if ( !support.attributes || !assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2945 |
div.innerHTML = "<input/>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2946 |
div.firstChild.setAttribute( "value", "" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2947 |
return div.firstChild.getAttribute( "value" ) === ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2948 |
}) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2949 |
addHandle( "value", function( elem, name, isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2950 |
if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2951 |
return elem.defaultValue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2952 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2953 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2954 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2955 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2956 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2957 |
// Use getAttributeNode to fetch booleans when getAttribute lies |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2958 |
if ( !assert(function( div ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2959 |
return div.getAttribute("disabled") == null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2960 |
}) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2961 |
addHandle( booleans, function( elem, name, isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2962 |
var val; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2963 |
if ( !isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2964 |
return (val = elem.getAttributeNode( name )) && val.specified ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2965 |
val.value : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2966 |
elem[ name ] === true ? name.toLowerCase() : null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2967 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2968 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2969 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2970 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2971 |
jQuery.find = Sizzle; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2972 |
jQuery.expr = Sizzle.selectors; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2973 |
jQuery.expr[":"] = jQuery.expr.pseudos; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2974 |
jQuery.unique = Sizzle.uniqueSort; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2975 |
jQuery.text = Sizzle.getText; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2976 |
jQuery.isXMLDoc = Sizzle.isXML; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2977 |
jQuery.contains = Sizzle.contains; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2978 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2979 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2980 |
})( window ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2981 |
// String to Object options format cache |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2982 |
var optionsCache = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2983 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2984 |
// Convert String-formatted options into Object-formatted ones and store in cache |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2985 |
function createOptions( options ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2986 |
var object = optionsCache[ options ] = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2987 |
jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2988 |
object[ flag ] = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2989 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2990 |
return object; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2991 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2992 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2993 |
/* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2994 |
* Create a callback list using the following parameters: |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2995 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2996 |
* options: an optional list of space-separated options that will change how |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2997 |
* the callback list behaves or a more traditional option object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2998 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
2999 |
* By default a callback list will act like an event callback list and can be |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3000 |
* "fired" multiple times. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3001 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3002 |
* Possible options: |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3003 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3004 |
* once: will ensure the callback list can only be fired once (like a Deferred) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3005 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3006 |
* memory: will keep track of previous values and will call any callback added |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3007 |
* after the list has been fired right away with the latest "memorized" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3008 |
* values (like a Deferred) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3009 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3010 |
* unique: will ensure a callback can only be added once (no duplicate in the list) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3011 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3012 |
* stopOnFalse: interrupt callings when a callback returns false |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3013 |
* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3014 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3015 |
jQuery.Callbacks = function( options ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3016 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3017 |
// Convert options from String-formatted to Object-formatted if needed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3018 |
// (we check in cache first) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3019 |
options = typeof options === "string" ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3020 |
( optionsCache[ options ] || createOptions( options ) ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3021 |
jQuery.extend( {}, options ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3022 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3023 |
var // Flag to know if list is currently firing |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3024 |
firing, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3025 |
// Last fire value (for non-forgettable lists) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3026 |
memory, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3027 |
// Flag to know if list was already fired |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3028 |
fired, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3029 |
// End of the loop when firing |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3030 |
firingLength, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3031 |
// Index of currently firing callback (modified by remove if needed) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3032 |
firingIndex, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3033 |
// First callback to fire (used internally by add and fireWith) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3034 |
firingStart, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3035 |
// Actual callback list |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3036 |
list = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3037 |
// Stack of fire calls for repeatable lists |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3038 |
stack = !options.once && [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3039 |
// Fire callbacks |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3040 |
fire = function( data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3041 |
memory = options.memory && data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3042 |
fired = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3043 |
firingIndex = firingStart || 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3044 |
firingStart = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3045 |
firingLength = list.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3046 |
firing = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3047 |
for ( ; list && firingIndex < firingLength; firingIndex++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3048 |
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3049 |
memory = false; // To prevent further calls using add |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3050 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3051 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3052 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3053 |
firing = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3054 |
if ( list ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3055 |
if ( stack ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3056 |
if ( stack.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3057 |
fire( stack.shift() ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3058 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3059 |
} else if ( memory ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3060 |
list = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3061 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3062 |
self.disable(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3063 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3064 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3065 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3066 |
// Actual Callbacks object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3067 |
self = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3068 |
// Add a callback or a collection of callbacks to the list |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3069 |
add: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3070 |
if ( list ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3071 |
// First, we save the current length |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3072 |
var start = list.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3073 |
(function add( args ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3074 |
jQuery.each( args, function( _, arg ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3075 |
var type = jQuery.type( arg ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3076 |
if ( type === "function" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3077 |
if ( !options.unique || !self.has( arg ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3078 |
list.push( arg ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3079 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3080 |
} else if ( arg && arg.length && type !== "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3081 |
// Inspect recursively |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3082 |
add( arg ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3083 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3084 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3085 |
})( arguments ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3086 |
// Do we need to add the callbacks to the |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3087 |
// current firing batch? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3088 |
if ( firing ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3089 |
firingLength = list.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3090 |
// With memory, if we're not firing then |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3091 |
// we should call right away |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3092 |
} else if ( memory ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3093 |
firingStart = start; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3094 |
fire( memory ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3095 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3096 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3097 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3098 |
}, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3099 |
// Remove a callback from the list |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3100 |
remove: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3101 |
if ( list ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3102 |
jQuery.each( arguments, function( _, arg ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3103 |
var index; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3104 |
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3105 |
list.splice( index, 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3106 |
// Handle firing indexes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3107 |
if ( firing ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3108 |
if ( index <= firingLength ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3109 |
firingLength--; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3110 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3111 |
if ( index <= firingIndex ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3112 |
firingIndex--; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3113 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3114 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3115 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3116 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3117 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3118 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3119 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3120 |
// Check if a given callback is in the list. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3121 |
// If no argument is given, return whether or not list has callbacks attached. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3122 |
has: function( fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3123 |
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3124 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3125 |
// Remove all callbacks from the list |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3126 |
empty: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3127 |
list = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3128 |
firingLength = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3129 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3130 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3131 |
// Have the list do nothing anymore |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3132 |
disable: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3133 |
list = stack = memory = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3134 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3135 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3136 |
// Is it disabled? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3137 |
disabled: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3138 |
return !list; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3139 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3140 |
// Lock the list in its current state |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3141 |
lock: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3142 |
stack = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3143 |
if ( !memory ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3144 |
self.disable(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3145 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3146 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3147 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3148 |
// Is it locked? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3149 |
locked: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3150 |
return !stack; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3151 |
}, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3152 |
// Call all callbacks with the given context and arguments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3153 |
fireWith: function( context, args ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3154 |
if ( list && ( !fired || stack ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3155 |
args = args || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3156 |
args = [ context, args.slice ? args.slice() : args ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3157 |
if ( firing ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3158 |
stack.push( args ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3159 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3160 |
fire( args ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3161 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3162 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3163 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3164 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3165 |
// Call all the callbacks with the given arguments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3166 |
fire: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3167 |
self.fireWith( this, arguments ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3168 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3169 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3170 |
// To know if the callbacks have already been called at least once |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3171 |
fired: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3172 |
return !!fired; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3173 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3174 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3175 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3176 |
return self; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3177 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3178 |
jQuery.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3179 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3180 |
Deferred: function( func ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3181 |
var tuples = [ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3182 |
// action, add listener, listener list, final state |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3183 |
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3184 |
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3185 |
[ "notify", "progress", jQuery.Callbacks("memory") ] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3186 |
], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3187 |
state = "pending", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3188 |
promise = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3189 |
state: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3190 |
return state; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3191 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3192 |
always: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3193 |
deferred.done( arguments ).fail( arguments ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3194 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3195 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3196 |
then: function( /* fnDone, fnFail, fnProgress */ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3197 |
var fns = arguments; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3198 |
return jQuery.Deferred(function( newDefer ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3199 |
jQuery.each( tuples, function( i, tuple ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3200 |
var action = tuple[ 0 ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3201 |
fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3202 |
// deferred[ done | fail | progress ] for forwarding actions to newDefer |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3203 |
deferred[ tuple[1] ](function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3204 |
var returned = fn && fn.apply( this, arguments ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3205 |
if ( returned && jQuery.isFunction( returned.promise ) ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3206 |
returned.promise() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3207 |
.done( newDefer.resolve ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3208 |
.fail( newDefer.reject ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3209 |
.progress( newDefer.notify ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3210 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3211 |
newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3212 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3213 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3214 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3215 |
fns = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3216 |
}).promise(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3217 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3218 |
// Get a promise for this deferred |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3219 |
// If obj is provided, the promise aspect is added to the object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3220 |
promise: function( obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3221 |
return obj != null ? jQuery.extend( obj, promise ) : promise; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3222 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3223 |
}, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3224 |
deferred = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3225 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3226 |
// Keep pipe for back-compat |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3227 |
promise.pipe = promise.then; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3228 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3229 |
// Add list-specific methods |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3230 |
jQuery.each( tuples, function( i, tuple ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3231 |
var list = tuple[ 2 ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3232 |
stateString = tuple[ 3 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3233 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3234 |
// promise[ done | fail | progress ] = list.add |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3235 |
promise[ tuple[1] ] = list.add; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3236 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3237 |
// Handle state |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3238 |
if ( stateString ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3239 |
list.add(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3240 |
// state = [ resolved | rejected ] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3241 |
state = stateString; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3242 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3243 |
// [ reject_list | resolve_list ].disable; progress_list.lock |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3244 |
}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3245 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3246 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3247 |
// deferred[ resolve | reject | notify ] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3248 |
deferred[ tuple[0] ] = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3249 |
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3250 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3251 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3252 |
deferred[ tuple[0] + "With" ] = list.fireWith; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3253 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3254 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3255 |
// Make the deferred a promise |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3256 |
promise.promise( deferred ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3257 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3258 |
// Call given func if any |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3259 |
if ( func ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3260 |
func.call( deferred, deferred ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3261 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3262 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3263 |
// All done! |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3264 |
return deferred; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3265 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3266 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3267 |
// Deferred helper |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3268 |
when: function( subordinate /* , ..., subordinateN */ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3269 |
var i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3270 |
resolveValues = core_slice.call( arguments ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3271 |
length = resolveValues.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3272 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3273 |
// the count of uncompleted subordinates |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3274 |
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3275 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3276 |
// the master Deferred. If resolveValues consist of only a single Deferred, just use that. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3277 |
deferred = remaining === 1 ? subordinate : jQuery.Deferred(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3278 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3279 |
// Update function for both resolve and progress values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3280 |
updateFunc = function( i, contexts, values ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3281 |
return function( value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3282 |
contexts[ i ] = this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3283 |
values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3284 |
if( values === progressValues ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3285 |
deferred.notifyWith( contexts, values ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3286 |
} else if ( !( --remaining ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3287 |
deferred.resolveWith( contexts, values ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3288 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3289 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3290 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3291 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3292 |
progressValues, progressContexts, resolveContexts; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3293 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3294 |
// add listeners to Deferred subordinates; treat others as resolved |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3295 |
if ( length > 1 ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3296 |
progressValues = new Array( length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3297 |
progressContexts = new Array( length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3298 |
resolveContexts = new Array( length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3299 |
for ( ; i < length; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3300 |
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3301 |
resolveValues[ i ].promise() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3302 |
.done( updateFunc( i, resolveContexts, resolveValues ) ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3303 |
.fail( deferred.reject ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3304 |
.progress( updateFunc( i, progressContexts, progressValues ) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3305 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3306 |
--remaining; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3307 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3308 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3309 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3310 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3311 |
// if we're not waiting on anything, resolve the master |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3312 |
if ( !remaining ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3313 |
deferred.resolveWith( resolveContexts, resolveValues ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3314 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3315 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3316 |
return deferred.promise(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3317 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3318 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3319 |
jQuery.support = (function( support ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3320 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3321 |
var all, a, input, select, fragment, opt, eventName, isSupported, i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3322 |
div = document.createElement("div"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3323 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3324 |
// Setup |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3325 |
div.setAttribute( "className", "t" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3326 |
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3327 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3328 |
// Finish early in limited (non-browser) environments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3329 |
all = div.getElementsByTagName("*") || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3330 |
a = div.getElementsByTagName("a")[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3331 |
if ( !a || !a.style || !all.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3332 |
return support; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3333 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3334 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3335 |
// First batch of tests |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3336 |
select = document.createElement("select"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3337 |
opt = select.appendChild( document.createElement("option") ); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3338 |
input = div.getElementsByTagName("input")[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3339 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3340 |
a.style.cssText = "top:1px;float:left;opacity:.5"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3341 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3342 |
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3343 |
support.getSetAttribute = div.className !== "t"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3344 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3345 |
// IE strips leading whitespace when .innerHTML is used |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3346 |
support.leadingWhitespace = div.firstChild.nodeType === 3; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3347 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3348 |
// Make sure that tbody elements aren't automatically inserted |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3349 |
// IE will insert them into empty tables |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3350 |
support.tbody = !div.getElementsByTagName("tbody").length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3351 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3352 |
// Make sure that link elements get serialized correctly by innerHTML |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3353 |
// This requires a wrapper element in IE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3354 |
support.htmlSerialize = !!div.getElementsByTagName("link").length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3355 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3356 |
// Get the style information from getAttribute |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3357 |
// (IE uses .cssText instead) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3358 |
support.style = /top/.test( a.getAttribute("style") ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3359 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3360 |
// Make sure that URLs aren't manipulated |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3361 |
// (IE normalizes it by default) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3362 |
support.hrefNormalized = a.getAttribute("href") === "/a"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3363 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3364 |
// Make sure that element opacity exists |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3365 |
// (IE uses filter instead) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3366 |
// Use a regex to work around a WebKit issue. See #5145 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3367 |
support.opacity = /^0.5/.test( a.style.opacity ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3368 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3369 |
// Verify style float existence |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3370 |
// (IE uses styleFloat instead of cssFloat) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3371 |
support.cssFloat = !!a.style.cssFloat; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3372 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3373 |
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3374 |
support.checkOn = !!input.value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3375 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3376 |
// Make sure that a selected-by-default option has a working selected property. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3377 |
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3378 |
support.optSelected = opt.selected; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3379 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3380 |
// Tests for enctype support on a form (#6743) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3381 |
support.enctype = !!document.createElement("form").enctype; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3382 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3383 |
// Makes sure cloning an html5 element does not cause problems |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3384 |
// Where outerHTML is undefined, this still works |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3385 |
support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3386 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3387 |
// Will be defined later |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3388 |
support.inlineBlockNeedsLayout = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3389 |
support.shrinkWrapBlocks = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3390 |
support.pixelPosition = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3391 |
support.deleteExpando = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3392 |
support.noCloneEvent = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3393 |
support.reliableMarginRight = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3394 |
support.boxSizingReliable = true; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3395 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3396 |
// Make sure checked status is properly cloned |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3397 |
input.checked = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3398 |
support.noCloneChecked = input.cloneNode( true ).checked; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3399 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3400 |
// Make sure that the options inside disabled selects aren't marked as disabled |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3401 |
// (WebKit marks them as disabled) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3402 |
select.disabled = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3403 |
support.optDisabled = !opt.disabled; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3404 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3405 |
// Support: IE<9 |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3406 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3407 |
delete div.test; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3408 |
} catch( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3409 |
support.deleteExpando = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3410 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3411 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3412 |
// Check if we can trust getAttribute("value") |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3413 |
input = document.createElement("input"); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3414 |
input.setAttribute( "value", "" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3415 |
support.input = input.getAttribute( "value" ) === ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3416 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3417 |
// Check if an input maintains its value after becoming a radio |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3418 |
input.value = "t"; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3419 |
input.setAttribute( "type", "radio" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3420 |
support.radioValue = input.value === "t"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3421 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3422 |
// #11217 - WebKit loses check when the name is after the checked attribute |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3423 |
input.setAttribute( "checked", "t" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3424 |
input.setAttribute( "name", "t" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3425 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3426 |
fragment = document.createDocumentFragment(); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3427 |
fragment.appendChild( input ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3428 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3429 |
// Check if a disconnected checkbox will retain its checked |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3430 |
// value of true after appended to the DOM (IE6/7) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3431 |
support.appendChecked = input.checked; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3432 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3433 |
// WebKit doesn't clone checked state correctly in fragments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3434 |
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3435 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3436 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3437 |
// Opera does not clone events (and typeof div.attachEvent === undefined). |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3438 |
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click() |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3439 |
if ( div.attachEvent ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3440 |
div.attachEvent( "onclick", function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3441 |
support.noCloneEvent = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3442 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3443 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3444 |
div.cloneNode( true ).click(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3445 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3446 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3447 |
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3448 |
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3449 |
for ( i in { submit: true, change: true, focusin: true }) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3450 |
div.setAttribute( eventName = "on" + i, "t" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3451 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3452 |
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3453 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3454 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3455 |
div.style.backgroundClip = "content-box"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3456 |
div.cloneNode( true ).style.backgroundClip = ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3457 |
support.clearCloneStyle = div.style.backgroundClip === "content-box"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3458 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3459 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3460 |
// Iteration over object's inherited properties before its own. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3461 |
for ( i in jQuery( support ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3462 |
break; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3463 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3464 |
support.ownLast = i !== "0"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3465 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3466 |
// Run tests that need a body at doc ready |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3467 |
jQuery(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3468 |
var container, marginDiv, tds, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3469 |
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3470 |
body = document.getElementsByTagName("body")[0]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3471 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3472 |
if ( !body ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3473 |
// Return for frameset docs that don't have a body |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3474 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3475 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3476 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3477 |
container = document.createElement("div"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3478 |
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3479 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3480 |
body.appendChild( container ).appendChild( div ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3481 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3482 |
// Support: IE8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3483 |
// Check if table cells still have offsetWidth/Height when they are set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3484 |
// to display:none and there are still other visible table cells in a |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3485 |
// table row; if so, offsetWidth/Height are not reliable for use when |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3486 |
// determining if an element has been hidden directly using |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3487 |
// display:none (it is still safe to use offsets if a parent element is |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3488 |
// hidden; don safety goggles and see bug #4512 for more information). |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3489 |
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3490 |
tds = div.getElementsByTagName("td"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3491 |
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3492 |
isSupported = ( tds[ 0 ].offsetHeight === 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3493 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3494 |
tds[ 0 ].style.display = ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3495 |
tds[ 1 ].style.display = "none"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3496 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3497 |
// Support: IE8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3498 |
// Check if empty table cells still have offsetWidth/Height |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3499 |
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3500 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3501 |
// Check box-sizing and margin behavior. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3502 |
div.innerHTML = ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3503 |
div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3504 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3505 |
// Workaround failing boxSizing test due to offsetWidth returning wrong value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3506 |
// with some non-1 values of body zoom, ticket #13543 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3507 |
jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3508 |
support.boxSizing = div.offsetWidth === 4; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3509 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3510 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3511 |
// Use window.getComputedStyle because jsdom on node.js will break without it. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3512 |
if ( window.getComputedStyle ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3513 |
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3514 |
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3515 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3516 |
// Check if div with explicit width and no margin-right incorrectly |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3517 |
// gets computed margin-right based on width of container. (#3333) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3518 |
// Fails in WebKit before Feb 2011 nightlies |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3519 |
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3520 |
marginDiv = div.appendChild( document.createElement("div") ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3521 |
marginDiv.style.cssText = div.style.cssText = divReset; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3522 |
marginDiv.style.marginRight = marginDiv.style.width = "0"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3523 |
div.style.width = "1px"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3524 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3525 |
support.reliableMarginRight = |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3526 |
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3527 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3528 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3529 |
if ( typeof div.style.zoom !== core_strundefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3530 |
// Support: IE<8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3531 |
// Check if natively block-level elements act like inline-block |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3532 |
// elements when setting their display to 'inline' and giving |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3533 |
// them layout |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3534 |
div.innerHTML = ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3535 |
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3536 |
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3537 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3538 |
// Support: IE6 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3539 |
// Check if elements with layout shrink-wrap their children |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3540 |
div.style.display = "block"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3541 |
div.innerHTML = "<div></div>"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3542 |
div.firstChild.style.width = "5px"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3543 |
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3544 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3545 |
if ( support.inlineBlockNeedsLayout ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3546 |
// Prevent IE 6 from affecting layout for positioned elements #11048 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3547 |
// Prevent IE from shrinking the body in IE 7 mode #12869 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3548 |
// Support: IE<8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3549 |
body.style.zoom = 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3550 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3551 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3552 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3553 |
body.removeChild( container ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3554 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3555 |
// Null elements to avoid leaks in IE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3556 |
container = div = tds = marginDiv = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3557 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3558 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3559 |
// Null elements to avoid leaks in IE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3560 |
all = select = fragment = opt = a = input = null; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3561 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3562 |
return support; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3563 |
})({}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3564 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3565 |
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
3566 |
rmultiDash = /([A-Z])/g; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3567 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3568 |
function internalData( elem, name, data, pvt /* Internal Use Only */ ){ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3569 |
if ( !jQuery.acceptData( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3570 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3571 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3572 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3573 |
var ret, thisCache, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3574 |
internalKey = jQuery.expando, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3575 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3576 |
// We have to handle DOM nodes and JS objects differently because IE6-7 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3577 |
// can't GC object references properly across the DOM-JS boundary |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3578 |
isNode = elem.nodeType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3579 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3580 |
// Only DOM nodes need the global jQuery cache; JS object data is |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3581 |
// attached directly to the object so GC can occur automatically |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3582 |
cache = isNode ? jQuery.cache : elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3583 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3584 |
// Only defining an ID for JS objects if its cache already exists allows |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3585 |
// the code to shortcut on the same path as a DOM node with no cache |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3586 |
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3587 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3588 |
// Avoid doing any more work than we need to when trying to get data on an |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3589 |
// object that has no data at all |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3590 |
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3591 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3592 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3593 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3594 |
if ( !id ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3595 |
// Only DOM nodes need a new unique ID for each element since their data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3596 |
// ends up in the global cache |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3597 |
if ( isNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3598 |
id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3599 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3600 |
id = internalKey; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3601 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3602 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3603 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3604 |
if ( !cache[ id ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3605 |
// Avoid exposing jQuery metadata on plain JS objects when the object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3606 |
// is serialized using JSON.stringify |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3607 |
cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3608 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3609 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3610 |
// An object can be passed to jQuery.data instead of a key/value pair; this gets |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3611 |
// shallow copied over onto the existing cache |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3612 |
if ( typeof name === "object" || typeof name === "function" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3613 |
if ( pvt ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3614 |
cache[ id ] = jQuery.extend( cache[ id ], name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3615 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3616 |
cache[ id ].data = jQuery.extend( cache[ id ].data, name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3617 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3618 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3619 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3620 |
thisCache = cache[ id ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3621 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3622 |
// jQuery data() is stored in a separate object inside the object's internal data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3623 |
// cache in order to avoid key collisions between internal data and user-defined |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3624 |
// data. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3625 |
if ( !pvt ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3626 |
if ( !thisCache.data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3627 |
thisCache.data = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3628 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3629 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3630 |
thisCache = thisCache.data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3631 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3632 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3633 |
if ( data !== undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3634 |
thisCache[ jQuery.camelCase( name ) ] = data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3635 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3636 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3637 |
// Check for both converted-to-camel and non-converted data property names |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3638 |
// If a data property was specified |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3639 |
if ( typeof name === "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3640 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3641 |
// First Try to find as-is property data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3642 |
ret = thisCache[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3643 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3644 |
// Test for null|undefined property data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3645 |
if ( ret == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3646 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3647 |
// Try to find the camelCased property |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3648 |
ret = thisCache[ jQuery.camelCase( name ) ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3649 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3650 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3651 |
ret = thisCache; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3652 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3653 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3654 |
return ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3655 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3656 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3657 |
function internalRemoveData( elem, name, pvt ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3658 |
if ( !jQuery.acceptData( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3659 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3660 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3661 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3662 |
var thisCache, i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3663 |
isNode = elem.nodeType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3664 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3665 |
// See jQuery.data for more information |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3666 |
cache = isNode ? jQuery.cache : elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3667 |
id = isNode ? elem[ jQuery.expando ] : jQuery.expando; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3668 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3669 |
// If there is already no cache entry for this object, there is no |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3670 |
// purpose in continuing |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3671 |
if ( !cache[ id ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3672 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3673 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3674 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3675 |
if ( name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3676 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3677 |
thisCache = pvt ? cache[ id ] : cache[ id ].data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3678 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3679 |
if ( thisCache ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3680 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3681 |
// Support array or space separated string names for data keys |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3682 |
if ( !jQuery.isArray( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3683 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3684 |
// try the string as a key before any manipulation |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3685 |
if ( name in thisCache ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3686 |
name = [ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3687 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3688 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3689 |
// split the camel cased version by spaces unless a key with the spaces exists |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3690 |
name = jQuery.camelCase( name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3691 |
if ( name in thisCache ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3692 |
name = [ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3693 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3694 |
name = name.split(" "); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3695 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3696 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3697 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3698 |
// If "name" is an array of keys... |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3699 |
// When data is initially created, via ("key", "val") signature, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3700 |
// keys will be converted to camelCase. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3701 |
// Since there is no way to tell _how_ a key was added, remove |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3702 |
// both plain key and camelCase key. #12786 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3703 |
// This will only penalize the array argument path. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3704 |
name = name.concat( jQuery.map( name, jQuery.camelCase ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3705 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3706 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3707 |
i = name.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3708 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3709 |
delete thisCache[ name[i] ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3710 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3711 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3712 |
// If there is no data left in the cache, we want to continue |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3713 |
// and let the cache object itself get destroyed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3714 |
if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3715 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3716 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3717 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3718 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3719 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3720 |
// See jQuery.data for more information |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3721 |
if ( !pvt ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3722 |
delete cache[ id ].data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3723 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3724 |
// Don't destroy the parent cache unless the internal data object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3725 |
// had been the only thing left in it |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3726 |
if ( !isEmptyDataObject( cache[ id ] ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3727 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3728 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3729 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3730 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3731 |
// Destroy the cache |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3732 |
if ( isNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3733 |
jQuery.cleanData( [ elem ], true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3734 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3735 |
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3736 |
/* jshint eqeqeq: false */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3737 |
} else if ( jQuery.support.deleteExpando || cache != cache.window ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3738 |
/* jshint eqeqeq: true */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3739 |
delete cache[ id ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3740 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3741 |
// When all else fails, null |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3742 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3743 |
cache[ id ] = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3744 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3745 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3746 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3747 |
jQuery.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3748 |
cache: {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3749 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3750 |
// The following elements throw uncatchable exceptions if you |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3751 |
// attempt to add expando properties to them. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3752 |
noData: { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3753 |
"applet": true, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3754 |
"embed": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3755 |
// Ban all objects except for Flash (which handle expandos) |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3756 |
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3757 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3758 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3759 |
hasData: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3760 |
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3761 |
return !!elem && !isEmptyDataObject( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3762 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3763 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3764 |
data: function( elem, name, data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3765 |
return internalData( elem, name, data ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3766 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3767 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3768 |
removeData: function( elem, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3769 |
return internalRemoveData( elem, name ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3770 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3771 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3772 |
// For internal use only. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3773 |
_data: function( elem, name, data ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3774 |
return internalData( elem, name, data, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3775 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3776 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3777 |
_removeData: function( elem, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3778 |
return internalRemoveData( elem, name, true ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3779 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3780 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3781 |
// A method for determining if a DOM node can handle the data expando |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3782 |
acceptData: function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3783 |
// Do not set data on non-element because it will not be cleared (#8335). |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3784 |
if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3785 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3786 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3787 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3788 |
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3789 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3790 |
// nodes accept data unless otherwise specified; rejection can be conditional |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3791 |
return !noData || noData !== true && elem.getAttribute("classid") === noData; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3792 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3793 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3794 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3795 |
jQuery.fn.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3796 |
data: function( key, value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3797 |
var attrs, name, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3798 |
data = null, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3799 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3800 |
elem = this[0]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3801 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3802 |
// Special expections of .data basically thwart jQuery.access, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3803 |
// so implement the relevant behavior ourselves |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3804 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3805 |
// Gets all values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3806 |
if ( key === undefined ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3807 |
if ( this.length ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3808 |
data = jQuery.data( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3809 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3810 |
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3811 |
attrs = elem.attributes; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3812 |
for ( ; i < attrs.length; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3813 |
name = attrs[i].name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3814 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3815 |
if ( name.indexOf("data-") === 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3816 |
name = jQuery.camelCase( name.slice(5) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3817 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3818 |
dataAttr( elem, name, data[ name ] ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3819 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3820 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3821 |
jQuery._data( elem, "parsedAttrs", true ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3822 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3823 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3824 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3825 |
return data; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3826 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3827 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3828 |
// Sets multiple values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3829 |
if ( typeof key === "object" ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3830 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3831 |
jQuery.data( this, key ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3832 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3833 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3834 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3835 |
return arguments.length > 1 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3836 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3837 |
// Sets one value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3838 |
this.each(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3839 |
jQuery.data( this, key, value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3840 |
}) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3841 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3842 |
// Gets one value |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3843 |
// Try to fetch any internally stored data first |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3844 |
elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3845 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3846 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3847 |
removeData: function( key ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3848 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3849 |
jQuery.removeData( this, key ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3850 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3851 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3852 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3853 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3854 |
function dataAttr( elem, key, data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3855 |
// If nothing was found internally, try to fetch any |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3856 |
// data from the HTML5 data-* attribute |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3857 |
if ( data === undefined && elem.nodeType === 1 ) { |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
3858 |
|
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
3859 |
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3860 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3861 |
data = elem.getAttribute( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3862 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3863 |
if ( typeof data === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3864 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3865 |
data = data === "true" ? true : |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3866 |
data === "false" ? false : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3867 |
data === "null" ? null : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3868 |
// Only convert to a number if it doesn't change the string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3869 |
+data + "" === data ? +data : |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3870 |
rbrace.test( data ) ? jQuery.parseJSON( data ) : |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3871 |
data; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3872 |
} catch( e ) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3873 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3874 |
// Make sure we set the data so it isn't changed later |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3875 |
jQuery.data( elem, key, data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3876 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3877 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3878 |
data = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3879 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3880 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3881 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3882 |
return data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3883 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3884 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3885 |
// checks a cache object for emptiness |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3886 |
function isEmptyDataObject( obj ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3887 |
var name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3888 |
for ( name in obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3889 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3890 |
// if the public data object is empty, the private is still empty |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3891 |
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3892 |
continue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3893 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3894 |
if ( name !== "toJSON" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3895 |
return false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3896 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3897 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3898 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3899 |
return true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3900 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3901 |
jQuery.extend({ |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3902 |
queue: function( elem, type, data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3903 |
var queue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3904 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3905 |
if ( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3906 |
type = ( type || "fx" ) + "queue"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3907 |
queue = jQuery._data( elem, type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3908 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3909 |
// Speed up dequeue by getting out quickly if this is just a lookup |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3910 |
if ( data ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3911 |
if ( !queue || jQuery.isArray(data) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3912 |
queue = jQuery._data( elem, type, jQuery.makeArray(data) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3913 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3914 |
queue.push( data ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3915 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3916 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3917 |
return queue || []; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3918 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3919 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3920 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3921 |
dequeue: function( elem, type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3922 |
type = type || "fx"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3923 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3924 |
var queue = jQuery.queue( elem, type ), |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3925 |
startLength = queue.length, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3926 |
fn = queue.shift(), |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3927 |
hooks = jQuery._queueHooks( elem, type ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3928 |
next = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3929 |
jQuery.dequeue( elem, type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3930 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3931 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3932 |
// If the fx queue is dequeued, always remove the progress sentinel |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3933 |
if ( fn === "inprogress" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3934 |
fn = queue.shift(); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3935 |
startLength--; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3936 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3937 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3938 |
if ( fn ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3939 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3940 |
// Add a progress sentinel to prevent the fx queue from being |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3941 |
// automatically dequeued |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3942 |
if ( type === "fx" ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3943 |
queue.unshift( "inprogress" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3944 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3945 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3946 |
// clear up the last queue stop function |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3947 |
delete hooks.stop; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3948 |
fn.call( elem, next, hooks ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3949 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3950 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3951 |
if ( !startLength && hooks ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3952 |
hooks.empty.fire(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3953 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3954 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3955 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3956 |
// not intended for public consumption - generates a queueHooks object, or returns the current one |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3957 |
_queueHooks: function( elem, type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3958 |
var key = type + "queueHooks"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3959 |
return jQuery._data( elem, key ) || jQuery._data( elem, key, { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3960 |
empty: jQuery.Callbacks("once memory").add(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3961 |
jQuery._removeData( elem, type + "queue" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3962 |
jQuery._removeData( elem, key ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3963 |
}) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3964 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3965 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3966 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3967 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3968 |
jQuery.fn.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3969 |
queue: function( type, data ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3970 |
var setter = 2; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3971 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3972 |
if ( typeof type !== "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3973 |
data = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3974 |
type = "fx"; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3975 |
setter--; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3976 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3977 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3978 |
if ( arguments.length < setter ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3979 |
return jQuery.queue( this[0], type ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3980 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3981 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3982 |
return data === undefined ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3983 |
this : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3984 |
this.each(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3985 |
var queue = jQuery.queue( this, type, data ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3986 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3987 |
// ensure a hooks for this queue |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3988 |
jQuery._queueHooks( this, type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3989 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3990 |
if ( type === "fx" && queue[0] !== "inprogress" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3991 |
jQuery.dequeue( this, type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3992 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
3993 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3994 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3995 |
dequeue: function( type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3996 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3997 |
jQuery.dequeue( this, type ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3998 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3999 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4000 |
// Based off of the plugin by Clint Helfers, with permission. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4001 |
// http://blindsignals.com/index.php/2009/07/jquery-delay/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4002 |
delay: function( time, type ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4003 |
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4004 |
type = type || "fx"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4005 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4006 |
return this.queue( type, function( next, hooks ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4007 |
var timeout = setTimeout( next, time ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4008 |
hooks.stop = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4009 |
clearTimeout( timeout ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4010 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4011 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4012 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4013 |
clearQueue: function( type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4014 |
return this.queue( type || "fx", [] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4015 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4016 |
// Get a promise resolved when queues of a certain type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4017 |
// are emptied (fx is the type by default) |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4018 |
promise: function( type, obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4019 |
var tmp, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4020 |
count = 1, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4021 |
defer = jQuery.Deferred(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4022 |
elements = this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4023 |
i = this.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4024 |
resolve = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4025 |
if ( !( --count ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4026 |
defer.resolveWith( elements, [ elements ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4027 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4028 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4029 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4030 |
if ( typeof type !== "string" ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4031 |
obj = type; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4032 |
type = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4033 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4034 |
type = type || "fx"; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4035 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4036 |
while( i-- ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4037 |
tmp = jQuery._data( elements[ i ], type + "queueHooks" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4038 |
if ( tmp && tmp.empty ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4039 |
count++; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4040 |
tmp.empty.add( resolve ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4041 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4042 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4043 |
resolve(); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4044 |
return defer.promise( obj ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4045 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4046 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4047 |
var nodeHook, boolHook, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4048 |
rclass = /[\t\r\n\f]/g, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4049 |
rreturn = /\r/g, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4050 |
rfocusable = /^(?:input|select|textarea|button|object)$/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4051 |
rclickable = /^(?:a|area)$/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4052 |
ruseDefault = /^(?:checked|selected)$/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4053 |
getSetAttribute = jQuery.support.getSetAttribute, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4054 |
getSetInput = jQuery.support.input; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4055 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4056 |
jQuery.fn.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4057 |
attr: function( name, value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4058 |
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4059 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4060 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4061 |
removeAttr: function( name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4062 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4063 |
jQuery.removeAttr( this, name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4064 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4065 |
}, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4066 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4067 |
prop: function( name, value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4068 |
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4069 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4070 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4071 |
removeProp: function( name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4072 |
name = jQuery.propFix[ name ] || name; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4073 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4074 |
// try/catch handles cases where IE balks (such as removing a property on window) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4075 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4076 |
this[ name ] = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4077 |
delete this[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4078 |
} catch( e ) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4079 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4080 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4081 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4082 |
addClass: function( value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4083 |
var classes, elem, cur, clazz, j, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4084 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4085 |
len = this.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4086 |
proceed = typeof value === "string" && value; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4087 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4088 |
if ( jQuery.isFunction( value ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4089 |
return this.each(function( j ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4090 |
jQuery( this ).addClass( value.call( this, j, this.className ) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4091 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4092 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4093 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4094 |
if ( proceed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4095 |
// The disjunction here is for better compressibility (see removeClass) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4096 |
classes = ( value || "" ).match( core_rnotwhite ) || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4097 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4098 |
for ( ; i < len; i++ ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4099 |
elem = this[ i ]; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4100 |
cur = elem.nodeType === 1 && ( elem.className ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4101 |
( " " + elem.className + " " ).replace( rclass, " " ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4102 |
" " |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4103 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4104 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4105 |
if ( cur ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4106 |
j = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4107 |
while ( (clazz = classes[j++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4108 |
if ( cur.indexOf( " " + clazz + " " ) < 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4109 |
cur += clazz + " "; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4110 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4111 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4112 |
elem.className = jQuery.trim( cur ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4113 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4114 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4115 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4116 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4117 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4118 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4119 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4120 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4121 |
removeClass: function( value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4122 |
var classes, elem, cur, clazz, j, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4123 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4124 |
len = this.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4125 |
proceed = arguments.length === 0 || typeof value === "string" && value; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4126 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4127 |
if ( jQuery.isFunction( value ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4128 |
return this.each(function( j ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4129 |
jQuery( this ).removeClass( value.call( this, j, this.className ) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4130 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4131 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4132 |
if ( proceed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4133 |
classes = ( value || "" ).match( core_rnotwhite ) || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4134 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4135 |
for ( ; i < len; i++ ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4136 |
elem = this[ i ]; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4137 |
// This expression is here for better compressibility (see addClass) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4138 |
cur = elem.nodeType === 1 && ( elem.className ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4139 |
( " " + elem.className + " " ).replace( rclass, " " ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4140 |
"" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4141 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4142 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4143 |
if ( cur ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4144 |
j = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4145 |
while ( (clazz = classes[j++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4146 |
// Remove *all* instances |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4147 |
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4148 |
cur = cur.replace( " " + clazz + " ", " " ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4149 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4150 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4151 |
elem.className = value ? jQuery.trim( cur ) : ""; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4152 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4153 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4154 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4155 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4156 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4157 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4158 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4159 |
toggleClass: function( value, stateVal ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4160 |
var type = typeof value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4161 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4162 |
if ( typeof stateVal === "boolean" && type === "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4163 |
return stateVal ? this.addClass( value ) : this.removeClass( value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4164 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4165 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4166 |
if ( jQuery.isFunction( value ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4167 |
return this.each(function( i ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4168 |
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4169 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4170 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4171 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4172 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4173 |
if ( type === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4174 |
// toggle individual class names |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4175 |
var className, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4176 |
i = 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4177 |
self = jQuery( this ), |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4178 |
classNames = value.match( core_rnotwhite ) || []; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4179 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4180 |
while ( (className = classNames[ i++ ]) ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4181 |
// check each className given, space separated list |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4182 |
if ( self.hasClass( className ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4183 |
self.removeClass( className ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4184 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4185 |
self.addClass( className ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4186 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4187 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4188 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4189 |
// Toggle whole class name |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4190 |
} else if ( type === core_strundefined || type === "boolean" ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4191 |
if ( this.className ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4192 |
// store className if set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4193 |
jQuery._data( this, "__className__", this.className ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4194 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4195 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4196 |
// If the element has a class name or if we're passed "false", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4197 |
// then remove the whole classname (if there was one, the above saved it). |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4198 |
// Otherwise bring back whatever was previously saved (if anything), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4199 |
// falling back to the empty string if nothing was stored. |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4200 |
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4201 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4202 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4203 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4204 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4205 |
hasClass: function( selector ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4206 |
var className = " " + selector + " ", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4207 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4208 |
l = this.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4209 |
for ( ; i < l; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4210 |
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4211 |
return true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4212 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4213 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4214 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4215 |
return false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4216 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4217 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4218 |
val: function( value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4219 |
var ret, hooks, isFunction, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4220 |
elem = this[0]; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4221 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4222 |
if ( !arguments.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4223 |
if ( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4224 |
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4225 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4226 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4227 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4228 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4229 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4230 |
ret = elem.value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4231 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4232 |
return typeof ret === "string" ? |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4233 |
// handle most common string cases |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4234 |
ret.replace(rreturn, "") : |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4235 |
// handle cases where value is null/undef or number |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4236 |
ret == null ? "" : ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4237 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4238 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4239 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4240 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4241 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4242 |
isFunction = jQuery.isFunction( value ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4243 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4244 |
return this.each(function( i ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4245 |
var val; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4246 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4247 |
if ( this.nodeType !== 1 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4248 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4249 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4250 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4251 |
if ( isFunction ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4252 |
val = value.call( this, i, jQuery( this ).val() ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4253 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4254 |
val = value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4255 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4256 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4257 |
// Treat null/undefined as ""; convert numbers to string |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4258 |
if ( val == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4259 |
val = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4260 |
} else if ( typeof val === "number" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4261 |
val += ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4262 |
} else if ( jQuery.isArray( val ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4263 |
val = jQuery.map(val, function ( value ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4264 |
return value == null ? "" : value + ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4265 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4266 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4267 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4268 |
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4269 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4270 |
// If set returns undefined, fall back to normal setting |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4271 |
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4272 |
this.value = val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4273 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4274 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4275 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4276 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4277 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4278 |
jQuery.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4279 |
valHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4280 |
option: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4281 |
get: function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4282 |
// Use proper attribute retrieval(#6932, #12072) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4283 |
var val = jQuery.find.attr( elem, "value" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4284 |
return val != null ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4285 |
val : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4286 |
elem.text; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4287 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4288 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4289 |
select: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4290 |
get: function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4291 |
var value, option, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4292 |
options = elem.options, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4293 |
index = elem.selectedIndex, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4294 |
one = elem.type === "select-one" || index < 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4295 |
values = one ? null : [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4296 |
max = one ? index + 1 : options.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4297 |
i = index < 0 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4298 |
max : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4299 |
one ? index : 0; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4300 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4301 |
// Loop through all the selected options |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4302 |
for ( ; i < max; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4303 |
option = options[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4304 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4305 |
// oldIE doesn't update selected after form reset (#2551) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4306 |
if ( ( option.selected || i === index ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4307 |
// Don't return options that are disabled or in a disabled optgroup |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4308 |
( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4309 |
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4310 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4311 |
// Get the specific value for the option |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4312 |
value = jQuery( option ).val(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4313 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4314 |
// We don't need an array for one selects |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4315 |
if ( one ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4316 |
return value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4317 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4318 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4319 |
// Multi-Selects return an array |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4320 |
values.push( value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4321 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4322 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4323 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4324 |
return values; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4325 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4326 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4327 |
set: function( elem, value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4328 |
var optionSet, option, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4329 |
options = elem.options, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4330 |
values = jQuery.makeArray( value ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4331 |
i = options.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4332 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4333 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4334 |
option = options[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4335 |
if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4336 |
optionSet = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4337 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4338 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4339 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4340 |
// force browsers to behave consistently when non-matching value is set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4341 |
if ( !optionSet ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4342 |
elem.selectedIndex = -1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4343 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4344 |
return values; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4345 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4346 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4347 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4348 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4349 |
attr: function( elem, name, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4350 |
var hooks, ret, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4351 |
nType = elem.nodeType; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4352 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4353 |
// don't get/set attributes on text, comment and attribute nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4354 |
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4355 |
return; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4356 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4357 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4358 |
// Fallback to prop when attributes are not supported |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4359 |
if ( typeof elem.getAttribute === core_strundefined ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4360 |
return jQuery.prop( elem, name, value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4361 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4362 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4363 |
// All attributes are lowercase |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4364 |
// Grab necessary hook if one is defined |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4365 |
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4366 |
name = name.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4367 |
hooks = jQuery.attrHooks[ name ] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4368 |
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4369 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4370 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4371 |
if ( value !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4372 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4373 |
if ( value === null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4374 |
jQuery.removeAttr( elem, name ); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4375 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4376 |
} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4377 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4378 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4379 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4380 |
elem.setAttribute( name, value + "" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4381 |
return value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4382 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4383 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4384 |
} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4385 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4386 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4387 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4388 |
ret = jQuery.find.attr( elem, name ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4389 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4390 |
// Non-existent attributes return null, we normalize to undefined |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4391 |
return ret == null ? |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4392 |
undefined : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4393 |
ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4394 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4395 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4396 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4397 |
removeAttr: function( elem, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4398 |
var name, propName, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4399 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4400 |
attrNames = value && value.match( core_rnotwhite ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4401 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4402 |
if ( attrNames && elem.nodeType === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4403 |
while ( (name = attrNames[i++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4404 |
propName = jQuery.propFix[ name ] || name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4405 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4406 |
// Boolean attributes get special treatment (#10870) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4407 |
if ( jQuery.expr.match.bool.test( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4408 |
// Set corresponding property to false |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4409 |
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4410 |
elem[ propName ] = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4411 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4412 |
// Also clear defaultChecked/defaultSelected (if appropriate) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4413 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4414 |
elem[ jQuery.camelCase( "default-" + name ) ] = |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4415 |
elem[ propName ] = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4416 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4417 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4418 |
// See #9699 for explanation of this approach (setting first, then removal) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4419 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4420 |
jQuery.attr( elem, name, "" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4421 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4422 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4423 |
elem.removeAttribute( getSetAttribute ? name : propName ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4424 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4425 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4426 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4427 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4428 |
attrHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4429 |
type: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4430 |
set: function( elem, value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4431 |
if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4432 |
// Setting the type on a radio button after the value resets the value in IE6-9 |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4433 |
// Reset value to default in case type is set after value during creation |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4434 |
var val = elem.value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4435 |
elem.setAttribute( "type", value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4436 |
if ( val ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4437 |
elem.value = val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4438 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4439 |
return value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4440 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4441 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4442 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4443 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4444 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4445 |
propFix: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4446 |
"for": "htmlFor", |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4447 |
"class": "className" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4448 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4449 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4450 |
prop: function( elem, name, value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4451 |
var ret, hooks, notxml, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4452 |
nType = elem.nodeType; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4453 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4454 |
// don't get/set properties on text, comment and attribute nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4455 |
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4456 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4457 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4458 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4459 |
notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4460 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4461 |
if ( notxml ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4462 |
// Fix name and attach hooks |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4463 |
name = jQuery.propFix[ name ] || name; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4464 |
hooks = jQuery.propHooks[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4465 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4466 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4467 |
if ( value !== undefined ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4468 |
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4469 |
ret : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4470 |
( elem[ name ] = value ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4471 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4472 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4473 |
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4474 |
ret : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4475 |
elem[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4476 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4477 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4478 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4479 |
propHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4480 |
tabIndex: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4481 |
get: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4482 |
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4483 |
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4484 |
// Use proper attribute retrieval(#12072) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4485 |
var tabindex = jQuery.find.attr( elem, "tabindex" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4486 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4487 |
return tabindex ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4488 |
parseInt( tabindex, 10 ) : |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4489 |
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4490 |
0 : |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4491 |
-1; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4492 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4493 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4494 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4495 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4496 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4497 |
// Hooks for boolean attributes |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4498 |
boolHook = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4499 |
set: function( elem, value, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4500 |
if ( value === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4501 |
// Remove boolean attributes when set to false |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4502 |
jQuery.removeAttr( elem, name ); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4503 |
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4504 |
// IE<8 needs the *property* name |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4505 |
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4506 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4507 |
// Use defaultChecked and defaultSelected for oldIE |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4508 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4509 |
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4510 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4511 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4512 |
return name; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4513 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4514 |
}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4515 |
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4516 |
var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4517 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4518 |
jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4519 |
function( elem, name, isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4520 |
var fn = jQuery.expr.attrHandle[ name ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4521 |
ret = isXML ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4522 |
undefined : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4523 |
/* jshint eqeqeq: false */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4524 |
(jQuery.expr.attrHandle[ name ] = undefined) != |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4525 |
getter( elem, name, isXML ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4526 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4527 |
name.toLowerCase() : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4528 |
null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4529 |
jQuery.expr.attrHandle[ name ] = fn; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4530 |
return ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4531 |
} : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4532 |
function( elem, name, isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4533 |
return isXML ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4534 |
undefined : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4535 |
elem[ jQuery.camelCase( "default-" + name ) ] ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4536 |
name.toLowerCase() : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4537 |
null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4538 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4539 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4540 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4541 |
// fix oldIE attroperties |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4542 |
if ( !getSetInput || !getSetAttribute ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4543 |
jQuery.attrHooks.value = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4544 |
set: function( elem, value, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4545 |
if ( jQuery.nodeName( elem, "input" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4546 |
// Does not return so that setAttribute is also used |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4547 |
elem.defaultValue = value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4548 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4549 |
// Use nodeHook if defined (#1954); otherwise setAttribute is fine |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4550 |
return nodeHook && nodeHook.set( elem, value, name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4551 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4552 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4553 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4554 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4555 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4556 |
// IE6/7 do not support getting/setting some attributes with get/setAttribute |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4557 |
if ( !getSetAttribute ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4558 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4559 |
// Use this for any attribute in IE6/7 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4560 |
// This fixes almost every IE6/7 issue |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4561 |
nodeHook = { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4562 |
set: function( elem, value, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4563 |
// Set the existing or create a new attribute node |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4564 |
var ret = elem.getAttributeNode( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4565 |
if ( !ret ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4566 |
elem.setAttributeNode( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4567 |
(ret = elem.ownerDocument.createAttribute( name )) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4568 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4569 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4570 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4571 |
ret.value = value += ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4572 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4573 |
// Break association with cloned elements by also using setAttribute (#9646) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4574 |
return name === "value" || value === elem.getAttribute( name ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4575 |
value : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4576 |
undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4577 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4578 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4579 |
jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4580 |
// Some attributes are constructed with empty-string values when not defined |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4581 |
function( elem, name, isXML ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4582 |
var ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4583 |
return isXML ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4584 |
undefined : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4585 |
(ret = elem.getAttributeNode( name )) && ret.value !== "" ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4586 |
ret.value : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4587 |
null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4588 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4589 |
jQuery.valHooks.button = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4590 |
get: function( elem, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4591 |
var ret = elem.getAttributeNode( name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4592 |
return ret && ret.specified ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4593 |
ret.value : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4594 |
undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4595 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4596 |
set: nodeHook.set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4597 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4598 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4599 |
// Set contenteditable to false on removals(#10429) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4600 |
// Setting to empty string throws an error as an invalid value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4601 |
jQuery.attrHooks.contenteditable = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4602 |
set: function( elem, value, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4603 |
nodeHook.set( elem, value === "" ? false : value, name ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4604 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4605 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4606 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4607 |
// Set width and height to auto instead of 0 on empty string( Bug #8150 ) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4608 |
// This is for removals |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4609 |
jQuery.each([ "width", "height" ], function( i, name ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4610 |
jQuery.attrHooks[ name ] = { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4611 |
set: function( elem, value ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4612 |
if ( value === "" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4613 |
elem.setAttribute( name, "auto" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4614 |
return value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4615 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4616 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4617 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4618 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4619 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4620 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4621 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4622 |
// Some attributes require a special call on IE |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4623 |
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4624 |
if ( !jQuery.support.hrefNormalized ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4625 |
// href/src property should get the full normalized URL (#10299/#12915) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4626 |
jQuery.each([ "href", "src" ], function( i, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4627 |
jQuery.propHooks[ name ] = { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4628 |
get: function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4629 |
return elem.getAttribute( name, 4 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4630 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4631 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4632 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4633 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4634 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4635 |
if ( !jQuery.support.style ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4636 |
jQuery.attrHooks.style = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4637 |
get: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4638 |
// Return undefined in the case of empty string |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4639 |
// Note: IE uppercases css property names, but if we were to .toLowerCase() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4640 |
// .cssText, that would destroy case senstitivity in URL's, like in "background" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4641 |
return elem.style.cssText || undefined; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4642 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4643 |
set: function( elem, value ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4644 |
return ( elem.style.cssText = value + "" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4645 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4646 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4647 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4648 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4649 |
// Safari mis-reports the default selected property of an option |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4650 |
// Accessing the parent's selectedIndex property fixes it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4651 |
if ( !jQuery.support.optSelected ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4652 |
jQuery.propHooks.selected = { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4653 |
get: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4654 |
var parent = elem.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4655 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4656 |
if ( parent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4657 |
parent.selectedIndex; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4658 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4659 |
// Make sure that it also works with optgroups, see #5701 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4660 |
if ( parent.parentNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4661 |
parent.parentNode.selectedIndex; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4662 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4663 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4664 |
return null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4665 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4666 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4667 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4668 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4669 |
jQuery.each([ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4670 |
"tabIndex", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4671 |
"readOnly", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4672 |
"maxLength", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4673 |
"cellSpacing", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4674 |
"cellPadding", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4675 |
"rowSpan", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4676 |
"colSpan", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4677 |
"useMap", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4678 |
"frameBorder", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4679 |
"contentEditable" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4680 |
], function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4681 |
jQuery.propFix[ this.toLowerCase() ] = this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4682 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4683 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4684 |
// IE6/7 call enctype encoding |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4685 |
if ( !jQuery.support.enctype ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4686 |
jQuery.propFix.enctype = "encoding"; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4687 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4688 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4689 |
// Radios and checkboxes getter/setter |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4690 |
jQuery.each([ "radio", "checkbox" ], function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4691 |
jQuery.valHooks[ this ] = { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4692 |
set: function( elem, value ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4693 |
if ( jQuery.isArray( value ) ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4694 |
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4695 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4696 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4697 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4698 |
if ( !jQuery.support.checkOn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4699 |
jQuery.valHooks[ this ].get = function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4700 |
// Support: Webkit |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4701 |
// "" is returned instead of "on" if a value isn't specified |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4702 |
return elem.getAttribute("value") === null ? "on" : elem.value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4703 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4704 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4705 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4706 |
var rformElems = /^(?:input|select|textarea)$/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4707 |
rkeyEvent = /^key/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4708 |
rmouseEvent = /^(?:mouse|contextmenu)|click/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4709 |
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4710 |
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4711 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4712 |
function returnTrue() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4713 |
return true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4714 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4715 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4716 |
function returnFalse() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4717 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4718 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4719 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4720 |
function safeActiveElement() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4721 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4722 |
return document.activeElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4723 |
} catch ( err ) { } |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4724 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4725 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4726 |
/* |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4727 |
* Helper functions for managing events -- not part of the public interface. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4728 |
* Props to Dean Edwards' addEvent library for many of the ideas. |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4729 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4730 |
jQuery.event = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4731 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4732 |
global: {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4733 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4734 |
add: function( elem, types, handler, data, selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4735 |
var tmp, events, t, handleObjIn, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4736 |
special, eventHandle, handleObj, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4737 |
handlers, type, namespaces, origType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4738 |
elemData = jQuery._data( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4739 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4740 |
// Don't attach events to noData or text/comment nodes (but allow plain objects) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4741 |
if ( !elemData ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4742 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4743 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4744 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4745 |
// Caller can pass in an object of custom data in lieu of the handler |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4746 |
if ( handler.handler ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4747 |
handleObjIn = handler; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4748 |
handler = handleObjIn.handler; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4749 |
selector = handleObjIn.selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4750 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4751 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4752 |
// Make sure that the handler has a unique ID, used to find/remove it later |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4753 |
if ( !handler.guid ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4754 |
handler.guid = jQuery.guid++; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4755 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4756 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4757 |
// Init the element's event structure and main handler, if this is the first |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4758 |
if ( !(events = elemData.events) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4759 |
events = elemData.events = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4760 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4761 |
if ( !(eventHandle = elemData.handle) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4762 |
eventHandle = elemData.handle = function( e ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4763 |
// Discard the second event of a jQuery.event.trigger() and |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4764 |
// when an event is called after a page has unloaded |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4765 |
return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4766 |
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4767 |
undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4768 |
}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4769 |
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4770 |
eventHandle.elem = elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4771 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4772 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4773 |
// Handle multiple events separated by a space |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4774 |
types = ( types || "" ).match( core_rnotwhite ) || [""]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4775 |
t = types.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4776 |
while ( t-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4777 |
tmp = rtypenamespace.exec( types[t] ) || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4778 |
type = origType = tmp[1]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4779 |
namespaces = ( tmp[2] || "" ).split( "." ).sort(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4780 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4781 |
// There *must* be a type, no attaching namespace-only handlers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4782 |
if ( !type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4783 |
continue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4784 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4785 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4786 |
// If event changes its type, use the special event handlers for the changed type |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4787 |
special = jQuery.event.special[ type ] || {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4788 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4789 |
// If selector defined, determine special event api type, otherwise given type |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4790 |
type = ( selector ? special.delegateType : special.bindType ) || type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4791 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4792 |
// Update special based on newly reset type |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4793 |
special = jQuery.event.special[ type ] || {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4794 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4795 |
// handleObj is passed to all event handlers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4796 |
handleObj = jQuery.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4797 |
type: type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4798 |
origType: origType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4799 |
data: data, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4800 |
handler: handler, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4801 |
guid: handler.guid, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4802 |
selector: selector, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4803 |
needsContext: selector && jQuery.expr.match.needsContext.test( selector ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4804 |
namespace: namespaces.join(".") |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4805 |
}, handleObjIn ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4806 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4807 |
// Init the event handler queue if we're the first |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4808 |
if ( !(handlers = events[ type ]) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4809 |
handlers = events[ type ] = []; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4810 |
handlers.delegateCount = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4811 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4812 |
// Only use addEventListener/attachEvent if the special events handler returns false |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4813 |
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4814 |
// Bind the global event handler to the element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4815 |
if ( elem.addEventListener ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4816 |
elem.addEventListener( type, eventHandle, false ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4817 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4818 |
} else if ( elem.attachEvent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4819 |
elem.attachEvent( "on" + type, eventHandle ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4820 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4821 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4822 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4823 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4824 |
if ( special.add ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4825 |
special.add.call( elem, handleObj ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4826 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4827 |
if ( !handleObj.handler.guid ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4828 |
handleObj.handler.guid = handler.guid; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4829 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4830 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4831 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4832 |
// Add to the element's handler list, delegates in front |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4833 |
if ( selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4834 |
handlers.splice( handlers.delegateCount++, 0, handleObj ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4835 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4836 |
handlers.push( handleObj ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4837 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4838 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4839 |
// Keep track of which events have ever been used, for event optimization |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4840 |
jQuery.event.global[ type ] = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4841 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4842 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4843 |
// Nullify elem to prevent memory leaks in IE |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4844 |
elem = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4845 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4846 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4847 |
// Detach an event or set of events from an element |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4848 |
remove: function( elem, types, handler, selector, mappedTypes ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4849 |
var j, handleObj, tmp, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4850 |
origCount, t, events, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4851 |
special, handlers, type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4852 |
namespaces, origType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4853 |
elemData = jQuery.hasData( elem ) && jQuery._data( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4854 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4855 |
if ( !elemData || !(events = elemData.events) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4856 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4857 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4858 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4859 |
// Once for each type.namespace in types; type may be omitted |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4860 |
types = ( types || "" ).match( core_rnotwhite ) || [""]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4861 |
t = types.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4862 |
while ( t-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4863 |
tmp = rtypenamespace.exec( types[t] ) || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4864 |
type = origType = tmp[1]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4865 |
namespaces = ( tmp[2] || "" ).split( "." ).sort(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4866 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4867 |
// Unbind all events (on this namespace, if provided) for the element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4868 |
if ( !type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4869 |
for ( type in events ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4870 |
jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4871 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4872 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4873 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4874 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4875 |
special = jQuery.event.special[ type ] || {}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4876 |
type = ( selector ? special.delegateType : special.bindType ) || type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4877 |
handlers = events[ type ] || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4878 |
tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4879 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4880 |
// Remove matching events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4881 |
origCount = j = handlers.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4882 |
while ( j-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4883 |
handleObj = handlers[ j ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4884 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4885 |
if ( ( mappedTypes || origType === handleObj.origType ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4886 |
( !handler || handler.guid === handleObj.guid ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4887 |
( !tmp || tmp.test( handleObj.namespace ) ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4888 |
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4889 |
handlers.splice( j, 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4890 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4891 |
if ( handleObj.selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4892 |
handlers.delegateCount--; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4893 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4894 |
if ( special.remove ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4895 |
special.remove.call( elem, handleObj ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4896 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4897 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4898 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4899 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4900 |
// Remove generic event handler if we removed something and no more handlers exist |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4901 |
// (avoids potential for endless recursion during removal of special event handlers) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4902 |
if ( origCount && !handlers.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4903 |
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4904 |
jQuery.removeEvent( elem, type, elemData.handle ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4905 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4906 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4907 |
delete events[ type ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4908 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4909 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4910 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4911 |
// Remove the expando if it's no longer used |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4912 |
if ( jQuery.isEmptyObject( events ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4913 |
delete elemData.handle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4914 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4915 |
// removeData also checks for emptiness and clears the expando if empty |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4916 |
// so use it instead of delete |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4917 |
jQuery._removeData( elem, "events" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4918 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4919 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4920 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4921 |
trigger: function( event, data, elem, onlyHandlers ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4922 |
var handle, ontype, cur, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4923 |
bubbleType, special, tmp, i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4924 |
eventPath = [ elem || document ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4925 |
type = core_hasOwn.call( event, "type" ) ? event.type : event, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4926 |
namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4927 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4928 |
cur = tmp = elem = elem || document; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4929 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4930 |
// Don't do events on text and comment nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4931 |
if ( elem.nodeType === 3 || elem.nodeType === 8 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4932 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4933 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4934 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4935 |
// focus/blur morphs to focusin/out; ensure we're not firing them right now |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4936 |
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4937 |
return; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4938 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4939 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4940 |
if ( type.indexOf(".") >= 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4941 |
// Namespaced trigger; create a regexp to match event type in handle() |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4942 |
namespaces = type.split("."); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4943 |
type = namespaces.shift(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4944 |
namespaces.sort(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4945 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4946 |
ontype = type.indexOf(":") < 0 && "on" + type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4947 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4948 |
// Caller can pass in a jQuery.Event object, Object, or just an event type string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4949 |
event = event[ jQuery.expando ] ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4950 |
event : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4951 |
new jQuery.Event( type, typeof event === "object" && event ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4952 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4953 |
// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4954 |
event.isTrigger = onlyHandlers ? 2 : 3; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4955 |
event.namespace = namespaces.join("."); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4956 |
event.namespace_re = event.namespace ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4957 |
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4958 |
null; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4959 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4960 |
// Clean up the event in case it is being reused |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4961 |
event.result = undefined; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4962 |
if ( !event.target ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4963 |
event.target = elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4964 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4965 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4966 |
// Clone any incoming data and prepend the event, creating the handler arg list |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4967 |
data = data == null ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4968 |
[ event ] : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4969 |
jQuery.makeArray( data, [ event ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4970 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4971 |
// Allow special events to draw outside the lines |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4972 |
special = jQuery.event.special[ type ] || {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4973 |
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4974 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4975 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4976 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4977 |
// Determine event propagation path in advance, per W3C events spec (#9951) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4978 |
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4979 |
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4980 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4981 |
bubbleType = special.delegateType || type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4982 |
if ( !rfocusMorph.test( bubbleType + type ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4983 |
cur = cur.parentNode; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4984 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4985 |
for ( ; cur; cur = cur.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4986 |
eventPath.push( cur ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4987 |
tmp = cur; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4988 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4989 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4990 |
// Only add window if we got to document (e.g., not plain obj or detached DOM) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4991 |
if ( tmp === (elem.ownerDocument || document) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4992 |
eventPath.push( tmp.defaultView || tmp.parentWindow || window ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4993 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4994 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4995 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4996 |
// Fire handlers on the event path |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4997 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4998 |
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
4999 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5000 |
event.type = i > 1 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5001 |
bubbleType : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5002 |
special.bindType || type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5003 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5004 |
// jQuery handler |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5005 |
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5006 |
if ( handle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5007 |
handle.apply( cur, data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5008 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5009 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5010 |
// Native handler |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5011 |
handle = ontype && cur[ ontype ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5012 |
if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5013 |
event.preventDefault(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5014 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5015 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5016 |
event.type = type; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5017 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5018 |
// If nobody prevented the default action, do it now |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5019 |
if ( !onlyHandlers && !event.isDefaultPrevented() ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5020 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5021 |
if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5022 |
jQuery.acceptData( elem ) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5023 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5024 |
// Call a native DOM method on the target with the same name name as the event. |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5025 |
// Can't use an .isFunction() check here because IE6/7 fails that test. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5026 |
// Don't do default actions on window, that's where global variables be (#6170) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5027 |
if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5028 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5029 |
// Don't re-trigger an onFOO event when we call its FOO() method |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5030 |
tmp = elem[ ontype ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5031 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5032 |
if ( tmp ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5033 |
elem[ ontype ] = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5034 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5035 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5036 |
// Prevent re-triggering of the same event, since we already bubbled it above |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5037 |
jQuery.event.triggered = type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5038 |
try { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5039 |
elem[ type ](); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5040 |
} catch ( e ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5041 |
// IE<9 dies on focus/blur to hidden element (#1486,#12518) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5042 |
// only reproducible on winXP IE8 native, not IE9 in IE8 mode |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5043 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5044 |
jQuery.event.triggered = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5045 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5046 |
if ( tmp ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5047 |
elem[ ontype ] = tmp; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5048 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5049 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5050 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5051 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5052 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5053 |
return event.result; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5054 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5055 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5056 |
dispatch: function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5057 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5058 |
// Make a writable jQuery.Event from the native event object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5059 |
event = jQuery.event.fix( event ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5060 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5061 |
var i, ret, handleObj, matched, j, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5062 |
handlerQueue = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5063 |
args = core_slice.call( arguments ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5064 |
handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5065 |
special = jQuery.event.special[ event.type ] || {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5066 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5067 |
// Use the fix-ed jQuery.Event rather than the (read-only) native event |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5068 |
args[0] = event; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5069 |
event.delegateTarget = this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5070 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5071 |
// Call the preDispatch hook for the mapped type, and let it bail if desired |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5072 |
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5073 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5074 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5075 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5076 |
// Determine handlers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5077 |
handlerQueue = jQuery.event.handlers.call( this, event, handlers ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5078 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5079 |
// Run delegates first; they may want to stop propagation beneath us |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5080 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5081 |
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5082 |
event.currentTarget = matched.elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5083 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5084 |
j = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5085 |
while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5086 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5087 |
// Triggered event must either 1) have no namespace, or |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5088 |
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5089 |
if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5090 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5091 |
event.handleObj = handleObj; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5092 |
event.data = handleObj.data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5093 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5094 |
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5095 |
.apply( matched.elem, args ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5096 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5097 |
if ( ret !== undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5098 |
if ( (event.result = ret) === false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5099 |
event.preventDefault(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5100 |
event.stopPropagation(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5101 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5102 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5103 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5104 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5105 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5106 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5107 |
// Call the postDispatch hook for the mapped type |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5108 |
if ( special.postDispatch ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5109 |
special.postDispatch.call( this, event ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5110 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5111 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5112 |
return event.result; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5113 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5114 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5115 |
handlers: function( event, handlers ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5116 |
var sel, handleObj, matches, i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5117 |
handlerQueue = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5118 |
delegateCount = handlers.delegateCount, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5119 |
cur = event.target; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5120 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5121 |
// Find delegate handlers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5122 |
// Black-hole SVG <use> instance trees (#13180) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5123 |
// Avoid non-left-click bubbling in Firefox (#3861) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5124 |
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5125 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5126 |
/* jshint eqeqeq: false */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5127 |
for ( ; cur != this; cur = cur.parentNode || this ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5128 |
/* jshint eqeqeq: true */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5129 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5130 |
// Don't check non-elements (#13208) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5131 |
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5132 |
if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5133 |
matches = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5134 |
for ( i = 0; i < delegateCount; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5135 |
handleObj = handlers[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5136 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5137 |
// Don't conflict with Object.prototype properties (#13203) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5138 |
sel = handleObj.selector + " "; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5139 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5140 |
if ( matches[ sel ] === undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5141 |
matches[ sel ] = handleObj.needsContext ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5142 |
jQuery( sel, this ).index( cur ) >= 0 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5143 |
jQuery.find( sel, this, null, [ cur ] ).length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5144 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5145 |
if ( matches[ sel ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5146 |
matches.push( handleObj ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5147 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5148 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5149 |
if ( matches.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5150 |
handlerQueue.push({ elem: cur, handlers: matches }); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5151 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5152 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5153 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5154 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5155 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5156 |
// Add the remaining (directly-bound) handlers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5157 |
if ( delegateCount < handlers.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5158 |
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5159 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5160 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5161 |
return handlerQueue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5162 |
}, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5163 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5164 |
fix: function( event ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5165 |
if ( event[ jQuery.expando ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5166 |
return event; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5167 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5168 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5169 |
// Create a writable copy of the event object and normalize some properties |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5170 |
var i, prop, copy, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5171 |
type = event.type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5172 |
originalEvent = event, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5173 |
fixHook = this.fixHooks[ type ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5174 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5175 |
if ( !fixHook ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5176 |
this.fixHooks[ type ] = fixHook = |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5177 |
rmouseEvent.test( type ) ? this.mouseHooks : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5178 |
rkeyEvent.test( type ) ? this.keyHooks : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5179 |
{}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5180 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5181 |
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5182 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5183 |
event = new jQuery.Event( originalEvent ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5184 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5185 |
i = copy.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5186 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5187 |
prop = copy[ i ]; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5188 |
event[ prop ] = originalEvent[ prop ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5189 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5190 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5191 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5192 |
// Fix target property (#1925) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5193 |
if ( !event.target ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5194 |
event.target = originalEvent.srcElement || document; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5195 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5196 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5197 |
// Support: Chrome 23+, Safari? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5198 |
// Target should not be a text node (#504, #13143) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5199 |
if ( event.target.nodeType === 3 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5200 |
event.target = event.target.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5201 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5202 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5203 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5204 |
// For mouse/key events, metaKey==false if it's undefined (#3368, #11328) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5205 |
event.metaKey = !!event.metaKey; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5206 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5207 |
return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5208 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5209 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5210 |
// Includes some event props shared by KeyEvent and MouseEvent |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5211 |
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5212 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5213 |
fixHooks: {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5214 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5215 |
keyHooks: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5216 |
props: "char charCode key keyCode".split(" "), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5217 |
filter: function( event, original ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5218 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5219 |
// Add which for key events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5220 |
if ( event.which == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5221 |
event.which = original.charCode != null ? original.charCode : original.keyCode; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5222 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5223 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5224 |
return event; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5225 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5226 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5227 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5228 |
mouseHooks: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5229 |
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5230 |
filter: function( event, original ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5231 |
var body, eventDoc, doc, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5232 |
button = original.button, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5233 |
fromElement = original.fromElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5234 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5235 |
// Calculate pageX/Y if missing and clientX/Y available |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5236 |
if ( event.pageX == null && original.clientX != null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5237 |
eventDoc = event.target.ownerDocument || document; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5238 |
doc = eventDoc.documentElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5239 |
body = eventDoc.body; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5240 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5241 |
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5242 |
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5243 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5244 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5245 |
// Add relatedTarget, if necessary |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5246 |
if ( !event.relatedTarget && fromElement ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5247 |
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5248 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5249 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5250 |
// Add which for click: 1 === left; 2 === middle; 3 === right |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5251 |
// Note: button is not normalized, so don't use it |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5252 |
if ( !event.which && button !== undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5253 |
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5254 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5255 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5256 |
return event; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5257 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5258 |
}, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5259 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5260 |
special: { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5261 |
load: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5262 |
// Prevent triggered image.load events from bubbling to window.load |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5263 |
noBubble: true |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5264 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5265 |
focus: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5266 |
// Fire native event if possible so blur/focus sequence is correct |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5267 |
trigger: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5268 |
if ( this !== safeActiveElement() && this.focus ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5269 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5270 |
this.focus(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5271 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5272 |
} catch ( e ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5273 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5274 |
// If we error on focus to hidden element (#1486, #12518), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5275 |
// let .trigger() run the handlers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5276 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5277 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5278 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5279 |
delegateType: "focusin" |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5280 |
}, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5281 |
blur: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5282 |
trigger: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5283 |
if ( this === safeActiveElement() && this.blur ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5284 |
this.blur(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5285 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5286 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5287 |
}, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5288 |
delegateType: "focusout" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5289 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5290 |
click: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5291 |
// For checkbox, fire native event so checked state will be right |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5292 |
trigger: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5293 |
if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5294 |
this.click(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5295 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5296 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5297 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5298 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5299 |
// For cross-browser consistency, don't fire native .click() on links |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5300 |
_default: function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5301 |
return jQuery.nodeName( event.target, "a" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5302 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5303 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5304 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5305 |
beforeunload: { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5306 |
postDispatch: function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5307 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5308 |
// Even when returnValue equals to undefined Firefox will still show alert |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5309 |
if ( event.result !== undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5310 |
event.originalEvent.returnValue = event.result; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5311 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5312 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5313 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5314 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5315 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5316 |
simulate: function( type, elem, event, bubble ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5317 |
// Piggyback on a donor event to simulate a different one. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5318 |
// Fake originalEvent to avoid donor's stopPropagation, but if the |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5319 |
// simulated event prevents default then we do the same on the donor. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5320 |
var e = jQuery.extend( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5321 |
new jQuery.Event(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5322 |
event, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5323 |
{ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5324 |
type: type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5325 |
isSimulated: true, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5326 |
originalEvent: {} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5327 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5328 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5329 |
if ( bubble ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5330 |
jQuery.event.trigger( e, null, elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5331 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5332 |
jQuery.event.dispatch.call( elem, e ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5333 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5334 |
if ( e.isDefaultPrevented() ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5335 |
event.preventDefault(); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5336 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5337 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5338 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5339 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5340 |
jQuery.removeEvent = document.removeEventListener ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5341 |
function( elem, type, handle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5342 |
if ( elem.removeEventListener ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5343 |
elem.removeEventListener( type, handle, false ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5344 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5345 |
} : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5346 |
function( elem, type, handle ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5347 |
var name = "on" + type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5348 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5349 |
if ( elem.detachEvent ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5350 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5351 |
// #8545, #7054, preventing memory leaks for custom events in IE6-8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5352 |
// detachEvent needed property on element, by name of that event, to properly expose it to GC |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5353 |
if ( typeof elem[ name ] === core_strundefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5354 |
elem[ name ] = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5355 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5356 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5357 |
elem.detachEvent( name, handle ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5358 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5359 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5360 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5361 |
jQuery.Event = function( src, props ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5362 |
// Allow instantiation without the 'new' keyword |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5363 |
if ( !(this instanceof jQuery.Event) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5364 |
return new jQuery.Event( src, props ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5365 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5366 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5367 |
// Event object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5368 |
if ( src && src.type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5369 |
this.originalEvent = src; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5370 |
this.type = src.type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5371 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5372 |
// Events bubbling up the document may have been marked as prevented |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5373 |
// by a handler lower down the tree; reflect the correct value. |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5374 |
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5375 |
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5376 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5377 |
// Event type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5378 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5379 |
this.type = src; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5380 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5381 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5382 |
// Put explicitly provided properties onto the event object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5383 |
if ( props ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5384 |
jQuery.extend( this, props ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5385 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5386 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5387 |
// Create a timestamp if incoming event doesn't have one |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5388 |
this.timeStamp = src && src.timeStamp || jQuery.now(); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5389 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5390 |
// Mark it as fixed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5391 |
this[ jQuery.expando ] = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5392 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5393 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5394 |
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5395 |
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5396 |
jQuery.Event.prototype = { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5397 |
isDefaultPrevented: returnFalse, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5398 |
isPropagationStopped: returnFalse, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5399 |
isImmediatePropagationStopped: returnFalse, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5400 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5401 |
preventDefault: function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5402 |
var e = this.originalEvent; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5403 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5404 |
this.isDefaultPrevented = returnTrue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5405 |
if ( !e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5406 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5407 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5408 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5409 |
// If preventDefault exists, run it on the original event |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5410 |
if ( e.preventDefault ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5411 |
e.preventDefault(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5412 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5413 |
// Support: IE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5414 |
// Otherwise set the returnValue property of the original event to false |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5415 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5416 |
e.returnValue = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5417 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5418 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5419 |
stopPropagation: function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5420 |
var e = this.originalEvent; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5421 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5422 |
this.isPropagationStopped = returnTrue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5423 |
if ( !e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5424 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5425 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5426 |
// If stopPropagation exists, run it on the original event |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5427 |
if ( e.stopPropagation ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5428 |
e.stopPropagation(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5429 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5430 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5431 |
// Support: IE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5432 |
// Set the cancelBubble property of the original event to true |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5433 |
e.cancelBubble = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5434 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5435 |
stopImmediatePropagation: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5436 |
this.isImmediatePropagationStopped = returnTrue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5437 |
this.stopPropagation(); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5438 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5439 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5440 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5441 |
// Create mouseenter/leave events using mouseover/out and event-time checks |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5442 |
jQuery.each({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5443 |
mouseenter: "mouseover", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5444 |
mouseleave: "mouseout" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5445 |
}, function( orig, fix ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5446 |
jQuery.event.special[ orig ] = { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5447 |
delegateType: fix, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5448 |
bindType: fix, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5449 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5450 |
handle: function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5451 |
var ret, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5452 |
target = this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5453 |
related = event.relatedTarget, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5454 |
handleObj = event.handleObj; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5455 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5456 |
// For mousenter/leave call the handler if related is outside the target. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5457 |
// NB: No relatedTarget if the mouse left/entered the browser window |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5458 |
if ( !related || (related !== target && !jQuery.contains( target, related )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5459 |
event.type = handleObj.origType; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5460 |
ret = handleObj.handler.apply( this, arguments ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5461 |
event.type = fix; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5462 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5463 |
return ret; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5464 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5465 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5466 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5467 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5468 |
// IE submit delegation |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5469 |
if ( !jQuery.support.submitBubbles ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5470 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5471 |
jQuery.event.special.submit = { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5472 |
setup: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5473 |
// Only need this for delegated form submit events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5474 |
if ( jQuery.nodeName( this, "form" ) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5475 |
return false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5476 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5477 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5478 |
// Lazy-add a submit handler when a descendant form may potentially be submitted |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5479 |
jQuery.event.add( this, "click._submit keypress._submit", function( e ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5480 |
// Node name check avoids a VML-related crash in IE (#9807) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5481 |
var elem = e.target, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5482 |
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5483 |
if ( form && !jQuery._data( form, "submitBubbles" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5484 |
jQuery.event.add( form, "submit._submit", function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5485 |
event._submit_bubble = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5486 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5487 |
jQuery._data( form, "submitBubbles", true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5488 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5489 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5490 |
// return undefined since we don't need an event listener |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5491 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5492 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5493 |
postDispatch: function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5494 |
// If form was submitted by the user, bubble the event up the tree |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5495 |
if ( event._submit_bubble ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5496 |
delete event._submit_bubble; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5497 |
if ( this.parentNode && !event.isTrigger ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5498 |
jQuery.event.simulate( "submit", this.parentNode, event, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5499 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5500 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5501 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5502 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5503 |
teardown: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5504 |
// Only need this for delegated form submit events |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5505 |
if ( jQuery.nodeName( this, "form" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5506 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5507 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5508 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5509 |
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5510 |
jQuery.event.remove( this, "._submit" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5511 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5512 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5513 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5514 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5515 |
// IE change delegation and checkbox/radio fix |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5516 |
if ( !jQuery.support.changeBubbles ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5517 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5518 |
jQuery.event.special.change = { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5519 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5520 |
setup: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5521 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5522 |
if ( rformElems.test( this.nodeName ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5523 |
// IE doesn't fire change on a check/radio until blur; trigger it on click |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5524 |
// after a propertychange. Eat the blur-change in special.change.handle. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5525 |
// This still fires onchange a second time for check/radio after blur. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5526 |
if ( this.type === "checkbox" || this.type === "radio" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5527 |
jQuery.event.add( this, "propertychange._change", function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5528 |
if ( event.originalEvent.propertyName === "checked" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5529 |
this._just_changed = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5530 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5531 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5532 |
jQuery.event.add( this, "click._change", function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5533 |
if ( this._just_changed && !event.isTrigger ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5534 |
this._just_changed = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5535 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5536 |
// Allow triggered, simulated change events (#11500) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5537 |
jQuery.event.simulate( "change", this, event, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5538 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5539 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5540 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5541 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5542 |
// Delegated event; lazy-add a change handler on descendant inputs |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5543 |
jQuery.event.add( this, "beforeactivate._change", function( e ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5544 |
var elem = e.target; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5545 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5546 |
if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5547 |
jQuery.event.add( elem, "change._change", function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5548 |
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5549 |
jQuery.event.simulate( "change", this.parentNode, event, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5550 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5551 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5552 |
jQuery._data( elem, "changeBubbles", true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5553 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5554 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5555 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5556 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5557 |
handle: function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5558 |
var elem = event.target; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5559 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5560 |
// Swallow native change events from checkbox/radio, we already triggered them above |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5561 |
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5562 |
return event.handleObj.handler.apply( this, arguments ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5563 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5564 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5565 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5566 |
teardown: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5567 |
jQuery.event.remove( this, "._change" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5568 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5569 |
return !rformElems.test( this.nodeName ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5570 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5571 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5572 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5573 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5574 |
// Create "bubbling" focus and blur events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5575 |
if ( !jQuery.support.focusinBubbles ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5576 |
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5577 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5578 |
// Attach a single capturing handler while someone wants focusin/focusout |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5579 |
var attaches = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5580 |
handler = function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5581 |
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5582 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5583 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5584 |
jQuery.event.special[ fix ] = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5585 |
setup: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5586 |
if ( attaches++ === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5587 |
document.addEventListener( orig, handler, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5588 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5589 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5590 |
teardown: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5591 |
if ( --attaches === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5592 |
document.removeEventListener( orig, handler, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5593 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5594 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5595 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5596 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5597 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5598 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5599 |
jQuery.fn.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5600 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5601 |
on: function( types, selector, data, fn, /*INTERNAL*/ one ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5602 |
var type, origFn; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5603 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5604 |
// Types can be a map of types/handlers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5605 |
if ( typeof types === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5606 |
// ( types-Object, selector, data ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5607 |
if ( typeof selector !== "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5608 |
// ( types-Object, data ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5609 |
data = data || selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5610 |
selector = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5611 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5612 |
for ( type in types ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5613 |
this.on( type, selector, data, types[ type ], one ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5614 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5615 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5616 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5617 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5618 |
if ( data == null && fn == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5619 |
// ( types, fn ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5620 |
fn = selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5621 |
data = selector = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5622 |
} else if ( fn == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5623 |
if ( typeof selector === "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5624 |
// ( types, selector, fn ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5625 |
fn = data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5626 |
data = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5627 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5628 |
// ( types, data, fn ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5629 |
fn = data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5630 |
data = selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5631 |
selector = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5632 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5633 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5634 |
if ( fn === false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5635 |
fn = returnFalse; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5636 |
} else if ( !fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5637 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5638 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5639 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5640 |
if ( one === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5641 |
origFn = fn; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5642 |
fn = function( event ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5643 |
// Can use an empty set, since event contains the info |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5644 |
jQuery().off( event ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5645 |
return origFn.apply( this, arguments ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5646 |
}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5647 |
// Use same guid so caller can remove using origFn |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5648 |
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5649 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5650 |
return this.each( function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5651 |
jQuery.event.add( this, types, fn, data, selector ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5652 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5653 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5654 |
one: function( types, selector, data, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5655 |
return this.on( types, selector, data, fn, 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5656 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5657 |
off: function( types, selector, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5658 |
var handleObj, type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5659 |
if ( types && types.preventDefault && types.handleObj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5660 |
// ( event ) dispatched jQuery.Event |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5661 |
handleObj = types.handleObj; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5662 |
jQuery( types.delegateTarget ).off( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5663 |
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5664 |
handleObj.selector, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5665 |
handleObj.handler |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5666 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5667 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5668 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5669 |
if ( typeof types === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5670 |
// ( types-object [, selector] ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5671 |
for ( type in types ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5672 |
this.off( type, selector, types[ type ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5673 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5674 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5675 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5676 |
if ( selector === false || typeof selector === "function" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5677 |
// ( types [, fn] ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5678 |
fn = selector; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5679 |
selector = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5680 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5681 |
if ( fn === false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5682 |
fn = returnFalse; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5683 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5684 |
return this.each(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5685 |
jQuery.event.remove( this, types, fn, selector ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5686 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5687 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5688 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5689 |
trigger: function( type, data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5690 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5691 |
jQuery.event.trigger( type, data, this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5692 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5693 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5694 |
triggerHandler: function( type, data ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5695 |
var elem = this[0]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5696 |
if ( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5697 |
return jQuery.event.trigger( type, data, elem, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5698 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5699 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5700 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5701 |
var isSimple = /^.[^:#\[\.,]*$/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5702 |
rparentsprev = /^(?:parents|prev(?:Until|All))/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5703 |
rneedsContext = jQuery.expr.match.needsContext, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5704 |
// methods guaranteed to produce a unique set when starting from a unique set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5705 |
guaranteedUnique = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5706 |
children: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5707 |
contents: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5708 |
next: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5709 |
prev: true |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5710 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5711 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5712 |
jQuery.fn.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5713 |
find: function( selector ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5714 |
var i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5715 |
ret = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5716 |
self = this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5717 |
len = self.length; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5718 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5719 |
if ( typeof selector !== "string" ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5720 |
return this.pushStack( jQuery( selector ).filter(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5721 |
for ( i = 0; i < len; i++ ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5722 |
if ( jQuery.contains( self[ i ], this ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5723 |
return true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5724 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5725 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5726 |
}) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5727 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5728 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5729 |
for ( i = 0; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5730 |
jQuery.find( selector, self[ i ], ret ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5731 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5732 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5733 |
// Needed because $( selector, context ) becomes $( context ).find( selector ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5734 |
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5735 |
ret.selector = this.selector ? this.selector + " " + selector : selector; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5736 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5737 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5738 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5739 |
has: function( target ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5740 |
var i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5741 |
targets = jQuery( target, this ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5742 |
len = targets.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5743 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5744 |
return this.filter(function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5745 |
for ( i = 0; i < len; i++ ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5746 |
if ( jQuery.contains( this, targets[i] ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5747 |
return true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5748 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5749 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5750 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5751 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5752 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5753 |
not: function( selector ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5754 |
return this.pushStack( winnow(this, selector || [], true) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5755 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5756 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5757 |
filter: function( selector ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5758 |
return this.pushStack( winnow(this, selector || [], false) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5759 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5760 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5761 |
is: function( selector ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5762 |
return !!winnow( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5763 |
this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5764 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5765 |
// If this is a positional/relative selector, check membership in the returned set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5766 |
// so $("p:first").is("p:last") won't return true for a doc with two "p". |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5767 |
typeof selector === "string" && rneedsContext.test( selector ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5768 |
jQuery( selector ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5769 |
selector || [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5770 |
false |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5771 |
).length; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5772 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5773 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5774 |
closest: function( selectors, context ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5775 |
var cur, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5776 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5777 |
l = this.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5778 |
ret = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5779 |
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5780 |
jQuery( selectors, context || this.context ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5781 |
0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5782 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5783 |
for ( ; i < l; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5784 |
for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5785 |
// Always skip document fragments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5786 |
if ( cur.nodeType < 11 && (pos ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5787 |
pos.index(cur) > -1 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5788 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5789 |
// Don't pass non-elements to Sizzle |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5790 |
cur.nodeType === 1 && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5791 |
jQuery.find.matchesSelector(cur, selectors)) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5792 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5793 |
cur = ret.push( cur ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5794 |
break; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5795 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5796 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5797 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5798 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5799 |
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5800 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5801 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5802 |
// Determine the position of an element within |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5803 |
// the matched set of elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5804 |
index: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5805 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5806 |
// No argument, return index in parent |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5807 |
if ( !elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5808 |
return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5809 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5810 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5811 |
// index in selector |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5812 |
if ( typeof elem === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5813 |
return jQuery.inArray( this[0], jQuery( elem ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5814 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5815 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5816 |
// Locate the position of the desired element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5817 |
return jQuery.inArray( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5818 |
// If it receives a jQuery object, the first element is used |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5819 |
elem.jquery ? elem[0] : elem, this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5820 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5821 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5822 |
add: function( selector, context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5823 |
var set = typeof selector === "string" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5824 |
jQuery( selector, context ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5825 |
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5826 |
all = jQuery.merge( this.get(), set ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5827 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5828 |
return this.pushStack( jQuery.unique(all) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5829 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5830 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5831 |
addBack: function( selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5832 |
return this.add( selector == null ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5833 |
this.prevObject : this.prevObject.filter(selector) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5834 |
); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5835 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5836 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5837 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5838 |
function sibling( cur, dir ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5839 |
do { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5840 |
cur = cur[ dir ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5841 |
} while ( cur && cur.nodeType !== 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5842 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5843 |
return cur; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5844 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5845 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5846 |
jQuery.each({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5847 |
parent: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5848 |
var parent = elem.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5849 |
return parent && parent.nodeType !== 11 ? parent : null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5850 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5851 |
parents: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5852 |
return jQuery.dir( elem, "parentNode" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5853 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5854 |
parentsUntil: function( elem, i, until ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5855 |
return jQuery.dir( elem, "parentNode", until ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5856 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5857 |
next: function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5858 |
return sibling( elem, "nextSibling" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5859 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5860 |
prev: function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5861 |
return sibling( elem, "previousSibling" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5862 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5863 |
nextAll: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5864 |
return jQuery.dir( elem, "nextSibling" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5865 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5866 |
prevAll: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5867 |
return jQuery.dir( elem, "previousSibling" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5868 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5869 |
nextUntil: function( elem, i, until ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5870 |
return jQuery.dir( elem, "nextSibling", until ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5871 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5872 |
prevUntil: function( elem, i, until ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5873 |
return jQuery.dir( elem, "previousSibling", until ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5874 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5875 |
siblings: function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5876 |
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5877 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5878 |
children: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5879 |
return jQuery.sibling( elem.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5880 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5881 |
contents: function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5882 |
return jQuery.nodeName( elem, "iframe" ) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5883 |
elem.contentDocument || elem.contentWindow.document : |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5884 |
jQuery.merge( [], elem.childNodes ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5885 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5886 |
}, function( name, fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5887 |
jQuery.fn[ name ] = function( until, selector ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5888 |
var ret = jQuery.map( this, fn, until ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5889 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5890 |
if ( name.slice( -5 ) !== "Until" ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5891 |
selector = until; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5892 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5893 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5894 |
if ( selector && typeof selector === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5895 |
ret = jQuery.filter( selector, ret ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5896 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5897 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5898 |
if ( this.length > 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5899 |
// Remove duplicates |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5900 |
if ( !guaranteedUnique[ name ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5901 |
ret = jQuery.unique( ret ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5902 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5903 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5904 |
// Reverse order for parents* and prev-derivatives |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5905 |
if ( rparentsprev.test( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5906 |
ret = ret.reverse(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5907 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5908 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5909 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5910 |
return this.pushStack( ret ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5911 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5912 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5913 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5914 |
jQuery.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5915 |
filter: function( expr, elems, not ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5916 |
var elem = elems[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5917 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5918 |
if ( not ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5919 |
expr = ":not(" + expr + ")"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5920 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5921 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5922 |
return elems.length === 1 && elem.nodeType === 1 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5923 |
jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5924 |
jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5925 |
return elem.nodeType === 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5926 |
})); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5927 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5928 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5929 |
dir: function( elem, dir, until ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5930 |
var matched = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5931 |
cur = elem[ dir ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5932 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5933 |
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5934 |
if ( cur.nodeType === 1 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5935 |
matched.push( cur ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5936 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5937 |
cur = cur[dir]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5938 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5939 |
return matched; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5940 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5941 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5942 |
sibling: function( n, elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5943 |
var r = []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5944 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5945 |
for ( ; n; n = n.nextSibling ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5946 |
if ( n.nodeType === 1 && n !== elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5947 |
r.push( n ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5948 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5949 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5950 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5951 |
return r; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5952 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5953 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5954 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5955 |
// Implement the identical functionality for filter and not |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5956 |
function winnow( elements, qualifier, not ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5957 |
if ( jQuery.isFunction( qualifier ) ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5958 |
return jQuery.grep( elements, function( elem, i ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5959 |
/* jshint -W018 */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5960 |
return !!qualifier.call( elem, i, elem ) !== not; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5961 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5962 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5963 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5964 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5965 |
if ( qualifier.nodeType ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5966 |
return jQuery.grep( elements, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5967 |
return ( elem === qualifier ) !== not; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5968 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5969 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5970 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5971 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5972 |
if ( typeof qualifier === "string" ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5973 |
if ( isSimple.test( qualifier ) ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5974 |
return jQuery.filter( qualifier, elements, not ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5975 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5976 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5977 |
qualifier = jQuery.filter( qualifier, elements ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5978 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5979 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5980 |
return jQuery.grep( elements, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5981 |
return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5982 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5983 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5984 |
function createSafeFragment( document ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5985 |
var list = nodeNames.split( "|" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5986 |
safeFrag = document.createDocumentFragment(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5987 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5988 |
if ( safeFrag.createElement ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5989 |
while ( list.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5990 |
safeFrag.createElement( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5991 |
list.pop() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5992 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5993 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5994 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5995 |
return safeFrag; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5996 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5997 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5998 |
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
5999 |
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6000 |
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6001 |
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6002 |
rleadingWhitespace = /^\s+/, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6003 |
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6004 |
rtagName = /<([\w:]+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6005 |
rtbody = /<tbody/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6006 |
rhtml = /<|&#?\w+;/, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6007 |
rnoInnerhtml = /<(?:script|style|link)/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6008 |
manipulation_rcheckableType = /^(?:checkbox|radio)$/i, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6009 |
// checked="checked" or checked |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6010 |
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6011 |
rscriptType = /^$|\/(?:java|ecma)script/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6012 |
rscriptTypeMasked = /^true\/(.*)/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6013 |
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6014 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6015 |
// We have to close these tags to support XHTML (#13200) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6016 |
wrapMap = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6017 |
option: [ 1, "<select multiple='multiple'>", "</select>" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6018 |
legend: [ 1, "<fieldset>", "</fieldset>" ], |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6019 |
area: [ 1, "<map>", "</map>" ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6020 |
param: [ 1, "<object>", "</object>" ], |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6021 |
thead: [ 1, "<table>", "</table>" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6022 |
tr: [ 2, "<table><tbody>", "</tbody></table>" ], |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6023 |
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6024 |
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6025 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6026 |
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6027 |
// unless wrapped in a div with non-breaking characters in front of it. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6028 |
_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6029 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6030 |
safeFragment = createSafeFragment( document ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6031 |
fragmentDiv = safeFragment.appendChild( document.createElement("div") ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6032 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6033 |
wrapMap.optgroup = wrapMap.option; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6034 |
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6035 |
wrapMap.th = wrapMap.td; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6036 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6037 |
jQuery.fn.extend({ |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6038 |
text: function( value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6039 |
return jQuery.access( this, function( value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6040 |
return value === undefined ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6041 |
jQuery.text( this ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6042 |
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6043 |
}, null, value, arguments.length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6044 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6045 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6046 |
append: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6047 |
return this.domManip( arguments, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6048 |
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6049 |
var target = manipulationTarget( this, elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6050 |
target.appendChild( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6051 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6052 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6053 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6054 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6055 |
prepend: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6056 |
return this.domManip( arguments, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6057 |
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6058 |
var target = manipulationTarget( this, elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6059 |
target.insertBefore( elem, target.firstChild ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6060 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6061 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6062 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6063 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6064 |
before: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6065 |
return this.domManip( arguments, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6066 |
if ( this.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6067 |
this.parentNode.insertBefore( elem, this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6068 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6069 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6070 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6071 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6072 |
after: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6073 |
return this.domManip( arguments, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6074 |
if ( this.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6075 |
this.parentNode.insertBefore( elem, this.nextSibling ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6076 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6077 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6078 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6079 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6080 |
// keepData is for internal use only--do not document |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6081 |
remove: function( selector, keepData ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6082 |
var elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6083 |
elems = selector ? jQuery.filter( selector, this ) : this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6084 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6085 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6086 |
for ( ; (elem = elems[i]) != null; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6087 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6088 |
if ( !keepData && elem.nodeType === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6089 |
jQuery.cleanData( getAll( elem ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6090 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6091 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6092 |
if ( elem.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6093 |
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6094 |
setGlobalEval( getAll( elem, "script" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6095 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6096 |
elem.parentNode.removeChild( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6097 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6098 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6099 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6100 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6101 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6102 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6103 |
empty: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6104 |
var elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6105 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6106 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6107 |
for ( ; (elem = this[i]) != null; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6108 |
// Remove element nodes and prevent memory leaks |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6109 |
if ( elem.nodeType === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6110 |
jQuery.cleanData( getAll( elem, false ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6111 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6112 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6113 |
// Remove any remaining nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6114 |
while ( elem.firstChild ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6115 |
elem.removeChild( elem.firstChild ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6116 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6117 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6118 |
// If this is a select, ensure that it displays empty (#12336) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6119 |
// Support: IE<9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6120 |
if ( elem.options && jQuery.nodeName( elem, "select" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6121 |
elem.options.length = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6122 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6123 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6124 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6125 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6126 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6127 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6128 |
clone: function( dataAndEvents, deepDataAndEvents ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6129 |
dataAndEvents = dataAndEvents == null ? false : dataAndEvents; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6130 |
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6131 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6132 |
return this.map( function () { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6133 |
return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6134 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6135 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6136 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6137 |
html: function( value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6138 |
return jQuery.access( this, function( value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6139 |
var elem = this[0] || {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6140 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6141 |
l = this.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6142 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6143 |
if ( value === undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6144 |
return elem.nodeType === 1 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6145 |
elem.innerHTML.replace( rinlinejQuery, "" ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6146 |
undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6147 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6148 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6149 |
// See if we can take a shortcut and just use innerHTML |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6150 |
if ( typeof value === "string" && !rnoInnerhtml.test( value ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6151 |
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6152 |
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6153 |
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6154 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6155 |
value = value.replace( rxhtmlTag, "<$1></$2>" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6156 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6157 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6158 |
for (; i < l; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6159 |
// Remove element nodes and prevent memory leaks |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6160 |
elem = this[i] || {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6161 |
if ( elem.nodeType === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6162 |
jQuery.cleanData( getAll( elem, false ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6163 |
elem.innerHTML = value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6164 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6165 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6166 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6167 |
elem = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6168 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6169 |
// If using innerHTML throws an exception, use the fallback method |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6170 |
} catch(e) {} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6171 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6172 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6173 |
if ( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6174 |
this.empty().append( value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6175 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6176 |
}, null, value, arguments.length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6177 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6178 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6179 |
replaceWith: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6180 |
var |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6181 |
// Snapshot the DOM in case .domManip sweeps something relevant into its fragment |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6182 |
args = jQuery.map( this, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6183 |
return [ elem.nextSibling, elem.parentNode ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6184 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6185 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6186 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6187 |
// Make the changes, replacing each context element with the new content |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6188 |
this.domManip( arguments, function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6189 |
var next = args[ i++ ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6190 |
parent = args[ i++ ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6191 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6192 |
if ( parent ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6193 |
// Don't use the snapshot next if it has moved (#13810) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6194 |
if ( next && next.parentNode !== parent ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6195 |
next = this.nextSibling; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6196 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6197 |
jQuery( this ).remove(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6198 |
parent.insertBefore( elem, next ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6199 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6200 |
// Allow new content to include elements from the context set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6201 |
}, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6202 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6203 |
// Force removal if there was no new content (e.g., from empty arguments) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6204 |
return i ? this : this.remove(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6205 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6206 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6207 |
detach: function( selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6208 |
return this.remove( selector, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6209 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6210 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6211 |
domManip: function( args, callback, allowIntersection ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6212 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6213 |
// Flatten any nested arrays |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6214 |
args = core_concat.apply( [], args ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6215 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6216 |
var first, node, hasScripts, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6217 |
scripts, doc, fragment, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6218 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6219 |
l = this.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6220 |
set = this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6221 |
iNoClone = l - 1, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6222 |
value = args[0], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6223 |
isFunction = jQuery.isFunction( value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6224 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6225 |
// We can't cloneNode fragments that contain checked, in WebKit |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6226 |
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6227 |
return this.each(function( index ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6228 |
var self = set.eq( index ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6229 |
if ( isFunction ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6230 |
args[0] = value.call( this, index, self.html() ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6231 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6232 |
self.domManip( args, callback, allowIntersection ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6233 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6234 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6235 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6236 |
if ( l ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6237 |
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6238 |
first = fragment.firstChild; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6239 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6240 |
if ( fragment.childNodes.length === 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6241 |
fragment = first; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6242 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6243 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6244 |
if ( first ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6245 |
scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6246 |
hasScripts = scripts.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6247 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6248 |
// Use the original fragment for the last item instead of the first because it can end up |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6249 |
// being emptied incorrectly in certain situations (#8070). |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6250 |
for ( ; i < l; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6251 |
node = fragment; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6252 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6253 |
if ( i !== iNoClone ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6254 |
node = jQuery.clone( node, true, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6255 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6256 |
// Keep references to cloned scripts for later restoration |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6257 |
if ( hasScripts ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6258 |
jQuery.merge( scripts, getAll( node, "script" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6259 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6260 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6261 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6262 |
callback.call( this[i], node, i ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6263 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6264 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6265 |
if ( hasScripts ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6266 |
doc = scripts[ scripts.length - 1 ].ownerDocument; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6267 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6268 |
// Reenable scripts |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6269 |
jQuery.map( scripts, restoreScript ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6270 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6271 |
// Evaluate executable scripts on first document insertion |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6272 |
for ( i = 0; i < hasScripts; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6273 |
node = scripts[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6274 |
if ( rscriptType.test( node.type || "" ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6275 |
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6276 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6277 |
if ( node.src ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6278 |
// Hope ajax is available... |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6279 |
jQuery._evalUrl( node.src ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6280 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6281 |
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6282 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6283 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6284 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6285 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6286 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6287 |
// Fix #11809: Avoid leaking memory |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6288 |
fragment = first = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6289 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6290 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6291 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6292 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6293 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6294 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6295 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6296 |
// Support: IE<8 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6297 |
// Manipulating tables requires a tbody |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6298 |
function manipulationTarget( elem, content ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6299 |
return jQuery.nodeName( elem, "table" ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6300 |
jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6301 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6302 |
elem.getElementsByTagName("tbody")[0] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6303 |
elem.appendChild( elem.ownerDocument.createElement("tbody") ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6304 |
elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6305 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6306 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6307 |
// Replace/restore the type attribute of script elements for safe DOM manipulation |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6308 |
function disableScript( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6309 |
elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6310 |
return elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6311 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6312 |
function restoreScript( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6313 |
var match = rscriptTypeMasked.exec( elem.type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6314 |
if ( match ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6315 |
elem.type = match[1]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6316 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6317 |
elem.removeAttribute("type"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6318 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6319 |
return elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6320 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6321 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6322 |
// Mark scripts as having already been evaluated |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6323 |
function setGlobalEval( elems, refElements ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6324 |
var elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6325 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6326 |
for ( ; (elem = elems[i]) != null; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6327 |
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6328 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6329 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6330 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6331 |
function cloneCopyEvent( src, dest ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6332 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6333 |
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6334 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6335 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6336 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6337 |
var type, i, l, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6338 |
oldData = jQuery._data( src ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6339 |
curData = jQuery._data( dest, oldData ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6340 |
events = oldData.events; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6341 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6342 |
if ( events ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6343 |
delete curData.handle; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6344 |
curData.events = {}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6345 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6346 |
for ( type in events ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6347 |
for ( i = 0, l = events[ type ].length; i < l; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6348 |
jQuery.event.add( dest, type, events[ type ][ i ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6349 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6350 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6351 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6352 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6353 |
// make the cloned public data object a copy from the original |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6354 |
if ( curData.data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6355 |
curData.data = jQuery.extend( {}, curData.data ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6356 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6357 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6358 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6359 |
function fixCloneNodeIssues( src, dest ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6360 |
var nodeName, e, data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6361 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6362 |
// We do not need to do anything for non-Elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6363 |
if ( dest.nodeType !== 1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6364 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6365 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6366 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6367 |
nodeName = dest.nodeName.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6368 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6369 |
// IE6-8 copies events bound via attachEvent when using cloneNode. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6370 |
if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6371 |
data = jQuery._data( dest ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6372 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6373 |
for ( e in data.events ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6374 |
jQuery.removeEvent( dest, e, data.handle ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6375 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6376 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6377 |
// Event data gets referenced instead of copied if the expando gets copied too |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6378 |
dest.removeAttribute( jQuery.expando ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6379 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6380 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6381 |
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6382 |
if ( nodeName === "script" && dest.text !== src.text ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6383 |
disableScript( dest ).text = src.text; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6384 |
restoreScript( dest ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6385 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6386 |
// IE6-10 improperly clones children of object elements using classid. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6387 |
// IE10 throws NoModificationAllowedError if parent is null, #12132. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6388 |
} else if ( nodeName === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6389 |
if ( dest.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6390 |
dest.outerHTML = src.outerHTML; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6391 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6392 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6393 |
// This path appears unavoidable for IE9. When cloning an object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6394 |
// element in IE9, the outerHTML strategy above is not sufficient. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6395 |
// If the src has innerHTML and the destination does not, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6396 |
// copy the src.innerHTML into the dest.innerHTML. #10324 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6397 |
if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6398 |
dest.innerHTML = src.innerHTML; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6399 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6400 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6401 |
} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6402 |
// IE6-8 fails to persist the checked state of a cloned checkbox |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6403 |
// or radio button. Worse, IE6-7 fail to give the cloned element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6404 |
// a checked appearance if the defaultChecked value isn't also set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6405 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6406 |
dest.defaultChecked = dest.checked = src.checked; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6407 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6408 |
// IE6-7 get confused and end up setting the value of a cloned |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6409 |
// checkbox/radio button to an empty string instead of "on" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6410 |
if ( dest.value !== src.value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6411 |
dest.value = src.value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6412 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6413 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6414 |
// IE6-8 fails to return the selected option to the default selected |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6415 |
// state when cloning options |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6416 |
} else if ( nodeName === "option" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6417 |
dest.defaultSelected = dest.selected = src.defaultSelected; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6418 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6419 |
// IE6-8 fails to set the defaultValue to the correct value when |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6420 |
// cloning other types of input fields |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6421 |
} else if ( nodeName === "input" || nodeName === "textarea" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6422 |
dest.defaultValue = src.defaultValue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6423 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6424 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6425 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6426 |
jQuery.each({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6427 |
appendTo: "append", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6428 |
prependTo: "prepend", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6429 |
insertBefore: "before", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6430 |
insertAfter: "after", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6431 |
replaceAll: "replaceWith" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6432 |
}, function( name, original ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6433 |
jQuery.fn[ name ] = function( selector ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6434 |
var elems, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6435 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6436 |
ret = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6437 |
insert = jQuery( selector ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6438 |
last = insert.length - 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6439 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6440 |
for ( ; i <= last; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6441 |
elems = i === last ? this : this.clone(true); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6442 |
jQuery( insert[i] )[ original ]( elems ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6443 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6444 |
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6445 |
core_push.apply( ret, elems.get() ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6446 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6447 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6448 |
return this.pushStack( ret ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6449 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6450 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6451 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6452 |
function getAll( context, tag ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6453 |
var elems, elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6454 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6455 |
found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6456 |
typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6457 |
undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6458 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6459 |
if ( !found ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6460 |
for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6461 |
if ( !tag || jQuery.nodeName( elem, tag ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6462 |
found.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6463 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6464 |
jQuery.merge( found, getAll( elem, tag ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6465 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6466 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6467 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6468 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6469 |
return tag === undefined || tag && jQuery.nodeName( context, tag ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6470 |
jQuery.merge( [ context ], found ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6471 |
found; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6472 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6473 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6474 |
// Used in buildFragment, fixes the defaultChecked property |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6475 |
function fixDefaultChecked( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6476 |
if ( manipulation_rcheckableType.test( elem.type ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6477 |
elem.defaultChecked = elem.checked; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6478 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6479 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6480 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6481 |
jQuery.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6482 |
clone: function( elem, dataAndEvents, deepDataAndEvents ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6483 |
var destElements, node, clone, i, srcElements, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6484 |
inPage = jQuery.contains( elem.ownerDocument, elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6485 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6486 |
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6487 |
clone = elem.cloneNode( true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6488 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6489 |
// IE<=8 does not properly clone detached, unknown element nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6490 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6491 |
fragmentDiv.innerHTML = elem.outerHTML; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6492 |
fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6493 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6494 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6495 |
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6496 |
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6497 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6498 |
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6499 |
destElements = getAll( clone ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6500 |
srcElements = getAll( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6501 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6502 |
// Fix all IE cloning issues |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6503 |
for ( i = 0; (node = srcElements[i]) != null; ++i ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6504 |
// Ensure that the destination node is not null; Fixes #9587 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6505 |
if ( destElements[i] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6506 |
fixCloneNodeIssues( node, destElements[i] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6507 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6508 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6509 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6510 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6511 |
// Copy the events from the original to the clone |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6512 |
if ( dataAndEvents ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6513 |
if ( deepDataAndEvents ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6514 |
srcElements = srcElements || getAll( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6515 |
destElements = destElements || getAll( clone ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6516 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6517 |
for ( i = 0; (node = srcElements[i]) != null; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6518 |
cloneCopyEvent( node, destElements[i] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6519 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6520 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6521 |
cloneCopyEvent( elem, clone ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6522 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6523 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6524 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6525 |
// Preserve script evaluation history |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6526 |
destElements = getAll( clone, "script" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6527 |
if ( destElements.length > 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6528 |
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6529 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6530 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6531 |
destElements = srcElements = node = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6532 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6533 |
// Return the cloned set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6534 |
return clone; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6535 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6536 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6537 |
buildFragment: function( elems, context, scripts, selection ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6538 |
var j, elem, contains, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6539 |
tmp, tag, tbody, wrap, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6540 |
l = elems.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6541 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6542 |
// Ensure a safe fragment |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6543 |
safe = createSafeFragment( context ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6544 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6545 |
nodes = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6546 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6547 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6548 |
for ( ; i < l; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6549 |
elem = elems[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6550 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6551 |
if ( elem || elem === 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6552 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6553 |
// Add nodes directly |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6554 |
if ( jQuery.type( elem ) === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6555 |
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6556 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6557 |
// Convert non-html into a text node |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6558 |
} else if ( !rhtml.test( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6559 |
nodes.push( context.createTextNode( elem ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6560 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6561 |
// Convert html into DOM nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6562 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6563 |
tmp = tmp || safe.appendChild( context.createElement("div") ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6564 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6565 |
// Deserialize a standard representation |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6566 |
tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6567 |
wrap = wrapMap[ tag ] || wrapMap._default; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6568 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6569 |
tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6570 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6571 |
// Descend through wrappers to the right content |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6572 |
j = wrap[0]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6573 |
while ( j-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6574 |
tmp = tmp.lastChild; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6575 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6576 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6577 |
// Manually add leading whitespace removed by IE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6578 |
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6579 |
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6580 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6581 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6582 |
// Remove IE's autoinserted <tbody> from table fragments |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6583 |
if ( !jQuery.support.tbody ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6584 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6585 |
// String was a <table>, *may* have spurious <tbody> |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6586 |
elem = tag === "table" && !rtbody.test( elem ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6587 |
tmp.firstChild : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6588 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6589 |
// String was a bare <thead> or <tfoot> |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6590 |
wrap[1] === "<table>" && !rtbody.test( elem ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6591 |
tmp : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6592 |
0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6593 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6594 |
j = elem && elem.childNodes.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6595 |
while ( j-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6596 |
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6597 |
elem.removeChild( tbody ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6598 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6599 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6600 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6601 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6602 |
jQuery.merge( nodes, tmp.childNodes ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6603 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6604 |
// Fix #12392 for WebKit and IE > 9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6605 |
tmp.textContent = ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6606 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6607 |
// Fix #12392 for oldIE |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6608 |
while ( tmp.firstChild ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6609 |
tmp.removeChild( tmp.firstChild ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6610 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6611 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6612 |
// Remember the top-level container for proper cleanup |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6613 |
tmp = safe.lastChild; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6614 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6615 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6616 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6617 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6618 |
// Fix #11356: Clear elements from fragment |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6619 |
if ( tmp ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6620 |
safe.removeChild( tmp ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6621 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6622 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6623 |
// Reset defaultChecked for any radios and checkboxes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6624 |
// about to be appended to the DOM in IE 6/7 (#8060) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6625 |
if ( !jQuery.support.appendChecked ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6626 |
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6627 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6628 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6629 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6630 |
while ( (elem = nodes[ i++ ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6631 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6632 |
// #4087 - If origin and destination elements are the same, and this is |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6633 |
// that element, do not do anything |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6634 |
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6635 |
continue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6636 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6637 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6638 |
contains = jQuery.contains( elem.ownerDocument, elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6639 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6640 |
// Append to fragment |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6641 |
tmp = getAll( safe.appendChild( elem ), "script" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6642 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6643 |
// Preserve script evaluation history |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6644 |
if ( contains ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6645 |
setGlobalEval( tmp ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6646 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6647 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6648 |
// Capture executables |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6649 |
if ( scripts ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6650 |
j = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6651 |
while ( (elem = tmp[ j++ ]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6652 |
if ( rscriptType.test( elem.type || "" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6653 |
scripts.push( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6654 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6655 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6656 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6657 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6658 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6659 |
tmp = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6660 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6661 |
return safe; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6662 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6663 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6664 |
cleanData: function( elems, /* internal */ acceptData ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6665 |
var elem, type, id, data, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6666 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6667 |
internalKey = jQuery.expando, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6668 |
cache = jQuery.cache, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6669 |
deleteExpando = jQuery.support.deleteExpando, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6670 |
special = jQuery.event.special; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6671 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6672 |
for ( ; (elem = elems[i]) != null; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6673 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6674 |
if ( acceptData || jQuery.acceptData( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6675 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6676 |
id = elem[ internalKey ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6677 |
data = id && cache[ id ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6678 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6679 |
if ( data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6680 |
if ( data.events ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6681 |
for ( type in data.events ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6682 |
if ( special[ type ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6683 |
jQuery.event.remove( elem, type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6684 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6685 |
// This is a shortcut to avoid jQuery.event.remove's overhead |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6686 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6687 |
jQuery.removeEvent( elem, type, data.handle ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6688 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6689 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6690 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6691 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6692 |
// Remove cache only if it was not already removed by jQuery.event.remove |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6693 |
if ( cache[ id ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6694 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6695 |
delete cache[ id ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6696 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6697 |
// IE does not allow us to delete expando properties from nodes, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6698 |
// nor does it have a removeAttribute function on Document nodes; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6699 |
// we must handle all of these cases |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6700 |
if ( deleteExpando ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6701 |
delete elem[ internalKey ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6702 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6703 |
} else if ( typeof elem.removeAttribute !== core_strundefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6704 |
elem.removeAttribute( internalKey ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6705 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6706 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6707 |
elem[ internalKey ] = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6708 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6709 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6710 |
core_deletedIds.push( id ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6711 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6712 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6713 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6714 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6715 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6716 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6717 |
_evalUrl: function( url ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6718 |
return jQuery.ajax({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6719 |
url: url, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6720 |
type: "GET", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6721 |
dataType: "script", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6722 |
async: false, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6723 |
global: false, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6724 |
"throws": true |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6725 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6726 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6727 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6728 |
jQuery.fn.extend({ |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6729 |
wrapAll: function( html ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6730 |
if ( jQuery.isFunction( html ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6731 |
return this.each(function(i) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6732 |
jQuery(this).wrapAll( html.call(this, i) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6733 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6734 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6735 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6736 |
if ( this[0] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6737 |
// The elements to wrap the target around |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6738 |
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6739 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6740 |
if ( this[0].parentNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6741 |
wrap.insertBefore( this[0] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6742 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6743 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6744 |
wrap.map(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6745 |
var elem = this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6746 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6747 |
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6748 |
elem = elem.firstChild; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6749 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6750 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6751 |
return elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6752 |
}).append( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6753 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6754 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6755 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6756 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6757 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6758 |
wrapInner: function( html ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6759 |
if ( jQuery.isFunction( html ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6760 |
return this.each(function(i) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6761 |
jQuery(this).wrapInner( html.call(this, i) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6762 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6763 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6764 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6765 |
return this.each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6766 |
var self = jQuery( this ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6767 |
contents = self.contents(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6768 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6769 |
if ( contents.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6770 |
contents.wrapAll( html ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6771 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6772 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6773 |
self.append( html ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6774 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6775 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6776 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6777 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6778 |
wrap: function( html ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6779 |
var isFunction = jQuery.isFunction( html ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6780 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6781 |
return this.each(function(i) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6782 |
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6783 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6784 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6785 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6786 |
unwrap: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6787 |
return this.parent().each(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6788 |
if ( !jQuery.nodeName( this, "body" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6789 |
jQuery( this ).replaceWith( this.childNodes ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6790 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6791 |
}).end(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6792 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6793 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6794 |
var iframe, getStyles, curCSS, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6795 |
ralpha = /alpha\([^)]*\)/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6796 |
ropacity = /opacity\s*=\s*([^)]*)/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6797 |
rposition = /^(top|right|bottom|left)$/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6798 |
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6799 |
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6800 |
rdisplayswap = /^(none|table(?!-c[ea]).+)/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6801 |
rmargin = /^margin/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6802 |
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6803 |
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6804 |
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6805 |
elemdisplay = { BODY: "block" }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6806 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6807 |
cssShow = { position: "absolute", visibility: "hidden", display: "block" }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6808 |
cssNormalTransform = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6809 |
letterSpacing: 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6810 |
fontWeight: 400 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6811 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6812 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6813 |
cssExpand = [ "Top", "Right", "Bottom", "Left" ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6814 |
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6815 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6816 |
// return a css property mapped to a potentially vendor prefixed property |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6817 |
function vendorPropName( style, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6818 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6819 |
// shortcut for names that are not vendor prefixed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6820 |
if ( name in style ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6821 |
return name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6822 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6823 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6824 |
// check for vendor prefixed names |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6825 |
var capName = name.charAt(0).toUpperCase() + name.slice(1), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6826 |
origName = name, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6827 |
i = cssPrefixes.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6828 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6829 |
while ( i-- ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6830 |
name = cssPrefixes[ i ] + capName; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6831 |
if ( name in style ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6832 |
return name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6833 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6834 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6835 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6836 |
return origName; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6837 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6838 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6839 |
function isHidden( elem, el ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6840 |
// isHidden might be called from jQuery#filter function; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6841 |
// in that case, element will be second argument |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6842 |
elem = el || elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6843 |
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6844 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6845 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6846 |
function showHide( elements, show ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6847 |
var display, elem, hidden, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6848 |
values = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6849 |
index = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6850 |
length = elements.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6851 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6852 |
for ( ; index < length; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6853 |
elem = elements[ index ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6854 |
if ( !elem.style ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6855 |
continue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6856 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6857 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6858 |
values[ index ] = jQuery._data( elem, "olddisplay" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6859 |
display = elem.style.display; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6860 |
if ( show ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6861 |
// Reset the inline display of this element to learn if it is |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6862 |
// being hidden by cascaded rules or not |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6863 |
if ( !values[ index ] && display === "none" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6864 |
elem.style.display = ""; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6865 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6866 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6867 |
// Set elements which have been overridden with display: none |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6868 |
// in a stylesheet to whatever the default browser style is |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6869 |
// for such an element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6870 |
if ( elem.style.display === "" && isHidden( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6871 |
values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6872 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6873 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6874 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6875 |
if ( !values[ index ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6876 |
hidden = isHidden( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6877 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6878 |
if ( display && display !== "none" || !hidden ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6879 |
jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6880 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6881 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6882 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6883 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6884 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6885 |
// Set the display of most of the elements in a second loop |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6886 |
// to avoid the constant reflow |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6887 |
for ( index = 0; index < length; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6888 |
elem = elements[ index ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6889 |
if ( !elem.style ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6890 |
continue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6891 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6892 |
if ( !show || elem.style.display === "none" || elem.style.display === "" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6893 |
elem.style.display = show ? values[ index ] || "" : "none"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6894 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6895 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6896 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6897 |
return elements; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6898 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6899 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6900 |
jQuery.fn.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6901 |
css: function( name, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6902 |
return jQuery.access( this, function( elem, name, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6903 |
var len, styles, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6904 |
map = {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6905 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6906 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6907 |
if ( jQuery.isArray( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6908 |
styles = getStyles( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6909 |
len = name.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6910 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6911 |
for ( ; i < len; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6912 |
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6913 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6914 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6915 |
return map; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6916 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6917 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6918 |
return value !== undefined ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6919 |
jQuery.style( elem, name, value ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6920 |
jQuery.css( elem, name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6921 |
}, name, value, arguments.length > 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6922 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6923 |
show: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6924 |
return showHide( this, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6925 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6926 |
hide: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6927 |
return showHide( this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6928 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6929 |
toggle: function( state ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6930 |
if ( typeof state === "boolean" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6931 |
return state ? this.show() : this.hide(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6932 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6933 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6934 |
return this.each(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6935 |
if ( isHidden( this ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6936 |
jQuery( this ).show(); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6937 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6938 |
jQuery( this ).hide(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6939 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6940 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6941 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6942 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6943 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6944 |
jQuery.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6945 |
// Add in style property hooks for overriding the default |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6946 |
// behavior of getting and setting a style property |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6947 |
cssHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6948 |
opacity: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6949 |
get: function( elem, computed ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6950 |
if ( computed ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6951 |
// We should always get a number back from opacity |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6952 |
var ret = curCSS( elem, "opacity" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6953 |
return ret === "" ? "1" : ret; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6954 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6955 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6956 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6957 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6958 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6959 |
// Don't automatically add "px" to these possibly-unitless properties |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6960 |
cssNumber: { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6961 |
"columnCount": true, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6962 |
"fillOpacity": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6963 |
"fontWeight": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6964 |
"lineHeight": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6965 |
"opacity": true, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6966 |
"order": true, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6967 |
"orphans": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6968 |
"widows": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6969 |
"zIndex": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6970 |
"zoom": true |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6971 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6972 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6973 |
// Add in properties whose names you wish to fix before |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6974 |
// setting or getting the value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6975 |
cssProps: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6976 |
// normalize float css property |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6977 |
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6978 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6979 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6980 |
// Get and set the style property on a DOM Node |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6981 |
style: function( elem, name, value, extra ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6982 |
// Don't set styles on text and comment nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6983 |
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6984 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6985 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6986 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6987 |
// Make sure that we're working with the right name |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6988 |
var ret, type, hooks, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6989 |
origName = jQuery.camelCase( name ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6990 |
style = elem.style; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6991 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6992 |
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6993 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6994 |
// gets hook for the prefixed version |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6995 |
// followed by the unprefixed version |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
6996 |
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6997 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6998 |
// Check if we're setting a value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6999 |
if ( value !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7000 |
type = typeof value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7001 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7002 |
// convert relative number strings (+= or -=) to relative numbers. #7345 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7003 |
if ( type === "string" && (ret = rrelNum.exec( value )) ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7004 |
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7005 |
// Fixes bug #9237 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7006 |
type = "number"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7007 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7008 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7009 |
// Make sure that NaN and null values aren't set. See: #7116 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7010 |
if ( value == null || type === "number" && isNaN( value ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7011 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7012 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7013 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7014 |
// If a number was passed in, add 'px' to the (except for certain CSS properties) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7015 |
if ( type === "number" && !jQuery.cssNumber[ origName ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7016 |
value += "px"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7017 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7018 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7019 |
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7020 |
// but it would mean to define eight (for every problematic property) identical functions |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7021 |
if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7022 |
style[ name ] = "inherit"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7023 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7024 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7025 |
// If a hook was provided, use that value, otherwise just set the specified value |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7026 |
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7027 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7028 |
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7029 |
// Fixes bug #5509 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7030 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7031 |
style[ name ] = value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7032 |
} catch(e) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7033 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7034 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7035 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7036 |
// If a hook was provided get the non-computed value from there |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7037 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7038 |
return ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7039 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7040 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7041 |
// Otherwise just get the value from the style object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7042 |
return style[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7043 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7044 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7045 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7046 |
css: function( elem, name, extra, styles ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7047 |
var num, val, hooks, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7048 |
origName = jQuery.camelCase( name ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7049 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7050 |
// Make sure that we're working with the right name |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7051 |
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7052 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7053 |
// gets hook for the prefixed version |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7054 |
// followed by the unprefixed version |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7055 |
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7056 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7057 |
// If a hook was provided get the computed value from there |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7058 |
if ( hooks && "get" in hooks ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7059 |
val = hooks.get( elem, true, extra ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7060 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7061 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7062 |
// Otherwise, if a way to get the computed value exists, use that |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7063 |
if ( val === undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7064 |
val = curCSS( elem, name, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7065 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7066 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7067 |
//convert "normal" to computed value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7068 |
if ( val === "normal" && name in cssNormalTransform ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7069 |
val = cssNormalTransform[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7070 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7071 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7072 |
// Return, converting to number if forced or a qualifier was provided and val looks numeric |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7073 |
if ( extra === "" || extra ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7074 |
num = parseFloat( val ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7075 |
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7076 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7077 |
return val; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7078 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7079 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7080 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7081 |
// NOTE: we've included the "window" in window.getComputedStyle |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7082 |
// because jsdom on node.js will break without it. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7083 |
if ( window.getComputedStyle ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7084 |
getStyles = function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7085 |
return window.getComputedStyle( elem, null ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7086 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7087 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7088 |
curCSS = function( elem, name, _computed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7089 |
var width, minWidth, maxWidth, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7090 |
computed = _computed || getStyles( elem ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7091 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7092 |
// getPropertyValue is only needed for .css('filter') in IE9, see #12537 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7093 |
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7094 |
style = elem.style; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7095 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7096 |
if ( computed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7097 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7098 |
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7099 |
ret = jQuery.style( elem, name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7100 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7101 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7102 |
// A tribute to the "awesome hack by Dean Edwards" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7103 |
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7104 |
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7105 |
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7106 |
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7107 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7108 |
// Remember the original values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7109 |
width = style.width; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7110 |
minWidth = style.minWidth; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7111 |
maxWidth = style.maxWidth; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7112 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7113 |
// Put in the new values to get a computed value out |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7114 |
style.minWidth = style.maxWidth = style.width = ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7115 |
ret = computed.width; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7116 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7117 |
// Revert the changed values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7118 |
style.width = width; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7119 |
style.minWidth = minWidth; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7120 |
style.maxWidth = maxWidth; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7121 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7122 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7123 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7124 |
return ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7125 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7126 |
} else if ( document.documentElement.currentStyle ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7127 |
getStyles = function( elem ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7128 |
return elem.currentStyle; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7129 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7130 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7131 |
curCSS = function( elem, name, _computed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7132 |
var left, rs, rsLeft, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7133 |
computed = _computed || getStyles( elem ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7134 |
ret = computed ? computed[ name ] : undefined, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7135 |
style = elem.style; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7136 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7137 |
// Avoid setting ret to empty string here |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7138 |
// so we don't default to auto |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7139 |
if ( ret == null && style && style[ name ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7140 |
ret = style[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7141 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7142 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7143 |
// From the awesome hack by Dean Edwards |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7144 |
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7145 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7146 |
// If we're not dealing with a regular pixel number |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7147 |
// but a number that has a weird ending, we need to convert it to pixels |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7148 |
// but not position css attributes, as those are proportional to the parent element instead |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7149 |
// and we can't measure the parent instead because it might trigger a "stacking dolls" problem |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7150 |
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7151 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7152 |
// Remember the original values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7153 |
left = style.left; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7154 |
rs = elem.runtimeStyle; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7155 |
rsLeft = rs && rs.left; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7156 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7157 |
// Put in the new values to get a computed value out |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7158 |
if ( rsLeft ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7159 |
rs.left = elem.currentStyle.left; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7160 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7161 |
style.left = name === "fontSize" ? "1em" : ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7162 |
ret = style.pixelLeft + "px"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7163 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7164 |
// Revert the changed values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7165 |
style.left = left; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7166 |
if ( rsLeft ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7167 |
rs.left = rsLeft; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7168 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7169 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7170 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7171 |
return ret === "" ? "auto" : ret; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7172 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7173 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7174 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7175 |
function setPositiveNumber( elem, value, subtract ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7176 |
var matches = rnumsplit.exec( value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7177 |
return matches ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7178 |
// Guard against undefined "subtract", e.g., when used as in cssHooks |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7179 |
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7180 |
value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7181 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7182 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7183 |
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7184 |
var i = extra === ( isBorderBox ? "border" : "content" ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7185 |
// If we already have the right measurement, avoid augmentation |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7186 |
4 : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7187 |
// Otherwise initialize for horizontal or vertical properties |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7188 |
name === "width" ? 1 : 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7189 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7190 |
val = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7191 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7192 |
for ( ; i < 4; i += 2 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7193 |
// both box models exclude margin, so add it if we want it |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7194 |
if ( extra === "margin" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7195 |
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7196 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7197 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7198 |
if ( isBorderBox ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7199 |
// border-box includes padding, so remove it if we want content |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7200 |
if ( extra === "content" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7201 |
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7202 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7203 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7204 |
// at this point, extra isn't border nor margin, so remove border |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7205 |
if ( extra !== "margin" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7206 |
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7207 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7208 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7209 |
// at this point, extra isn't content, so add padding |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7210 |
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7211 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7212 |
// at this point, extra isn't content nor padding, so add border |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7213 |
if ( extra !== "padding" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7214 |
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7215 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7216 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7217 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7218 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7219 |
return val; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7220 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7221 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7222 |
function getWidthOrHeight( elem, name, extra ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7223 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7224 |
// Start with offset property, which is equivalent to the border-box value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7225 |
var valueIsBorderBox = true, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7226 |
val = name === "width" ? elem.offsetWidth : elem.offsetHeight, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7227 |
styles = getStyles( elem ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7228 |
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7229 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7230 |
// some non-html elements return undefined for offsetWidth, so check for null/undefined |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7231 |
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7232 |
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7233 |
if ( val <= 0 || val == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7234 |
// Fall back to computed then uncomputed css if necessary |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7235 |
val = curCSS( elem, name, styles ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7236 |
if ( val < 0 || val == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7237 |
val = elem.style[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7238 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7239 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7240 |
// Computed unit is not pixels. Stop here and return. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7241 |
if ( rnumnonpx.test(val) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7242 |
return val; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7243 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7244 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7245 |
// we need the check for style in case a browser which returns unreliable values |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7246 |
// for getComputedStyle silently falls back to the reliable elem.style |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7247 |
valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7248 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7249 |
// Normalize "", auto, and prepare for extra |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7250 |
val = parseFloat( val ) || 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7251 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7252 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7253 |
// use the active box-sizing model to add/subtract irrelevant styles |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7254 |
return ( val + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7255 |
augmentWidthOrHeight( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7256 |
elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7257 |
name, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7258 |
extra || ( isBorderBox ? "border" : "content" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7259 |
valueIsBorderBox, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7260 |
styles |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7261 |
) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7262 |
) + "px"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7263 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7264 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7265 |
// Try to determine the default display value of an element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7266 |
function css_defaultDisplay( nodeName ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7267 |
var doc = document, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7268 |
display = elemdisplay[ nodeName ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7269 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7270 |
if ( !display ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7271 |
display = actualDisplay( nodeName, doc ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7272 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7273 |
// If the simple way fails, read from inside an iframe |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7274 |
if ( display === "none" || !display ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7275 |
// Use the already-created iframe if possible |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7276 |
iframe = ( iframe || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7277 |
jQuery("<iframe frameborder='0' width='0' height='0'/>") |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7278 |
.css( "cssText", "display:block !important" ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7279 |
).appendTo( doc.documentElement ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7280 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7281 |
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7282 |
doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7283 |
doc.write("<!doctype html><html><body>"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7284 |
doc.close(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7285 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7286 |
display = actualDisplay( nodeName, doc ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7287 |
iframe.detach(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7288 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7289 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7290 |
// Store the correct default display |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7291 |
elemdisplay[ nodeName ] = display; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7292 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7293 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7294 |
return display; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7295 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7296 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7297 |
// Called ONLY from within css_defaultDisplay |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7298 |
function actualDisplay( name, doc ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7299 |
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7300 |
display = jQuery.css( elem[0], "display" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7301 |
elem.remove(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7302 |
return display; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7303 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7304 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7305 |
jQuery.each([ "height", "width" ], function( i, name ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7306 |
jQuery.cssHooks[ name ] = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7307 |
get: function( elem, computed, extra ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7308 |
if ( computed ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7309 |
// certain elements can have dimension info if we invisibly show them |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7310 |
// however, it must have a current display style that would benefit from this |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7311 |
return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7312 |
jQuery.swap( elem, cssShow, function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7313 |
return getWidthOrHeight( elem, name, extra ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7314 |
}) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7315 |
getWidthOrHeight( elem, name, extra ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7316 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7317 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7318 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7319 |
set: function( elem, value, extra ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7320 |
var styles = extra && getStyles( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7321 |
return setPositiveNumber( elem, value, extra ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7322 |
augmentWidthOrHeight( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7323 |
elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7324 |
name, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7325 |
extra, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7326 |
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7327 |
styles |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7328 |
) : 0 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7329 |
); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7330 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7331 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7332 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7333 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7334 |
if ( !jQuery.support.opacity ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7335 |
jQuery.cssHooks.opacity = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7336 |
get: function( elem, computed ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7337 |
// IE uses filters for opacity |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7338 |
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7339 |
( 0.01 * parseFloat( RegExp.$1 ) ) + "" : |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7340 |
computed ? "1" : ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7341 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7342 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7343 |
set: function( elem, value ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7344 |
var style = elem.style, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7345 |
currentStyle = elem.currentStyle, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7346 |
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7347 |
filter = currentStyle && currentStyle.filter || style.filter || ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7348 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7349 |
// IE has trouble with opacity if it does not have layout |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7350 |
// Force it by setting the zoom level |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7351 |
style.zoom = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7352 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7353 |
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7354 |
// if value === "", then remove inline opacity #12685 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7355 |
if ( ( value >= 1 || value === "" ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7356 |
jQuery.trim( filter.replace( ralpha, "" ) ) === "" && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7357 |
style.removeAttribute ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7358 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7359 |
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7360 |
// if "filter:" is present at all, clearType is disabled, we want to avoid this |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7361 |
// style.removeAttribute is IE Only, but so apparently is this code path... |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7362 |
style.removeAttribute( "filter" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7363 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7364 |
// if there is no filter style applied in a css rule or unset inline opacity, we are done |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7365 |
if ( value === "" || currentStyle && !currentStyle.filter ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7366 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7367 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7368 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7369 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7370 |
// otherwise, set new filter values |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7371 |
style.filter = ralpha.test( filter ) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7372 |
filter.replace( ralpha, opacity ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7373 |
filter + " " + opacity; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7374 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7375 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7376 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7377 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7378 |
// These hooks cannot be added until DOM ready because the support test |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7379 |
// for it is not run until after DOM ready |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7380 |
jQuery(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7381 |
if ( !jQuery.support.reliableMarginRight ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7382 |
jQuery.cssHooks.marginRight = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7383 |
get: function( elem, computed ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7384 |
if ( computed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7385 |
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7386 |
// Work around by temporarily setting element display to inline-block |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7387 |
return jQuery.swap( elem, { "display": "inline-block" }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7388 |
curCSS, [ elem, "marginRight" ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7389 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7390 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7391 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7392 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7393 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7394 |
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7395 |
// getComputedStyle returns percent when specified for top/left/bottom/right |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7396 |
// rather than make the css module depend on the offset module, we just check for it here |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7397 |
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7398 |
jQuery.each( [ "top", "left" ], function( i, prop ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7399 |
jQuery.cssHooks[ prop ] = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7400 |
get: function( elem, computed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7401 |
if ( computed ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7402 |
computed = curCSS( elem, prop ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7403 |
// if curCSS returns percentage, fallback to offset |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7404 |
return rnumnonpx.test( computed ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7405 |
jQuery( elem ).position()[ prop ] + "px" : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7406 |
computed; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7407 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7408 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7409 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7410 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7411 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7412 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7413 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7414 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7415 |
if ( jQuery.expr && jQuery.expr.filters ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7416 |
jQuery.expr.filters.hidden = function( elem ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7417 |
// Support: Opera <= 12.12 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7418 |
// Opera reports offsetWidths and offsetHeights less than zero on some elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7419 |
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7420 |
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7421 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7422 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7423 |
jQuery.expr.filters.visible = function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7424 |
return !jQuery.expr.filters.hidden( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7425 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7426 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7427 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7428 |
// These hooks are used by animate to expand properties |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7429 |
jQuery.each({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7430 |
margin: "", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7431 |
padding: "", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7432 |
border: "Width" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7433 |
}, function( prefix, suffix ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7434 |
jQuery.cssHooks[ prefix + suffix ] = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7435 |
expand: function( value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7436 |
var i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7437 |
expanded = {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7438 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7439 |
// assumes a single number if not a string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7440 |
parts = typeof value === "string" ? value.split(" ") : [ value ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7441 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7442 |
for ( ; i < 4; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7443 |
expanded[ prefix + cssExpand[ i ] + suffix ] = |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7444 |
parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7445 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7446 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7447 |
return expanded; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7448 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7449 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7450 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7451 |
if ( !rmargin.test( prefix ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7452 |
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7453 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7454 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7455 |
var r20 = /%20/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7456 |
rbracket = /\[\]$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7457 |
rCRLF = /\r?\n/g, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7458 |
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7459 |
rsubmittable = /^(?:input|select|textarea|keygen)/i; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7460 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7461 |
jQuery.fn.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7462 |
serialize: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7463 |
return jQuery.param( this.serializeArray() ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7464 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7465 |
serializeArray: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7466 |
return this.map(function(){ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7467 |
// Can add propHook for "elements" to filter or add form elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7468 |
var elements = jQuery.prop( this, "elements" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7469 |
return elements ? jQuery.makeArray( elements ) : this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7470 |
}) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7471 |
.filter(function(){ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7472 |
var type = this.type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7473 |
// Use .is(":disabled") so that fieldset[disabled] works |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7474 |
return this.name && !jQuery( this ).is( ":disabled" ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7475 |
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7476 |
( this.checked || !manipulation_rcheckableType.test( type ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7477 |
}) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7478 |
.map(function( i, elem ){ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7479 |
var val = jQuery( this ).val(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7480 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7481 |
return val == null ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7482 |
null : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7483 |
jQuery.isArray( val ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7484 |
jQuery.map( val, function( val ){ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7485 |
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7486 |
}) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7487 |
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7488 |
}).get(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7489 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7490 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7491 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7492 |
//Serialize an array of form elements or a set of |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7493 |
//key/values into a query string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7494 |
jQuery.param = function( a, traditional ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7495 |
var prefix, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7496 |
s = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7497 |
add = function( key, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7498 |
// If value is a function, invoke it and return its value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7499 |
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7500 |
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7501 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7502 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7503 |
// Set traditional to true for jQuery <= 1.3.2 behavior. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7504 |
if ( traditional === undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7505 |
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7506 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7507 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7508 |
// If an array was passed in, assume that it is an array of form elements. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7509 |
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7510 |
// Serialize the form elements |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7511 |
jQuery.each( a, function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7512 |
add( this.name, this.value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7513 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7514 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7515 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7516 |
// If traditional, encode the "old" way (the way 1.3.2 or older |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7517 |
// did it), otherwise encode params recursively. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7518 |
for ( prefix in a ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7519 |
buildParams( prefix, a[ prefix ], traditional, add ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7520 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7521 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7522 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7523 |
// Return the resulting serialization |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7524 |
return s.join( "&" ).replace( r20, "+" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7525 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7526 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7527 |
function buildParams( prefix, obj, traditional, add ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7528 |
var name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7529 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7530 |
if ( jQuery.isArray( obj ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7531 |
// Serialize array item. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7532 |
jQuery.each( obj, function( i, v ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7533 |
if ( traditional || rbracket.test( prefix ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7534 |
// Treat each array item as a scalar. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7535 |
add( prefix, v ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7536 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7537 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7538 |
// Item is non-scalar (array or object), encode its numeric index. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7539 |
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7540 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7541 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7542 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7543 |
} else if ( !traditional && jQuery.type( obj ) === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7544 |
// Serialize object item. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7545 |
for ( name in obj ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7546 |
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7547 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7548 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7549 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7550 |
// Serialize scalar item. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7551 |
add( prefix, obj ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7552 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7553 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7554 |
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7555 |
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7556 |
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7557 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7558 |
// Handle event binding |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7559 |
jQuery.fn[ name ] = function( data, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7560 |
return arguments.length > 0 ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7561 |
this.on( name, null, data, fn ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7562 |
this.trigger( name ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7563 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7564 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7565 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7566 |
jQuery.fn.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7567 |
hover: function( fnOver, fnOut ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7568 |
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7569 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7570 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7571 |
bind: function( types, data, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7572 |
return this.on( types, null, data, fn ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7573 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7574 |
unbind: function( types, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7575 |
return this.off( types, null, fn ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7576 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7577 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7578 |
delegate: function( selector, types, data, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7579 |
return this.on( types, selector, data, fn ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7580 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7581 |
undelegate: function( selector, types, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7582 |
// ( namespace ) or ( selector, types [, fn] ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7583 |
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7584 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7585 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7586 |
var |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7587 |
// Document location |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7588 |
ajaxLocParts, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7589 |
ajaxLocation, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7590 |
ajax_nonce = jQuery.now(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7591 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7592 |
ajax_rquery = /\?/, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7593 |
rhash = /#.*$/, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7594 |
rts = /([?&])_=[^&]*/, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7595 |
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7596 |
// #7653, #8125, #8152: local protocol detection |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7597 |
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7598 |
rnoContent = /^(?:GET|HEAD)$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7599 |
rprotocol = /^\/\//, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7600 |
rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7601 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7602 |
// Keep a copy of the old load method |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7603 |
_load = jQuery.fn.load, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7604 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7605 |
/* Prefilters |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7606 |
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7607 |
* 2) These are called: |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7608 |
* - BEFORE asking for a transport |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7609 |
* - AFTER param serialization (s.data is a string if s.processData is true) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7610 |
* 3) key is the dataType |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7611 |
* 4) the catchall symbol "*" can be used |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7612 |
* 5) execution will start with transport dataType and THEN continue down to "*" if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7613 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7614 |
prefilters = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7615 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7616 |
/* Transports bindings |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7617 |
* 1) key is the dataType |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7618 |
* 2) the catchall symbol "*" can be used |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7619 |
* 3) selection will start with transport dataType and THEN go to "*" if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7620 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7621 |
transports = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7622 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7623 |
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7624 |
allTypes = "*/".concat("*"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7625 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7626 |
// #8138, IE may throw an exception when accessing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7627 |
// a field from window.location if document.domain has been set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7628 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7629 |
ajaxLocation = location.href; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7630 |
} catch( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7631 |
// Use the href attribute of an A element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7632 |
// since IE will modify it given document.location |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7633 |
ajaxLocation = document.createElement( "a" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7634 |
ajaxLocation.href = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7635 |
ajaxLocation = ajaxLocation.href; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7636 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7637 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7638 |
// Segment location into parts |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7639 |
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7640 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7641 |
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7642 |
function addToPrefiltersOrTransports( structure ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7643 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7644 |
// dataTypeExpression is optional and defaults to "*" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7645 |
return function( dataTypeExpression, func ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7646 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7647 |
if ( typeof dataTypeExpression !== "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7648 |
func = dataTypeExpression; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7649 |
dataTypeExpression = "*"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7650 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7651 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7652 |
var dataType, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7653 |
i = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7654 |
dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7655 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7656 |
if ( jQuery.isFunction( func ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7657 |
// For each dataType in the dataTypeExpression |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7658 |
while ( (dataType = dataTypes[i++]) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7659 |
// Prepend if requested |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7660 |
if ( dataType[0] === "+" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7661 |
dataType = dataType.slice( 1 ) || "*"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7662 |
(structure[ dataType ] = structure[ dataType ] || []).unshift( func ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7663 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7664 |
// Otherwise append |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7665 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7666 |
(structure[ dataType ] = structure[ dataType ] || []).push( func ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7667 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7668 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7669 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7670 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7671 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7672 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7673 |
// Base inspection function for prefilters and transports |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7674 |
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7675 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7676 |
var inspected = {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7677 |
seekingTransport = ( structure === transports ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7678 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7679 |
function inspect( dataType ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7680 |
var selected; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7681 |
inspected[ dataType ] = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7682 |
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7683 |
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7684 |
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7685 |
options.dataTypes.unshift( dataTypeOrTransport ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7686 |
inspect( dataTypeOrTransport ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7687 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7688 |
} else if ( seekingTransport ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7689 |
return !( selected = dataTypeOrTransport ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7690 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7691 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7692 |
return selected; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7693 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7694 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7695 |
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7696 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7697 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7698 |
// A special extend for ajax options |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7699 |
// that takes "flat" options (not to be deep extended) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7700 |
// Fixes #9887 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7701 |
function ajaxExtend( target, src ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7702 |
var deep, key, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7703 |
flatOptions = jQuery.ajaxSettings.flatOptions || {}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7704 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7705 |
for ( key in src ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7706 |
if ( src[ key ] !== undefined ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7707 |
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7708 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7709 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7710 |
if ( deep ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7711 |
jQuery.extend( true, target, deep ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7712 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7713 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7714 |
return target; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7715 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7716 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7717 |
jQuery.fn.load = function( url, params, callback ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7718 |
if ( typeof url !== "string" && _load ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7719 |
return _load.apply( this, arguments ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7720 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7721 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7722 |
var selector, response, type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7723 |
self = this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7724 |
off = url.indexOf(" "); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7725 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7726 |
if ( off >= 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7727 |
selector = url.slice( off, url.length ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7728 |
url = url.slice( 0, off ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7729 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7730 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7731 |
// If it's a function |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7732 |
if ( jQuery.isFunction( params ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7733 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7734 |
// We assume that it's the callback |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7735 |
callback = params; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7736 |
params = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7737 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7738 |
// Otherwise, build a param string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7739 |
} else if ( params && typeof params === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7740 |
type = "POST"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7741 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7742 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7743 |
// If we have elements to modify, make the request |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7744 |
if ( self.length > 0 ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7745 |
jQuery.ajax({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7746 |
url: url, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7747 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7748 |
// if "type" variable is undefined, then "GET" method will be used |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7749 |
type: type, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7750 |
dataType: "html", |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7751 |
data: params |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7752 |
}).done(function( responseText ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7753 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7754 |
// Save response for use in complete callback |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7755 |
response = arguments; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7756 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7757 |
self.html( selector ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7758 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7759 |
// If a selector was specified, locate the right elements in a dummy div |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7760 |
// Exclude scripts to avoid IE 'Permission Denied' errors |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7761 |
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7762 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7763 |
// Otherwise use the full result |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7764 |
responseText ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7765 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7766 |
}).complete( callback && function( jqXHR, status ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7767 |
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7768 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7769 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7770 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7771 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7772 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7773 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7774 |
// Attach a bunch of functions for handling common AJAX events |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7775 |
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7776 |
jQuery.fn[ type ] = function( fn ){ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7777 |
return this.on( type, fn ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7778 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7779 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7780 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7781 |
jQuery.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7782 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7783 |
// Counter for holding the number of active queries |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7784 |
active: 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7785 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7786 |
// Last-Modified header cache for next request |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7787 |
lastModified: {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7788 |
etag: {}, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7789 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7790 |
ajaxSettings: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7791 |
url: ajaxLocation, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7792 |
type: "GET", |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7793 |
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7794 |
global: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7795 |
processData: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7796 |
async: true, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7797 |
contentType: "application/x-www-form-urlencoded; charset=UTF-8", |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7798 |
/* |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7799 |
timeout: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7800 |
data: null, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7801 |
dataType: null, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7802 |
username: null, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7803 |
password: null, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7804 |
cache: null, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7805 |
throws: false, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7806 |
traditional: false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7807 |
headers: {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7808 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7809 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7810 |
accepts: { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7811 |
"*": allTypes, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7812 |
text: "text/plain", |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7813 |
html: "text/html", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7814 |
xml: "application/xml, text/xml", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7815 |
json: "application/json, text/javascript" |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7816 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7817 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7818 |
contents: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7819 |
xml: /xml/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7820 |
html: /html/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7821 |
json: /json/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7822 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7823 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7824 |
responseFields: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7825 |
xml: "responseXML", |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7826 |
text: "responseText", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7827 |
json: "responseJSON" |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7828 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7829 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7830 |
// Data converters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7831 |
// Keys separate source (or catchall "*") and destination types with a single space |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7832 |
converters: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7833 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7834 |
// Convert anything to text |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7835 |
"* text": String, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7836 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7837 |
// Text to html (true = no transformation) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7838 |
"text html": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7839 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7840 |
// Evaluate text as a json expression |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7841 |
"text json": jQuery.parseJSON, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7842 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7843 |
// Parse text as xml |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7844 |
"text xml": jQuery.parseXML |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7845 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7846 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7847 |
// For options that shouldn't be deep extended: |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7848 |
// you can add your own custom options here if |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7849 |
// and when you create one that shouldn't be |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7850 |
// deep extended (see ajaxExtend) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7851 |
flatOptions: { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7852 |
url: true, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7853 |
context: true |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7854 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7855 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7856 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7857 |
// Creates a full fledged settings object into target |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7858 |
// with both ajaxSettings and settings fields. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7859 |
// If target is omitted, writes into ajaxSettings. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7860 |
ajaxSetup: function( target, settings ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7861 |
return settings ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7862 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7863 |
// Building a settings object |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7864 |
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7865 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7866 |
// Extending ajaxSettings |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7867 |
ajaxExtend( jQuery.ajaxSettings, target ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7868 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7869 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7870 |
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7871 |
ajaxTransport: addToPrefiltersOrTransports( transports ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7872 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7873 |
// Main method |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7874 |
ajax: function( url, options ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7875 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7876 |
// If url is an object, simulate pre-1.5 signature |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7877 |
if ( typeof url === "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7878 |
options = url; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7879 |
url = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7880 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7881 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7882 |
// Force options to be an object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7883 |
options = options || {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7884 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7885 |
var // Cross-domain detection vars |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7886 |
parts, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7887 |
// Loop variable |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7888 |
i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7889 |
// URL without anti-cache param |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7890 |
cacheURL, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7891 |
// Response headers as string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7892 |
responseHeadersString, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7893 |
// timeout handle |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7894 |
timeoutTimer, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7895 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7896 |
// To know if global events are to be dispatched |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7897 |
fireGlobals, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7898 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7899 |
transport, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7900 |
// Response headers |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7901 |
responseHeaders, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7902 |
// Create the final options object |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7903 |
s = jQuery.ajaxSetup( {}, options ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7904 |
// Callbacks context |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7905 |
callbackContext = s.context || s, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7906 |
// Context for global events is callbackContext if it is a DOM node or jQuery collection |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7907 |
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7908 |
jQuery( callbackContext ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7909 |
jQuery.event, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7910 |
// Deferreds |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7911 |
deferred = jQuery.Deferred(), |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7912 |
completeDeferred = jQuery.Callbacks("once memory"), |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7913 |
// Status-dependent callbacks |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7914 |
statusCode = s.statusCode || {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7915 |
// Headers (they are sent all at once) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7916 |
requestHeaders = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7917 |
requestHeadersNames = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7918 |
// The jqXHR state |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7919 |
state = 0, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7920 |
// Default abort message |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7921 |
strAbort = "canceled", |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7922 |
// Fake xhr |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7923 |
jqXHR = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7924 |
readyState: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7925 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7926 |
// Builds headers hashtable if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7927 |
getResponseHeader: function( key ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7928 |
var match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7929 |
if ( state === 2 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7930 |
if ( !responseHeaders ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7931 |
responseHeaders = {}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7932 |
while ( (match = rheaders.exec( responseHeadersString )) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7933 |
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7934 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7935 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7936 |
match = responseHeaders[ key.toLowerCase() ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7937 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7938 |
return match == null ? null : match; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7939 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7940 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7941 |
// Raw string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7942 |
getAllResponseHeaders: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7943 |
return state === 2 ? responseHeadersString : null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7944 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7945 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7946 |
// Caches the header |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7947 |
setRequestHeader: function( name, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7948 |
var lname = name.toLowerCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7949 |
if ( !state ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7950 |
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7951 |
requestHeaders[ name ] = value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7952 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7953 |
return this; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7954 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7955 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7956 |
// Overrides response content-type header |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7957 |
overrideMimeType: function( type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7958 |
if ( !state ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7959 |
s.mimeType = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7960 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7961 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7962 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7963 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7964 |
// Status-dependent callbacks |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7965 |
statusCode: function( map ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7966 |
var code; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7967 |
if ( map ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7968 |
if ( state < 2 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7969 |
for ( code in map ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7970 |
// Lazy-add the new callback in a way that preserves old ones |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7971 |
statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7972 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7973 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7974 |
// Execute the appropriate callbacks |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7975 |
jqXHR.always( map[ jqXHR.status ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7976 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7977 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7978 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7979 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7980 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7981 |
// Cancel the request |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7982 |
abort: function( statusText ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7983 |
var finalText = statusText || strAbort; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7984 |
if ( transport ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7985 |
transport.abort( finalText ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7986 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7987 |
done( 0, finalText ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7988 |
return this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7989 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7990 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7991 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7992 |
// Attach deferreds |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7993 |
deferred.promise( jqXHR ).complete = completeDeferred.add; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7994 |
jqXHR.success = jqXHR.done; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7995 |
jqXHR.error = jqXHR.fail; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7996 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7997 |
// Remove hash character (#7531: and string promotion) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7998 |
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
7999 |
// Handle falsy url in the settings object (#10093: consistency with old signature) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8000 |
// We also use the url parameter if available |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8001 |
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8002 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8003 |
// Alias method option to type as per ticket #12004 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8004 |
s.type = options.method || options.type || s.method || s.type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8005 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8006 |
// Extract dataTypes list |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8007 |
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8008 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8009 |
// A cross-domain request is in order when we have a protocol:host:port mismatch |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8010 |
if ( s.crossDomain == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8011 |
parts = rurl.exec( s.url.toLowerCase() ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8012 |
s.crossDomain = !!( parts && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8013 |
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8014 |
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8015 |
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8016 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8017 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8018 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8019 |
// Convert data if not already a string |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8020 |
if ( s.data && s.processData && typeof s.data !== "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8021 |
s.data = jQuery.param( s.data, s.traditional ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8022 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8023 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8024 |
// Apply prefilters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8025 |
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8026 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8027 |
// If request was aborted inside a prefilter, stop there |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8028 |
if ( state === 2 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8029 |
return jqXHR; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8030 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8031 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8032 |
// We can fire global events as of now if asked to |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8033 |
fireGlobals = s.global; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8034 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8035 |
// Watch for a new set of requests |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8036 |
if ( fireGlobals && jQuery.active++ === 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8037 |
jQuery.event.trigger("ajaxStart"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8038 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8039 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8040 |
// Uppercase the type |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8041 |
s.type = s.type.toUpperCase(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8042 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8043 |
// Determine if request has content |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8044 |
s.hasContent = !rnoContent.test( s.type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8045 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8046 |
// Save the URL in case we're toying with the If-Modified-Since |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8047 |
// and/or If-None-Match header later on |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8048 |
cacheURL = s.url; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8049 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8050 |
// More options handling for requests with no content |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8051 |
if ( !s.hasContent ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8052 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8053 |
// If data is available, append data to url |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8054 |
if ( s.data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8055 |
cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8056 |
// #9682: remove data so that it's not used in an eventual retry |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8057 |
delete s.data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8058 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8059 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8060 |
// Add anti-cache in url if needed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8061 |
if ( s.cache === false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8062 |
s.url = rts.test( cacheURL ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8063 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8064 |
// If there is already a '_' parameter, set its value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8065 |
cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8066 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8067 |
// Otherwise add one to the end |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8068 |
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8069 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8070 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8071 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8072 |
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8073 |
if ( s.ifModified ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8074 |
if ( jQuery.lastModified[ cacheURL ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8075 |
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8076 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8077 |
if ( jQuery.etag[ cacheURL ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8078 |
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8079 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8080 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8081 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8082 |
// Set the correct header, if data is being sent |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8083 |
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8084 |
jqXHR.setRequestHeader( "Content-Type", s.contentType ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8085 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8086 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8087 |
// Set the Accepts header for the server, depending on the dataType |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8088 |
jqXHR.setRequestHeader( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8089 |
"Accept", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8090 |
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8091 |
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8092 |
s.accepts[ "*" ] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8093 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8094 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8095 |
// Check for headers option |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8096 |
for ( i in s.headers ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8097 |
jqXHR.setRequestHeader( i, s.headers[ i ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8098 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8099 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8100 |
// Allow custom headers/mimetypes and early abort |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8101 |
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8102 |
// Abort if not done already and return |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8103 |
return jqXHR.abort(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8104 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8105 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8106 |
// aborting is no longer a cancellation |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8107 |
strAbort = "abort"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8108 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8109 |
// Install callbacks on deferreds |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8110 |
for ( i in { success: 1, error: 1, complete: 1 } ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8111 |
jqXHR[ i ]( s[ i ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8112 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8113 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8114 |
// Get transport |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8115 |
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8116 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8117 |
// If no transport, we auto-abort |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8118 |
if ( !transport ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8119 |
done( -1, "No Transport" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8120 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8121 |
jqXHR.readyState = 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8122 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8123 |
// Send global event |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8124 |
if ( fireGlobals ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8125 |
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8126 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8127 |
// Timeout |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8128 |
if ( s.async && s.timeout > 0 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8129 |
timeoutTimer = setTimeout(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8130 |
jqXHR.abort("timeout"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8131 |
}, s.timeout ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8132 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8133 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8134 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8135 |
state = 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8136 |
transport.send( requestHeaders, done ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8137 |
} catch ( e ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8138 |
// Propagate exception as error if not done |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8139 |
if ( state < 2 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8140 |
done( -1, e ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8141 |
// Simply rethrow otherwise |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8142 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8143 |
throw e; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8144 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8145 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8146 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8147 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8148 |
// Callback for when everything is done |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8149 |
function done( status, nativeStatusText, responses, headers ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8150 |
var isSuccess, success, error, response, modified, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8151 |
statusText = nativeStatusText; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8152 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8153 |
// Called once |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8154 |
if ( state === 2 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8155 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8156 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8157 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8158 |
// State is "done" now |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8159 |
state = 2; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8160 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8161 |
// Clear timeout if it exists |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8162 |
if ( timeoutTimer ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8163 |
clearTimeout( timeoutTimer ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8164 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8165 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8166 |
// Dereference transport for early garbage collection |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8167 |
// (no matter how long the jqXHR object will be used) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8168 |
transport = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8169 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8170 |
// Cache response headers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8171 |
responseHeadersString = headers || ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8172 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8173 |
// Set readyState |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8174 |
jqXHR.readyState = status > 0 ? 4 : 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8175 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8176 |
// Determine if successful |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8177 |
isSuccess = status >= 200 && status < 300 || status === 304; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8178 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8179 |
// Get response data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8180 |
if ( responses ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8181 |
response = ajaxHandleResponses( s, jqXHR, responses ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8182 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8183 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8184 |
// Convert no matter what (that way responseXXX fields are always set) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8185 |
response = ajaxConvert( s, response, jqXHR, isSuccess ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8186 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8187 |
// If successful, handle type chaining |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8188 |
if ( isSuccess ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8189 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8190 |
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8191 |
if ( s.ifModified ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8192 |
modified = jqXHR.getResponseHeader("Last-Modified"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8193 |
if ( modified ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8194 |
jQuery.lastModified[ cacheURL ] = modified; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8195 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8196 |
modified = jqXHR.getResponseHeader("etag"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8197 |
if ( modified ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8198 |
jQuery.etag[ cacheURL ] = modified; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8199 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8200 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8201 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8202 |
// if no content |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8203 |
if ( status === 204 || s.type === "HEAD" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8204 |
statusText = "nocontent"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8205 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8206 |
// if not modified |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8207 |
} else if ( status === 304 ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8208 |
statusText = "notmodified"; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8209 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8210 |
// If we have data, let's convert it |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8211 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8212 |
statusText = response.state; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8213 |
success = response.data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8214 |
error = response.error; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8215 |
isSuccess = !error; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8216 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8217 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8218 |
// We extract error from statusText |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8219 |
// then normalize statusText and status for non-aborts |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8220 |
error = statusText; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8221 |
if ( status || !statusText ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8222 |
statusText = "error"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8223 |
if ( status < 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8224 |
status = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8225 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8226 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8227 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8228 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8229 |
// Set data for the fake xhr object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8230 |
jqXHR.status = status; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8231 |
jqXHR.statusText = ( nativeStatusText || statusText ) + ""; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8232 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8233 |
// Success/Error |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8234 |
if ( isSuccess ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8235 |
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8236 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8237 |
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8238 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8239 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8240 |
// Status-dependent callbacks |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8241 |
jqXHR.statusCode( statusCode ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8242 |
statusCode = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8243 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8244 |
if ( fireGlobals ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8245 |
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8246 |
[ jqXHR, s, isSuccess ? success : error ] ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8247 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8248 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8249 |
// Complete |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8250 |
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8251 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8252 |
if ( fireGlobals ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8253 |
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8254 |
// Handle the global AJAX counter |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8255 |
if ( !( --jQuery.active ) ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8256 |
jQuery.event.trigger("ajaxStop"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8257 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8258 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8259 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8260 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8261 |
return jqXHR; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8262 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8263 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8264 |
getJSON: function( url, data, callback ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8265 |
return jQuery.get( url, data, callback, "json" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8266 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8267 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8268 |
getScript: function( url, callback ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8269 |
return jQuery.get( url, undefined, callback, "script" ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8270 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8271 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8272 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8273 |
jQuery.each( [ "get", "post" ], function( i, method ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8274 |
jQuery[ method ] = function( url, data, callback, type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8275 |
// shift arguments if data argument was omitted |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8276 |
if ( jQuery.isFunction( data ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8277 |
type = type || callback; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8278 |
callback = data; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8279 |
data = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8280 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8281 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8282 |
return jQuery.ajax({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8283 |
url: url, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8284 |
type: method, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8285 |
dataType: type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8286 |
data: data, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8287 |
success: callback |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8288 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8289 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8290 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8291 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8292 |
/* Handles responses to an ajax request: |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8293 |
* - finds the right dataType (mediates between content-type and expected dataType) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8294 |
* - returns the corresponding response |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8295 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8296 |
function ajaxHandleResponses( s, jqXHR, responses ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8297 |
var firstDataType, ct, finalDataType, type, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8298 |
contents = s.contents, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8299 |
dataTypes = s.dataTypes; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8300 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8301 |
// Remove auto dataType and get content-type in the process |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8302 |
while( dataTypes[ 0 ] === "*" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8303 |
dataTypes.shift(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8304 |
if ( ct === undefined ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8305 |
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8306 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8307 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8308 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8309 |
// Check if we're dealing with a known content-type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8310 |
if ( ct ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8311 |
for ( type in contents ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8312 |
if ( contents[ type ] && contents[ type ].test( ct ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8313 |
dataTypes.unshift( type ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8314 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8315 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8316 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8317 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8318 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8319 |
// Check to see if we have a response for the expected dataType |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8320 |
if ( dataTypes[ 0 ] in responses ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8321 |
finalDataType = dataTypes[ 0 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8322 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8323 |
// Try convertible dataTypes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8324 |
for ( type in responses ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8325 |
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8326 |
finalDataType = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8327 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8328 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8329 |
if ( !firstDataType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8330 |
firstDataType = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8331 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8332 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8333 |
// Or just use first one |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8334 |
finalDataType = finalDataType || firstDataType; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8335 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8336 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8337 |
// If we found a dataType |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8338 |
// We add the dataType to the list if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8339 |
// and return the corresponding response |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8340 |
if ( finalDataType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8341 |
if ( finalDataType !== dataTypes[ 0 ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8342 |
dataTypes.unshift( finalDataType ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8343 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8344 |
return responses[ finalDataType ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8345 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8346 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8347 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8348 |
/* Chain conversions given the request and the original response |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8349 |
* Also sets the responseXXX fields on the jqXHR instance |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8350 |
*/ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8351 |
function ajaxConvert( s, response, jqXHR, isSuccess ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8352 |
var conv2, current, conv, tmp, prev, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8353 |
converters = {}, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8354 |
// Work with a copy of dataTypes in case we need to modify it for conversion |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8355 |
dataTypes = s.dataTypes.slice(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8356 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8357 |
// Create converters map with lowercased keys |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8358 |
if ( dataTypes[ 1 ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8359 |
for ( conv in s.converters ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8360 |
converters[ conv.toLowerCase() ] = s.converters[ conv ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8361 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8362 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8363 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8364 |
current = dataTypes.shift(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8365 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8366 |
// Convert to each sequential dataType |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8367 |
while ( current ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8368 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8369 |
if ( s.responseFields[ current ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8370 |
jqXHR[ s.responseFields[ current ] ] = response; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8371 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8372 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8373 |
// Apply the dataFilter if provided |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8374 |
if ( !prev && isSuccess && s.dataFilter ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8375 |
response = s.dataFilter( response, s.dataType ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8376 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8377 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8378 |
prev = current; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8379 |
current = dataTypes.shift(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8380 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8381 |
if ( current ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8382 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8383 |
// There's only work to do if current dataType is non-auto |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8384 |
if ( current === "*" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8385 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8386 |
current = prev; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8387 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8388 |
// Convert response if prev dataType is non-auto and differs from current |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8389 |
} else if ( prev !== "*" && prev !== current ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8390 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8391 |
// Seek a direct converter |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8392 |
conv = converters[ prev + " " + current ] || converters[ "* " + current ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8393 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8394 |
// If none found, seek a pair |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8395 |
if ( !conv ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8396 |
for ( conv2 in converters ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8397 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8398 |
// If conv2 outputs current |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8399 |
tmp = conv2.split( " " ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8400 |
if ( tmp[ 1 ] === current ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8401 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8402 |
// If prev can be converted to accepted input |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8403 |
conv = converters[ prev + " " + tmp[ 0 ] ] || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8404 |
converters[ "* " + tmp[ 0 ] ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8405 |
if ( conv ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8406 |
// Condense equivalence converters |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8407 |
if ( conv === true ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8408 |
conv = converters[ conv2 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8409 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8410 |
// Otherwise, insert the intermediate dataType |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8411 |
} else if ( converters[ conv2 ] !== true ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8412 |
current = tmp[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8413 |
dataTypes.unshift( tmp[ 1 ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8414 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8415 |
break; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8416 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8417 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8418 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8419 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8420 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8421 |
// Apply converter (if not an equivalence) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8422 |
if ( conv !== true ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8423 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8424 |
// Unless errors are allowed to bubble, catch and return them |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8425 |
if ( conv && s[ "throws" ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8426 |
response = conv( response ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8427 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8428 |
try { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8429 |
response = conv( response ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8430 |
} catch ( e ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8431 |
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8432 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8433 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8434 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8435 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8436 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8437 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8438 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8439 |
return { state: "success", data: response }; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8440 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8441 |
// Install script dataType |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8442 |
jQuery.ajaxSetup({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8443 |
accepts: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8444 |
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8445 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8446 |
contents: { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8447 |
script: /(?:java|ecma)script/ |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8448 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8449 |
converters: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8450 |
"text script": function( text ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8451 |
jQuery.globalEval( text ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8452 |
return text; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8453 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8454 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8455 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8456 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8457 |
// Handle cache's special case and global |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8458 |
jQuery.ajaxPrefilter( "script", function( s ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8459 |
if ( s.cache === undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8460 |
s.cache = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8461 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8462 |
if ( s.crossDomain ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8463 |
s.type = "GET"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8464 |
s.global = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8465 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8466 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8467 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8468 |
// Bind script tag hack transport |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8469 |
jQuery.ajaxTransport( "script", function(s) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8470 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8471 |
// This transport only deals with cross domain requests |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8472 |
if ( s.crossDomain ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8473 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8474 |
var script, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8475 |
head = document.head || jQuery("head")[0] || document.documentElement; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8476 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8477 |
return { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8478 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8479 |
send: function( _, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8480 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8481 |
script = document.createElement("script"); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8482 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8483 |
script.async = true; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8484 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8485 |
if ( s.scriptCharset ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8486 |
script.charset = s.scriptCharset; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8487 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8488 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8489 |
script.src = s.url; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8490 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8491 |
// Attach handlers for all browsers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8492 |
script.onload = script.onreadystatechange = function( _, isAbort ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8493 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8494 |
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8495 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8496 |
// Handle memory leak in IE |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8497 |
script.onload = script.onreadystatechange = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8498 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8499 |
// Remove the script |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8500 |
if ( script.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8501 |
script.parentNode.removeChild( script ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8502 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8503 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8504 |
// Dereference the script |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8505 |
script = null; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8506 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8507 |
// Callback if not abort |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8508 |
if ( !isAbort ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8509 |
callback( 200, "success" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8510 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8511 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8512 |
}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8513 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8514 |
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8515 |
// Use native DOM manipulation to avoid our domManip AJAX trickery |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8516 |
head.insertBefore( script, head.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8517 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8518 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8519 |
abort: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8520 |
if ( script ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8521 |
script.onload( undefined, true ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8522 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8523 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8524 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8525 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8526 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8527 |
var oldCallbacks = [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8528 |
rjsonp = /(=)\?(?=&|$)|\?\?/; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8529 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8530 |
// Default jsonp settings |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8531 |
jQuery.ajaxSetup({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8532 |
jsonp: "callback", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8533 |
jsonpCallback: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8534 |
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8535 |
this[ callback ] = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8536 |
return callback; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8537 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8538 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8539 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8540 |
// Detect, normalize options and install callbacks for jsonp requests |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8541 |
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8542 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8543 |
var callbackName, overwritten, responseContainer, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8544 |
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8545 |
"url" : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8546 |
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8547 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8548 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8549 |
// Handle iff the expected data type is "jsonp" or we have a parameter to set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8550 |
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8551 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8552 |
// Get callback name, remembering preexisting value associated with it |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8553 |
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8554 |
s.jsonpCallback() : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8555 |
s.jsonpCallback; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8556 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8557 |
// Insert callback into url or form data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8558 |
if ( jsonProp ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8559 |
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8560 |
} else if ( s.jsonp !== false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8561 |
s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8562 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8563 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8564 |
// Use data converter to retrieve json after script execution |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8565 |
s.converters["script json"] = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8566 |
if ( !responseContainer ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8567 |
jQuery.error( callbackName + " was not called" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8568 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8569 |
return responseContainer[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8570 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8571 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8572 |
// force json dataType |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8573 |
s.dataTypes[ 0 ] = "json"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8574 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8575 |
// Install callback |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8576 |
overwritten = window[ callbackName ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8577 |
window[ callbackName ] = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8578 |
responseContainer = arguments; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8579 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8580 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8581 |
// Clean-up function (fires after converters) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8582 |
jqXHR.always(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8583 |
// Restore preexisting value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8584 |
window[ callbackName ] = overwritten; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8585 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8586 |
// Save back as free |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8587 |
if ( s[ callbackName ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8588 |
// make sure that re-using the options doesn't screw things around |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8589 |
s.jsonpCallback = originalSettings.jsonpCallback; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8590 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8591 |
// save the callback name for future use |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8592 |
oldCallbacks.push( callbackName ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8593 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8594 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8595 |
// Call if it was a function and we have a response |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8596 |
if ( responseContainer && jQuery.isFunction( overwritten ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8597 |
overwritten( responseContainer[ 0 ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8598 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8599 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8600 |
responseContainer = overwritten = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8601 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8602 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8603 |
// Delegate to script |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8604 |
return "script"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8605 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8606 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8607 |
var xhrCallbacks, xhrSupported, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8608 |
xhrId = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8609 |
// #5280: Internet Explorer will keep connections alive if we don't abort on unload |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8610 |
xhrOnUnloadAbort = window.ActiveXObject && function() { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8611 |
// Abort all pending requests |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8612 |
var key; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8613 |
for ( key in xhrCallbacks ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8614 |
xhrCallbacks[ key ]( undefined, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8615 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8616 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8617 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8618 |
// Functions to create xhrs |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8619 |
function createStandardXHR() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8620 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8621 |
return new window.XMLHttpRequest(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8622 |
} catch( e ) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8623 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8624 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8625 |
function createActiveXHR() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8626 |
try { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8627 |
return new window.ActiveXObject("Microsoft.XMLHTTP"); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8628 |
} catch( e ) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8629 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8630 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8631 |
// Create the request object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8632 |
// (This is still attached to ajaxSettings for backward compatibility) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8633 |
jQuery.ajaxSettings.xhr = window.ActiveXObject ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8634 |
/* Microsoft failed to properly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8635 |
* implement the XMLHttpRequest in IE7 (can't request local files), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8636 |
* so we use the ActiveXObject when it is available |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8637 |
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8638 |
* we need a fallback. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8639 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8640 |
function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8641 |
return !this.isLocal && createStandardXHR() || createActiveXHR(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8642 |
} : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8643 |
// For all other browsers, use the standard XMLHttpRequest object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8644 |
createStandardXHR; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8645 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8646 |
// Determine support properties |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8647 |
xhrSupported = jQuery.ajaxSettings.xhr(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8648 |
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8649 |
xhrSupported = jQuery.support.ajax = !!xhrSupported; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8650 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8651 |
// Create transport if the browser can provide an xhr |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8652 |
if ( xhrSupported ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8653 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8654 |
jQuery.ajaxTransport(function( s ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8655 |
// Cross domain only allowed if supported through XMLHttpRequest |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8656 |
if ( !s.crossDomain || jQuery.support.cors ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8657 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8658 |
var callback; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8659 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8660 |
return { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8661 |
send: function( headers, complete ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8662 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8663 |
// Get a new xhr |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8664 |
var handle, i, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8665 |
xhr = s.xhr(); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8666 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8667 |
// Open the socket |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8668 |
// Passing null username, generates a login popup on Opera (#2865) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8669 |
if ( s.username ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8670 |
xhr.open( s.type, s.url, s.async, s.username, s.password ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8671 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8672 |
xhr.open( s.type, s.url, s.async ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8673 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8674 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8675 |
// Apply custom fields if provided |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8676 |
if ( s.xhrFields ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8677 |
for ( i in s.xhrFields ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8678 |
xhr[ i ] = s.xhrFields[ i ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8679 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8680 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8681 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8682 |
// Override mime type if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8683 |
if ( s.mimeType && xhr.overrideMimeType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8684 |
xhr.overrideMimeType( s.mimeType ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8685 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8686 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8687 |
// X-Requested-With header |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8688 |
// For cross-domain requests, seeing as conditions for a preflight are |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8689 |
// akin to a jigsaw puzzle, we simply never set it to be sure. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8690 |
// (it can always be set on a per-request basis or even using ajaxSetup) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8691 |
// For same-domain requests, won't change header if already provided. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8692 |
if ( !s.crossDomain && !headers["X-Requested-With"] ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8693 |
headers["X-Requested-With"] = "XMLHttpRequest"; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8694 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8695 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8696 |
// Need an extra try/catch for cross domain requests in Firefox 3 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8697 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8698 |
for ( i in headers ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8699 |
xhr.setRequestHeader( i, headers[ i ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8700 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8701 |
} catch( err ) {} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8702 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8703 |
// Do send the request |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8704 |
// This may raise an exception which is actually |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8705 |
// handled in jQuery.ajax (so no try/catch here) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8706 |
xhr.send( ( s.hasContent && s.data ) || null ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8707 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8708 |
// Listener |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8709 |
callback = function( _, isAbort ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8710 |
var status, responseHeaders, statusText, responses; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8711 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8712 |
// Firefox throws exceptions when accessing properties |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8713 |
// of an xhr when a network error occurred |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8714 |
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8715 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8716 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8717 |
// Was never called and is aborted or complete |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8718 |
if ( callback && ( isAbort || xhr.readyState === 4 ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8719 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8720 |
// Only called once |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8721 |
callback = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8722 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8723 |
// Do not keep as active anymore |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8724 |
if ( handle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8725 |
xhr.onreadystatechange = jQuery.noop; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8726 |
if ( xhrOnUnloadAbort ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8727 |
delete xhrCallbacks[ handle ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8728 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8729 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8730 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8731 |
// If it's an abort |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8732 |
if ( isAbort ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8733 |
// Abort it manually if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8734 |
if ( xhr.readyState !== 4 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8735 |
xhr.abort(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8736 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8737 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8738 |
responses = {}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8739 |
status = xhr.status; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8740 |
responseHeaders = xhr.getAllResponseHeaders(); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8741 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8742 |
// When requesting binary data, IE6-9 will throw an exception |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8743 |
// on any attempt to access responseText (#11426) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8744 |
if ( typeof xhr.responseText === "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8745 |
responses.text = xhr.responseText; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8746 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8747 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8748 |
// Firefox throws an exception when accessing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8749 |
// statusText for faulty cross-domain requests |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8750 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8751 |
statusText = xhr.statusText; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8752 |
} catch( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8753 |
// We normalize with Webkit giving an empty statusText |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8754 |
statusText = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8755 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8756 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8757 |
// Filter status for non standard behaviors |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8758 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8759 |
// If the request is local and we have data: assume a success |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8760 |
// (success with no data won't get notified, that's the best we |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8761 |
// can do given current implementations) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8762 |
if ( !status && s.isLocal && !s.crossDomain ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8763 |
status = responses.text ? 200 : 404; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8764 |
// IE - #1450: sometimes returns 1223 when it should be 204 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8765 |
} else if ( status === 1223 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8766 |
status = 204; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8767 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8768 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8769 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8770 |
} catch( firefoxAccessException ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8771 |
if ( !isAbort ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8772 |
complete( -1, firefoxAccessException ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8773 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8774 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8775 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8776 |
// Call complete if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8777 |
if ( responses ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8778 |
complete( status, statusText, responses, responseHeaders ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8779 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8780 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8781 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8782 |
if ( !s.async ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8783 |
// if we're in sync mode we fire the callback |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8784 |
callback(); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8785 |
} else if ( xhr.readyState === 4 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8786 |
// (IE6 & IE7) if it's in cache and has been |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8787 |
// retrieved directly we need to fire the callback |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8788 |
setTimeout( callback ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8789 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8790 |
handle = ++xhrId; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8791 |
if ( xhrOnUnloadAbort ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8792 |
// Create the active xhrs callbacks list if needed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8793 |
// and attach the unload handler |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8794 |
if ( !xhrCallbacks ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8795 |
xhrCallbacks = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8796 |
jQuery( window ).unload( xhrOnUnloadAbort ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8797 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8798 |
// Add to list of active xhrs callbacks |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8799 |
xhrCallbacks[ handle ] = callback; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8800 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8801 |
xhr.onreadystatechange = callback; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8802 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8803 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8804 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8805 |
abort: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8806 |
if ( callback ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8807 |
callback( undefined, true ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8808 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8809 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8810 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8811 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8812 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8813 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8814 |
var fxNow, timerId, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8815 |
rfxtypes = /^(?:toggle|show|hide)$/, |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8816 |
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8817 |
rrun = /queueHooks$/, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8818 |
animationPrefilters = [ defaultPrefilter ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8819 |
tweeners = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8820 |
"*": [function( prop, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8821 |
var tween = this.createTween( prop, value ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8822 |
target = tween.cur(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8823 |
parts = rfxnum.exec( value ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8824 |
unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8825 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8826 |
// Starting value computation is required for potential unit mismatches |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8827 |
start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8828 |
rfxnum.exec( jQuery.css( tween.elem, prop ) ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8829 |
scale = 1, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8830 |
maxIterations = 20; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8831 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8832 |
if ( start && start[ 3 ] !== unit ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8833 |
// Trust units reported by jQuery.css |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8834 |
unit = unit || start[ 3 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8835 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8836 |
// Make sure we update the tween properties later on |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8837 |
parts = parts || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8838 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8839 |
// Iteratively approximate from a nonzero starting point |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8840 |
start = +target || 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8841 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8842 |
do { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8843 |
// If previous iteration zeroed out, double until we get *something* |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8844 |
// Use a string for doubling factor so we don't accidentally see scale as unchanged below |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8845 |
scale = scale || ".5"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8846 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8847 |
// Adjust and apply |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8848 |
start = start / scale; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8849 |
jQuery.style( tween.elem, prop, start + unit ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8850 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8851 |
// Update scale, tolerating zero or NaN from tween.cur() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8852 |
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8853 |
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8854 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8855 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8856 |
// Update tween properties |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8857 |
if ( parts ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8858 |
start = tween.start = +start || +target || 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8859 |
tween.unit = unit; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8860 |
// If a +=/-= token was provided, we're doing a relative animation |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8861 |
tween.end = parts[ 1 ] ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8862 |
start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8863 |
+parts[ 2 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8864 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8865 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8866 |
return tween; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8867 |
}] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8868 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8869 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8870 |
// Animations created synchronously will run synchronously |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8871 |
function createFxNow() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8872 |
setTimeout(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8873 |
fxNow = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8874 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8875 |
return ( fxNow = jQuery.now() ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8876 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8877 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8878 |
function createTween( value, prop, animation ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8879 |
var tween, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8880 |
collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8881 |
index = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8882 |
length = collection.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8883 |
for ( ; index < length; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8884 |
if ( (tween = collection[ index ].call( animation, prop, value )) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8885 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8886 |
// we're done with this property |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8887 |
return tween; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8888 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8889 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8890 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8891 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8892 |
function Animation( elem, properties, options ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8893 |
var result, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8894 |
stopped, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8895 |
index = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8896 |
length = animationPrefilters.length, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8897 |
deferred = jQuery.Deferred().always( function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8898 |
// don't match elem in the :animated selector |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8899 |
delete tick.elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8900 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8901 |
tick = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8902 |
if ( stopped ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8903 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8904 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8905 |
var currentTime = fxNow || createFxNow(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8906 |
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8907 |
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8908 |
temp = remaining / animation.duration || 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8909 |
percent = 1 - temp, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8910 |
index = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8911 |
length = animation.tweens.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8912 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8913 |
for ( ; index < length ; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8914 |
animation.tweens[ index ].run( percent ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8915 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8916 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8917 |
deferred.notifyWith( elem, [ animation, percent, remaining ]); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8918 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8919 |
if ( percent < 1 && length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8920 |
return remaining; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8921 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8922 |
deferred.resolveWith( elem, [ animation ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8923 |
return false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8924 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8925 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8926 |
animation = deferred.promise({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8927 |
elem: elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8928 |
props: jQuery.extend( {}, properties ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8929 |
opts: jQuery.extend( true, { specialEasing: {} }, options ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8930 |
originalProperties: properties, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8931 |
originalOptions: options, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8932 |
startTime: fxNow || createFxNow(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8933 |
duration: options.duration, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8934 |
tweens: [], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8935 |
createTween: function( prop, end ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8936 |
var tween = jQuery.Tween( elem, animation.opts, prop, end, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8937 |
animation.opts.specialEasing[ prop ] || animation.opts.easing ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8938 |
animation.tweens.push( tween ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8939 |
return tween; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8940 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8941 |
stop: function( gotoEnd ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8942 |
var index = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8943 |
// if we are going to the end, we want to run all the tweens |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8944 |
// otherwise we skip this part |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8945 |
length = gotoEnd ? animation.tweens.length : 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8946 |
if ( stopped ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8947 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8948 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8949 |
stopped = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8950 |
for ( ; index < length ; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8951 |
animation.tweens[ index ].run( 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8952 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8953 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8954 |
// resolve when we played the last frame |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8955 |
// otherwise, reject |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8956 |
if ( gotoEnd ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8957 |
deferred.resolveWith( elem, [ animation, gotoEnd ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8958 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8959 |
deferred.rejectWith( elem, [ animation, gotoEnd ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8960 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8961 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8962 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8963 |
}), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8964 |
props = animation.props; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8965 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8966 |
propFilter( props, animation.opts.specialEasing ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8967 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8968 |
for ( ; index < length ; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8969 |
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8970 |
if ( result ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8971 |
return result; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8972 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8973 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8974 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8975 |
jQuery.map( props, createTween, animation ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8976 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8977 |
if ( jQuery.isFunction( animation.opts.start ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8978 |
animation.opts.start.call( elem, animation ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8979 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8980 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8981 |
jQuery.fx.timer( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8982 |
jQuery.extend( tick, { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8983 |
elem: elem, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8984 |
anim: animation, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8985 |
queue: animation.opts.queue |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8986 |
}) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8987 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8988 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8989 |
// attach callbacks from options |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8990 |
return animation.progress( animation.opts.progress ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8991 |
.done( animation.opts.done, animation.opts.complete ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8992 |
.fail( animation.opts.fail ) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8993 |
.always( animation.opts.always ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8994 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8995 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8996 |
function propFilter( props, specialEasing ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8997 |
var index, name, easing, value, hooks; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8998 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
8999 |
// camelCase, specialEasing and expand cssHook pass |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9000 |
for ( index in props ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9001 |
name = jQuery.camelCase( index ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9002 |
easing = specialEasing[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9003 |
value = props[ index ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9004 |
if ( jQuery.isArray( value ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9005 |
easing = value[ 1 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9006 |
value = props[ index ] = value[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9007 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9008 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9009 |
if ( index !== name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9010 |
props[ name ] = value; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9011 |
delete props[ index ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9012 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9013 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9014 |
hooks = jQuery.cssHooks[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9015 |
if ( hooks && "expand" in hooks ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9016 |
value = hooks.expand( value ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9017 |
delete props[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9018 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9019 |
// not quite $.extend, this wont overwrite keys already present. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9020 |
// also - reusing 'index' from above because we have the correct "name" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9021 |
for ( index in value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9022 |
if ( !( index in props ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9023 |
props[ index ] = value[ index ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9024 |
specialEasing[ index ] = easing; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9025 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9026 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9027 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9028 |
specialEasing[ name ] = easing; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9029 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9030 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9031 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9032 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9033 |
jQuery.Animation = jQuery.extend( Animation, { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9034 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9035 |
tweener: function( props, callback ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9036 |
if ( jQuery.isFunction( props ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9037 |
callback = props; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9038 |
props = [ "*" ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9039 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9040 |
props = props.split(" "); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9041 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9042 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9043 |
var prop, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9044 |
index = 0, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9045 |
length = props.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9046 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9047 |
for ( ; index < length ; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9048 |
prop = props[ index ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9049 |
tweeners[ prop ] = tweeners[ prop ] || []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9050 |
tweeners[ prop ].unshift( callback ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9051 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9052 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9053 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9054 |
prefilter: function( callback, prepend ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9055 |
if ( prepend ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9056 |
animationPrefilters.unshift( callback ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9057 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9058 |
animationPrefilters.push( callback ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9059 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9060 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9061 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9062 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9063 |
function defaultPrefilter( elem, props, opts ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9064 |
/* jshint validthis: true */ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9065 |
var prop, value, toggle, tween, hooks, oldfire, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9066 |
anim = this, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9067 |
orig = {}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9068 |
style = elem.style, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9069 |
hidden = elem.nodeType && isHidden( elem ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9070 |
dataShow = jQuery._data( elem, "fxshow" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9071 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9072 |
// handle queue: false promises |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9073 |
if ( !opts.queue ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9074 |
hooks = jQuery._queueHooks( elem, "fx" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9075 |
if ( hooks.unqueued == null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9076 |
hooks.unqueued = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9077 |
oldfire = hooks.empty.fire; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9078 |
hooks.empty.fire = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9079 |
if ( !hooks.unqueued ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9080 |
oldfire(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9081 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9082 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9083 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9084 |
hooks.unqueued++; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9085 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9086 |
anim.always(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9087 |
// doing this makes sure that the complete handler will be called |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9088 |
// before this completes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9089 |
anim.always(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9090 |
hooks.unqueued--; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9091 |
if ( !jQuery.queue( elem, "fx" ).length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9092 |
hooks.empty.fire(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9093 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9094 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9095 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9096 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9097 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9098 |
// height/width overflow pass |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9099 |
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9100 |
// Make sure that nothing sneaks out |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9101 |
// Record all 3 overflow attributes because IE does not |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9102 |
// change the overflow attribute when overflowX and |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9103 |
// overflowY are set to the same value |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9104 |
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9105 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9106 |
// Set display property to inline-block for height/width |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9107 |
// animations on inline elements that are having width/height animated |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9108 |
if ( jQuery.css( elem, "display" ) === "inline" && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9109 |
jQuery.css( elem, "float" ) === "none" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9110 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9111 |
// inline-level elements accept inline-block; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9112 |
// block-level elements need to be inline with layout |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9113 |
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9114 |
style.display = "inline-block"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9115 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9116 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9117 |
style.zoom = 1; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9118 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9119 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9120 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9121 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9122 |
if ( opts.overflow ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9123 |
style.overflow = "hidden"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9124 |
if ( !jQuery.support.shrinkWrapBlocks ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9125 |
anim.always(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9126 |
style.overflow = opts.overflow[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9127 |
style.overflowX = opts.overflow[ 1 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9128 |
style.overflowY = opts.overflow[ 2 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9129 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9130 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9131 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9132 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9133 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9134 |
// show/hide pass |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9135 |
for ( prop in props ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9136 |
value = props[ prop ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9137 |
if ( rfxtypes.exec( value ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9138 |
delete props[ prop ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9139 |
toggle = toggle || value === "toggle"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9140 |
if ( value === ( hidden ? "hide" : "show" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9141 |
continue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9142 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9143 |
orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9144 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9145 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9146 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9147 |
if ( !jQuery.isEmptyObject( orig ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9148 |
if ( dataShow ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9149 |
if ( "hidden" in dataShow ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9150 |
hidden = dataShow.hidden; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9151 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9152 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9153 |
dataShow = jQuery._data( elem, "fxshow", {} ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9154 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9155 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9156 |
// store state if its toggle - enables .stop().toggle() to "reverse" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9157 |
if ( toggle ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9158 |
dataShow.hidden = !hidden; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9159 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9160 |
if ( hidden ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9161 |
jQuery( elem ).show(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9162 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9163 |
anim.done(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9164 |
jQuery( elem ).hide(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9165 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9166 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9167 |
anim.done(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9168 |
var prop; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9169 |
jQuery._removeData( elem, "fxshow" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9170 |
for ( prop in orig ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9171 |
jQuery.style( elem, prop, orig[ prop ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9172 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9173 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9174 |
for ( prop in orig ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9175 |
tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9176 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9177 |
if ( !( prop in dataShow ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9178 |
dataShow[ prop ] = tween.start; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9179 |
if ( hidden ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9180 |
tween.end = tween.start; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9181 |
tween.start = prop === "width" || prop === "height" ? 1 : 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9182 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9183 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9184 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9185 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9186 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9187 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9188 |
function Tween( elem, options, prop, end, easing ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9189 |
return new Tween.prototype.init( elem, options, prop, end, easing ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9190 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9191 |
jQuery.Tween = Tween; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9192 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9193 |
Tween.prototype = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9194 |
constructor: Tween, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9195 |
init: function( elem, options, prop, end, easing, unit ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9196 |
this.elem = elem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9197 |
this.prop = prop; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9198 |
this.easing = easing || "swing"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9199 |
this.options = options; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9200 |
this.start = this.now = this.cur(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9201 |
this.end = end; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9202 |
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9203 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9204 |
cur: function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9205 |
var hooks = Tween.propHooks[ this.prop ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9206 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9207 |
return hooks && hooks.get ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9208 |
hooks.get( this ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9209 |
Tween.propHooks._default.get( this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9210 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9211 |
run: function( percent ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9212 |
var eased, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9213 |
hooks = Tween.propHooks[ this.prop ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9214 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9215 |
if ( this.options.duration ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9216 |
this.pos = eased = jQuery.easing[ this.easing ]( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9217 |
percent, this.options.duration * percent, 0, 1, this.options.duration |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9218 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9219 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9220 |
this.pos = eased = percent; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9221 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9222 |
this.now = ( this.end - this.start ) * eased + this.start; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9223 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9224 |
if ( this.options.step ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9225 |
this.options.step.call( this.elem, this.now, this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9226 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9227 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9228 |
if ( hooks && hooks.set ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9229 |
hooks.set( this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9230 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9231 |
Tween.propHooks._default.set( this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9232 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9233 |
return this; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9234 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9235 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9236 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9237 |
Tween.prototype.init.prototype = Tween.prototype; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9238 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9239 |
Tween.propHooks = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9240 |
_default: { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9241 |
get: function( tween ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9242 |
var result; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9243 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9244 |
if ( tween.elem[ tween.prop ] != null && |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9245 |
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9246 |
return tween.elem[ tween.prop ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9247 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9248 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9249 |
// passing an empty string as a 3rd parameter to .css will automatically |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9250 |
// attempt a parseFloat and fallback to a string if the parse fails |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9251 |
// so, simple values such as "10px" are parsed to Float. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9252 |
// complex values such as "rotate(1rad)" are returned as is. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9253 |
result = jQuery.css( tween.elem, tween.prop, "" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9254 |
// Empty strings, null, undefined and "auto" are converted to 0. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9255 |
return !result || result === "auto" ? 0 : result; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9256 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9257 |
set: function( tween ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9258 |
// use step hook for back compat - use cssHook if its there - use .style if its |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9259 |
// available and use plain properties where available |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9260 |
if ( jQuery.fx.step[ tween.prop ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9261 |
jQuery.fx.step[ tween.prop ]( tween ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9262 |
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9263 |
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9264 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9265 |
tween.elem[ tween.prop ] = tween.now; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9266 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9267 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9268 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9269 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9270 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9271 |
// Support: IE <=9 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9272 |
// Panic based approach to setting things on disconnected nodes |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9273 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9274 |
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9275 |
set: function( tween ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9276 |
if ( tween.elem.nodeType && tween.elem.parentNode ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9277 |
tween.elem[ tween.prop ] = tween.now; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9278 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9279 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9280 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9281 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9282 |
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9283 |
var cssFn = jQuery.fn[ name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9284 |
jQuery.fn[ name ] = function( speed, easing, callback ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9285 |
return speed == null || typeof speed === "boolean" ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9286 |
cssFn.apply( this, arguments ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9287 |
this.animate( genFx( name, true ), speed, easing, callback ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9288 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9289 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9290 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9291 |
jQuery.fn.extend({ |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9292 |
fadeTo: function( speed, to, easing, callback ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9293 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9294 |
// show any hidden elements after setting opacity to 0 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9295 |
return this.filter( isHidden ).css( "opacity", 0 ).show() |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9296 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9297 |
// animate to the value specified |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9298 |
.end().animate({ opacity: to }, speed, easing, callback ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9299 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9300 |
animate: function( prop, speed, easing, callback ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9301 |
var empty = jQuery.isEmptyObject( prop ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9302 |
optall = jQuery.speed( speed, easing, callback ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9303 |
doAnimation = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9304 |
// Operate on a copy of prop so per-property easing won't be lost |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9305 |
var anim = Animation( this, jQuery.extend( {}, prop ), optall ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9306 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9307 |
// Empty animations, or finishing resolves immediately |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9308 |
if ( empty || jQuery._data( this, "finish" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9309 |
anim.stop( true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9310 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9311 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9312 |
doAnimation.finish = doAnimation; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9313 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9314 |
return empty || optall.queue === false ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9315 |
this.each( doAnimation ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9316 |
this.queue( optall.queue, doAnimation ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9317 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9318 |
stop: function( type, clearQueue, gotoEnd ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9319 |
var stopQueue = function( hooks ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9320 |
var stop = hooks.stop; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9321 |
delete hooks.stop; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9322 |
stop( gotoEnd ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9323 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9324 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9325 |
if ( typeof type !== "string" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9326 |
gotoEnd = clearQueue; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9327 |
clearQueue = type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9328 |
type = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9329 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9330 |
if ( clearQueue && type !== false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9331 |
this.queue( type || "fx", [] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9332 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9333 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9334 |
return this.each(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9335 |
var dequeue = true, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9336 |
index = type != null && type + "queueHooks", |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9337 |
timers = jQuery.timers, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9338 |
data = jQuery._data( this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9339 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9340 |
if ( index ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9341 |
if ( data[ index ] && data[ index ].stop ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9342 |
stopQueue( data[ index ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9343 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9344 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9345 |
for ( index in data ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9346 |
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9347 |
stopQueue( data[ index ] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9348 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9349 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9350 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9351 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9352 |
for ( index = timers.length; index--; ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9353 |
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9354 |
timers[ index ].anim.stop( gotoEnd ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9355 |
dequeue = false; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9356 |
timers.splice( index, 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9357 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9358 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9359 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9360 |
// start the next in the queue if the last step wasn't forced |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9361 |
// timers currently will call their complete callbacks, which will dequeue |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9362 |
// but only if they were gotoEnd |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9363 |
if ( dequeue || !gotoEnd ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9364 |
jQuery.dequeue( this, type ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9365 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9366 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9367 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9368 |
finish: function( type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9369 |
if ( type !== false ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9370 |
type = type || "fx"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9371 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9372 |
return this.each(function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9373 |
var index, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9374 |
data = jQuery._data( this ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9375 |
queue = data[ type + "queue" ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9376 |
hooks = data[ type + "queueHooks" ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9377 |
timers = jQuery.timers, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9378 |
length = queue ? queue.length : 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9379 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9380 |
// enable finishing flag on private data |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9381 |
data.finish = true; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9382 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9383 |
// empty the queue first |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9384 |
jQuery.queue( this, type, [] ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9385 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9386 |
if ( hooks && hooks.stop ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9387 |
hooks.stop.call( this, true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9388 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9389 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9390 |
// look for any active animations, and finish them |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9391 |
for ( index = timers.length; index--; ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9392 |
if ( timers[ index ].elem === this && timers[ index ].queue === type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9393 |
timers[ index ].anim.stop( true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9394 |
timers.splice( index, 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9395 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9396 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9397 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9398 |
// look for any animations in the old queue and finish them |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9399 |
for ( index = 0; index < length; index++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9400 |
if ( queue[ index ] && queue[ index ].finish ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9401 |
queue[ index ].finish.call( this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9402 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9403 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9404 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9405 |
// turn off finishing flag |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9406 |
delete data.finish; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9407 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9408 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9409 |
}); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9410 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9411 |
// Generate parameters to create a standard animation |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9412 |
function genFx( type, includeWidth ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9413 |
var which, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9414 |
attrs = { height: type }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9415 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9416 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9417 |
// if we include width, step value is 1 to do all cssExpand values, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9418 |
// if we don't include width, step value is 2 to skip over Left and Right |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9419 |
includeWidth = includeWidth? 1 : 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9420 |
for( ; i < 4 ; i += 2 - includeWidth ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9421 |
which = cssExpand[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9422 |
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9423 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9424 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9425 |
if ( includeWidth ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9426 |
attrs.opacity = attrs.width = type; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9427 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9428 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9429 |
return attrs; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9430 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9431 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9432 |
// Generate shortcuts for custom animations |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9433 |
jQuery.each({ |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9434 |
slideDown: genFx("show"), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9435 |
slideUp: genFx("hide"), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9436 |
slideToggle: genFx("toggle"), |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9437 |
fadeIn: { opacity: "show" }, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9438 |
fadeOut: { opacity: "hide" }, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9439 |
fadeToggle: { opacity: "toggle" } |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9440 |
}, function( name, props ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9441 |
jQuery.fn[ name ] = function( speed, easing, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9442 |
return this.animate( props, speed, easing, callback ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9443 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9444 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9445 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9446 |
jQuery.speed = function( speed, easing, fn ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9447 |
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9448 |
complete: fn || !fn && easing || |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9449 |
jQuery.isFunction( speed ) && speed, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9450 |
duration: speed, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9451 |
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9452 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9453 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9454 |
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9455 |
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9456 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9457 |
// normalize opt.queue - true/undefined/null -> "fx" |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9458 |
if ( opt.queue == null || opt.queue === true ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9459 |
opt.queue = "fx"; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9460 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9461 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9462 |
// Queueing |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9463 |
opt.old = opt.complete; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9464 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9465 |
opt.complete = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9466 |
if ( jQuery.isFunction( opt.old ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9467 |
opt.old.call( this ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9468 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9469 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9470 |
if ( opt.queue ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9471 |
jQuery.dequeue( this, opt.queue ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9472 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9473 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9474 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9475 |
return opt; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9476 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9477 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9478 |
jQuery.easing = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9479 |
linear: function( p ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9480 |
return p; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9481 |
}, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9482 |
swing: function( p ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9483 |
return 0.5 - Math.cos( p*Math.PI ) / 2; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9484 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9485 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9486 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9487 |
jQuery.timers = []; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9488 |
jQuery.fx = Tween.prototype.init; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9489 |
jQuery.fx.tick = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9490 |
var timer, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9491 |
timers = jQuery.timers, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9492 |
i = 0; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9493 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9494 |
fxNow = jQuery.now(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9495 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9496 |
for ( ; i < timers.length; i++ ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9497 |
timer = timers[ i ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9498 |
// Checks the timer has not already been removed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9499 |
if ( !timer() && timers[ i ] === timer ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9500 |
timers.splice( i--, 1 ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9501 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9502 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9503 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9504 |
if ( !timers.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9505 |
jQuery.fx.stop(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9506 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9507 |
fxNow = undefined; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9508 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9509 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9510 |
jQuery.fx.timer = function( timer ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9511 |
if ( timer() && jQuery.timers.push( timer ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9512 |
jQuery.fx.start(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9513 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9514 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9515 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9516 |
jQuery.fx.interval = 13; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9517 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9518 |
jQuery.fx.start = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9519 |
if ( !timerId ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9520 |
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9521 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9522 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9523 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9524 |
jQuery.fx.stop = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9525 |
clearInterval( timerId ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9526 |
timerId = null; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9527 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9528 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9529 |
jQuery.fx.speeds = { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9530 |
slow: 600, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9531 |
fast: 200, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9532 |
// Default speed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9533 |
_default: 400 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9534 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9535 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9536 |
// Back Compat <1.8 extension point |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9537 |
jQuery.fx.step = {}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9538 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9539 |
if ( jQuery.expr && jQuery.expr.filters ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9540 |
jQuery.expr.filters.animated = function( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9541 |
return jQuery.grep(jQuery.timers, function( fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9542 |
return elem === fn.elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9543 |
}).length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9544 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9545 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9546 |
jQuery.fn.offset = function( options ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9547 |
if ( arguments.length ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9548 |
return options === undefined ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9549 |
this : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9550 |
this.each(function( i ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9551 |
jQuery.offset.setOffset( this, options, i ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9552 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9553 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9554 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9555 |
var docElem, win, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9556 |
box = { top: 0, left: 0 }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9557 |
elem = this[ 0 ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9558 |
doc = elem && elem.ownerDocument; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9559 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9560 |
if ( !doc ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9561 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9562 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9563 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9564 |
docElem = doc.documentElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9565 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9566 |
// Make sure it's not a disconnected DOM node |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9567 |
if ( !jQuery.contains( docElem, elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9568 |
return box; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9569 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9570 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9571 |
// If we don't have gBCR, just use 0,0 rather than error |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9572 |
// BlackBerry 5, iOS 3 (original iPhone) |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9573 |
if ( typeof elem.getBoundingClientRect !== core_strundefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9574 |
box = elem.getBoundingClientRect(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9575 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9576 |
win = getWindow( doc ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9577 |
return { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9578 |
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9579 |
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9580 |
}; |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9581 |
}; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9582 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9583 |
jQuery.offset = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9584 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9585 |
setOffset: function( elem, options, i ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9586 |
var position = jQuery.css( elem, "position" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9587 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9588 |
// set position first, in-case top/left are set even on static elem |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9589 |
if ( position === "static" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9590 |
elem.style.position = "relative"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9591 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9592 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9593 |
var curElem = jQuery( elem ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9594 |
curOffset = curElem.offset(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9595 |
curCSSTop = jQuery.css( elem, "top" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9596 |
curCSSLeft = jQuery.css( elem, "left" ), |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9597 |
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9598 |
props = {}, curPosition = {}, curTop, curLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9599 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9600 |
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9601 |
if ( calculatePosition ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9602 |
curPosition = curElem.position(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9603 |
curTop = curPosition.top; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9604 |
curLeft = curPosition.left; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9605 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9606 |
curTop = parseFloat( curCSSTop ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9607 |
curLeft = parseFloat( curCSSLeft ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9608 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9609 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9610 |
if ( jQuery.isFunction( options ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9611 |
options = options.call( elem, i, curOffset ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9612 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9613 |
|
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9614 |
if ( options.top != null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9615 |
props.top = ( options.top - curOffset.top ) + curTop; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9616 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9617 |
if ( options.left != null ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9618 |
props.left = ( options.left - curOffset.left ) + curLeft; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9619 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9620 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9621 |
if ( "using" in options ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9622 |
options.using.call( elem, props ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9623 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9624 |
curElem.css( props ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9625 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9626 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9627 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9628 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9629 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9630 |
jQuery.fn.extend({ |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9631 |
|
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9632 |
position: function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9633 |
if ( !this[ 0 ] ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9634 |
return; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9635 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9636 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9637 |
var offsetParent, offset, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9638 |
parentOffset = { top: 0, left: 0 }, |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9639 |
elem = this[ 0 ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9640 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9641 |
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9642 |
if ( jQuery.css( elem, "position" ) === "fixed" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9643 |
// we assume that getBoundingClientRect is available when computed position is fixed |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9644 |
offset = elem.getBoundingClientRect(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9645 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9646 |
// Get *real* offsetParent |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9647 |
offsetParent = this.offsetParent(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9648 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9649 |
// Get correct offsets |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9650 |
offset = this.offset(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9651 |
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9652 |
parentOffset = offsetParent.offset(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9653 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9654 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9655 |
// Add offsetParent borders |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9656 |
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9657 |
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9658 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9659 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9660 |
// Subtract parent offsets and element margins |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9661 |
// note: when an element has margin: auto the offsetLeft and marginLeft |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9662 |
// are the same in Safari causing offset.left to incorrectly be 0 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9663 |
return { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9664 |
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9665 |
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9666 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9667 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9668 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9669 |
offsetParent: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9670 |
return this.map(function() { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9671 |
var offsetParent = this.offsetParent || docElem; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9672 |
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9673 |
offsetParent = offsetParent.offsetParent; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9674 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9675 |
return offsetParent || docElem; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9676 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9677 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9678 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9679 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9680 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9681 |
// Create scrollLeft and scrollTop methods |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9682 |
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9683 |
var top = /Y/.test( prop ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9684 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9685 |
jQuery.fn[ method ] = function( val ) { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9686 |
return jQuery.access( this, function( elem, method, val ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9687 |
var win = getWindow( elem ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9688 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9689 |
if ( val === undefined ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9690 |
return win ? (prop in win) ? win[ prop ] : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9691 |
win.document.documentElement[ method ] : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9692 |
elem[ method ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9693 |
} |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9694 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9695 |
if ( win ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9696 |
win.scrollTo( |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9697 |
!top ? val : jQuery( win ).scrollLeft(), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9698 |
top ? val : jQuery( win ).scrollTop() |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9699 |
); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9700 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9701 |
} else { |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9702 |
elem[ method ] = val; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9703 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9704 |
}, method, val, arguments.length, null ); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9705 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9706 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9707 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9708 |
function getWindow( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9709 |
return jQuery.isWindow( elem ) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9710 |
elem : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9711 |
elem.nodeType === 9 ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9712 |
elem.defaultView || elem.parentWindow : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9713 |
false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9714 |
} |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9715 |
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9716 |
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9717 |
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9718 |
// margin is only for outerHeight, outerWidth |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9719 |
jQuery.fn[ funcName ] = function( margin, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9720 |
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9721 |
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9722 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9723 |
return jQuery.access( this, function( elem, type, value ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9724 |
var doc; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9725 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9726 |
if ( jQuery.isWindow( elem ) ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9727 |
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9728 |
// isn't a whole lot we can do. See pull request at this URL for discussion: |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9729 |
// https://github.com/jquery/jquery/pull/764 |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9730 |
return elem.document.documentElement[ "client" + name ]; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9731 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9732 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9733 |
// Get document width or height |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9734 |
if ( elem.nodeType === 9 ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9735 |
doc = elem.documentElement; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9736 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9737 |
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9738 |
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9739 |
return Math.max( |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9740 |
elem.body[ "scroll" + name ], doc[ "scroll" + name ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9741 |
elem.body[ "offset" + name ], doc[ "offset" + name ], |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9742 |
doc[ "client" + name ] |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9743 |
); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9744 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9745 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9746 |
return value === undefined ? |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9747 |
// Get width or height on the element, requesting but not forcing parseFloat |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9748 |
jQuery.css( elem, type, extra ) : |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9749 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9750 |
// Set width or height on the element |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9751 |
jQuery.style( elem, type, value, extra ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9752 |
}, type, chainable ? margin : undefined, chainable, null ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9753 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9754 |
}); |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9755 |
}); |
9388
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9756 |
// Limit scope pollution from any deprecated API |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9757 |
// (function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9758 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9759 |
// The number of elements contained in the matched element set |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9760 |
jQuery.fn.size = function() { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9761 |
return this.length; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9762 |
}; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9763 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9764 |
jQuery.fn.andSelf = jQuery.fn.addBack; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9765 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9766 |
// })(); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9767 |
if ( typeof module === "object" && module && typeof module.exports === "object" ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9768 |
// Expose jQuery as module.exports in loaders that implement the Node |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9769 |
// module pattern (including browserify). Do not create the global, since |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9770 |
// the user will be storing it themselves locally, and globals are frowned |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9771 |
// upon in the Node module world. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9772 |
module.exports = jQuery; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9773 |
} else { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9774 |
// Otherwise expose jQuery to the global object as usual |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9775 |
window.jQuery = window.$ = jQuery; |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9776 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9777 |
// Register as a named AMD module, since jQuery can be concatenated with other |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9778 |
// files that may use define, but not via a proper concatenation script that |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9779 |
// understands anonymous AMD modules. A named AMD is safest and most robust |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9780 |
// way to register. Lowercase jquery is used because AMD module names are |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9781 |
// derived from file names, and jQuery is normally delivered in a lowercase |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9782 |
// file name. Do this after creating the global so that if an AMD module wants |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9783 |
// to call noConflict to hide this version of jQuery, it will work. |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9784 |
if ( typeof define === "function" && define.amd ) { |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9785 |
define( "jquery", [], function () { return jQuery; } ); |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9786 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9787 |
} |
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9788 |
|
4c34a63bd113
update jquery to 1.10 (closes #2786674)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
7797
diff
changeset
|
9789 |
})( window ); |