author | Rémi Cardona <remi.cardona@logilab.fr> |
Mon, 02 Jun 2014 12:23:18 +0200 | |
branch | stable |
changeset 9869 | e2f96b16c3bd |
parent 7797 | a71618a75b53 |
child 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 |
/*! |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
2 |
* jQuery JavaScript Library v1.6.4 |
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 |
* |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5 |
* Copyright 2011, John Resig |
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
|
6 |
* Dual licensed under the MIT or GPL Version 2 licenses. |
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
|
7 |
* http://jquery.org/license |
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
|
8 |
* |
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
|
9 |
* 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
|
10 |
* http://sizzlejs.com/ |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
11 |
* Copyright 2011, The Dojo Foundation |
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
|
12 |
* Released under the MIT, BSD, and GPL Licenses. |
0 | 13 |
* |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
14 |
* Date: Mon Sep 12 18:54:48 2011 -0400 |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
15 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
16 |
(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
|
17 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
18 |
// Use the correct document accordingly with window argument (sandbox) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
19 |
var document = window.document, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
20 |
navigator = window.navigator, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
21 |
location = window.location; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
22 |
var 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
|
23 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
24 |
// Define a local copy of jQuery |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
25 |
var jQuery = 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
|
26 |
// The jQuery object is actually just the init constructor 'enhanced' |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
27 |
return new jQuery.fn.init( selector, context, rootjQuery ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
28 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
29 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
30 |
// 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
|
31 |
_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
|
32 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
33 |
// 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
|
34 |
_$ = window.$, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
35 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
36 |
// A central reference to the root jQuery(document) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
37 |
rootjQuery, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
38 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
39 |
// A simple way to check for HTML strings or ID strings |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
40 |
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
41 |
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
42 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
43 |
// Check if a string has a non-whitespace character in it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
44 |
rnotwhite = /\S/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
45 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
46 |
// Used for trimming whitespace |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
47 |
trimLeft = /^\s+/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
48 |
trimRight = /\s+$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
49 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
50 |
// Check for digits |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
51 |
rdigit = /\d/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
52 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
53 |
// Match a standalone tag |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
54 |
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
55 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
56 |
// 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
|
57 |
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
|
58 |
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
59 |
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
60 |
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
61 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
62 |
// Useragent RegExp |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
63 |
rwebkit = /(webkit)[ \/]([\w.]+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
64 |
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
65 |
rmsie = /(msie) ([\w.]+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
66 |
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
67 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
68 |
// 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
|
69 |
rdashAlpha = /-([a-z]|[0-9])/ig, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
70 |
rmsPrefix = /^-ms-/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
71 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
72 |
// 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
|
73 |
fcamelCase = function( all, letter ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
74 |
return ( letter + "" ).toUpperCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
75 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
76 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
77 |
// Keep a UserAgent string for use with jQuery.browser |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
78 |
userAgent = navigator.userAgent, |
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 |
// For matching the engine and version of the browser |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
81 |
browserMatch, |
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 |
// The deferred used on DOM ready |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
84 |
readyList, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
85 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
86 |
// The ready event handler |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
87 |
DOMContentLoaded, |
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 |
// Save a reference to some core methods |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
90 |
toString = Object.prototype.toString, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
91 |
hasOwn = Object.prototype.hasOwnProperty, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
92 |
push = Array.prototype.push, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
93 |
slice = Array.prototype.slice, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
94 |
trim = String.prototype.trim, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
95 |
indexOf = Array.prototype.indexOf, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
96 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
97 |
// [[Class]] -> type pairs |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
98 |
class2type = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
99 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
100 |
jQuery.fn = jQuery.prototype = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
101 |
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
|
102 |
init: function( selector, context, rootjQuery ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
103 |
var match, elem, ret, doc; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
104 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
105 |
// Handle $(""), $(null), or $(undefined) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
106 |
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
|
107 |
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
|
108 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
109 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
110 |
// Handle $(DOMElement) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
111 |
if ( selector.nodeType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
112 |
this.context = this[0] = selector; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
113 |
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
|
114 |
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
|
115 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
116 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
117 |
// The body element only exists once, optimize finding it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
118 |
if ( selector === "body" && !context && document.body ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
119 |
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
|
120 |
this[0] = document.body; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
121 |
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
|
122 |
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
|
123 |
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
|
124 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
125 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
126 |
// 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
|
127 |
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
|
128 |
// Are we dealing with HTML string or an ID? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
129 |
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
|
130 |
// 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
|
131 |
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
|
132 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
133 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
134 |
match = quickExpr.exec( selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
135 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
136 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
137 |
// Verify a match, and that no context was specified for #id |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
138 |
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
|
139 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
140 |
// 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
|
141 |
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
|
142 |
context = context instanceof jQuery ? context[0] : context; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
143 |
doc = (context ? context.ownerDocument || 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
|
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 |
// If a single string is passed in and it's a single tag |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
146 |
// just do a createElement and skip the rest |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
147 |
ret = rsingleTag.exec( selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
148 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
149 |
if ( ret ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
150 |
if ( jQuery.isPlainObject( context ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
151 |
selector = [ document.createElement( ret[1] ) ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
152 |
jQuery.fn.attr.call( selector, context, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
153 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
154 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
155 |
selector = [ doc.createElement( ret[1] ) ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
156 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
157 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
158 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
159 |
ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
160 |
selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
161 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
162 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
163 |
return jQuery.merge( this, selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
164 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
165 |
// HANDLE: $("#id") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
166 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
167 |
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
|
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 |
// 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
|
170 |
// 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
|
171 |
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
|
172 |
// 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
|
173 |
// 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
|
174 |
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
|
175 |
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
|
176 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
177 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
178 |
// 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
|
179 |
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
|
180 |
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
|
181 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
182 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
183 |
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
|
184 |
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
|
185 |
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
|
186 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
187 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
188 |
// 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
|
189 |
} else if ( !context || context.jquery ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
190 |
return (context || 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
|
191 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
192 |
// 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
|
193 |
// (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
|
194 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
195 |
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
|
196 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
197 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
198 |
// 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
|
199 |
// 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
|
200 |
} 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
|
201 |
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
|
202 |
} |
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 |
if (selector.selector !== undefined) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
205 |
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
|
206 |
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
|
207 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
208 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
209 |
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
|
210 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
211 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
212 |
// 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
|
213 |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
215 |
// The current version of jQuery being used |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
216 |
jquery: "1.6.4", |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
217 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
218 |
// 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
|
219 |
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
|
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 |
// The number of elements contained in the matched 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
|
222 |
size: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
223 |
return this.length; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
226 |
toArray: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
227 |
return slice.call( 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
|
228 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
229 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
230 |
// 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
|
231 |
// 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
|
232 |
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
|
233 |
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
|
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 |
// 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
|
236 |
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
|
237 |
|
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 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
|
239 |
( 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
|
240 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
241 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
242 |
// 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
|
243 |
// (returning the new matched 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
|
244 |
pushStack: function( elems, name, selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
245 |
// Build a new jQuery matched 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
|
246 |
var ret = this.constructor(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
247 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
248 |
if ( jQuery.isArray( elems ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
249 |
push.apply( ret, elems ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
250 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
251 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
252 |
jQuery.merge( ret, elems ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
255 |
// 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
|
256 |
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
|
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 |
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
|
259 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
260 |
if ( name === "find" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
261 |
ret.selector = this.selector + (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
|
262 |
} else if ( name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
263 |
ret.selector = this.selector + "." + name + "(" + selector + ")"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
264 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
265 |
|
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 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
|
267 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
270 |
// 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
|
271 |
// (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
|
272 |
// 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
|
273 |
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
|
274 |
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
|
275 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
276 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
277 |
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
|
278 |
// Attach the listeners |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
279 |
jQuery.bindReady(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
280 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
281 |
// Add the callback |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
282 |
readyList.done( fn ); |
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 |
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
|
285 |
}, |
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 |
eq: 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
|
288 |
return 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
|
289 |
this.slice( i ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
290 |
this.slice( i, +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
|
291 |
}, |
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 |
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
|
294 |
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
|
295 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
296 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
297 |
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
|
298 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
301 |
slice: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
302 |
return this.pushStack( slice.apply( this, arguments ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
303 |
"slice", slice.call(arguments).join(",") ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
304 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
305 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
306 |
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
|
307 |
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
|
308 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
312 |
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
|
313 |
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
|
314 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
315 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
316 |
// 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
|
317 |
// Behaves like an Array's method, not like a jQuery method. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
318 |
push: push, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
319 |
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
|
320 |
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
|
321 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
322 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
323 |
// 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
|
324 |
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
|
325 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
326 |
jQuery.extend = jQuery.fn.extend = function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
327 |
var options, name, src, copy, copyIsArray, clone, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
328 |
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
|
329 |
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
|
330 |
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
|
331 |
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
|
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 |
// 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
|
334 |
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
|
335 |
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
|
336 |
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
|
337 |
// 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
|
338 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
341 |
// 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
|
342 |
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
|
343 |
target = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
344 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
345 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
346 |
// 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
|
347 |
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
|
348 |
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
|
349 |
--i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
350 |
} |
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 |
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
|
353 |
// 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
|
354 |
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
|
355 |
// 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
|
356 |
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
|
357 |
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
|
358 |
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
|
359 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
360 |
// 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
|
361 |
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
|
362 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
363 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
364 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
365 |
// 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
|
366 |
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
|
367 |
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
|
368 |
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
|
369 |
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
|
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
372 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
375 |
// 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
|
376 |
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
|
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 |
// 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
|
379 |
} 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
|
380 |
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
|
381 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
382 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
383 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
384 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
385 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
386 |
// 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
|
387 |
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
|
388 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
389 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
390 |
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
|
391 |
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
|
392 |
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
|
393 |
window.$ = _$; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
396 |
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
|
397 |
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
|
398 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
399 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
400 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
403 |
// 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
|
404 |
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
|
405 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
406 |
// 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
|
407 |
// 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
|
408 |
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
|
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 |
// 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
|
411 |
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
|
412 |
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
|
413 |
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
|
414 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
415 |
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
|
416 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
419 |
// 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
|
420 |
ready: function( wait ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
421 |
// Either a released hold or an DOMready/load event and not yet ready |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
422 |
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
423 |
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
424 |
if ( !document.body ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
425 |
return setTimeout( jQuery.ready, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
426 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
427 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
428 |
// Remember that 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
|
429 |
jQuery.isReady = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
430 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
431 |
// If a normal DOM Ready event fired, decrement, and wait if need be |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
432 |
if ( wait !== true && --jQuery.readyWait > 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
433 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
434 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
435 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
436 |
// If there are functions bound, to execute |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
437 |
readyList.resolveWith( document, [ jQuery ] ); |
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 |
// Trigger any bound ready events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
440 |
if ( jQuery.fn.trigger ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
441 |
jQuery( document ).trigger( "ready" ).unbind( "ready" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
442 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
443 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
444 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
445 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
446 |
bindReady: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
447 |
if ( readyList ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
448 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
449 |
} |
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 |
readyList = jQuery._Deferred(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
452 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
453 |
// Catch cases where $(document).ready() is called after the |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
454 |
// browser event has already occurred. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
455 |
if ( document.readyState === "complete" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
456 |
// Handle it asynchronously to allow scripts the opportunity to delay ready |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
457 |
return setTimeout( jQuery.ready, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
458 |
} |
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 |
// Mozilla, Opera and webkit nightlies currently support this event |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
461 |
if ( document.addEventListener ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
462 |
// Use the handy event callback |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
463 |
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
464 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
465 |
// A fallback to window.onload, that will always work |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
466 |
window.addEventListener( "load", jQuery.ready, false ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
467 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
468 |
// If IE event model 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
|
469 |
} else if ( document.attachEvent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
470 |
// ensure firing before onload, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
471 |
// maybe late but safe also for iframes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
472 |
document.attachEvent( "onreadystatechange", DOMContentLoaded ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
473 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
474 |
// A fallback to window.onload, that will always work |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
475 |
window.attachEvent( "onload", jQuery.ready ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
476 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
477 |
// If IE and not a frame |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
478 |
// continually check to see if the document 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
|
479 |
var toplevel = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
480 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
481 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
482 |
toplevel = window.frameElement == null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
483 |
} 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
|
484 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
485 |
if ( document.documentElement.doScroll && toplevel ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
486 |
doScrollCheck(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
487 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
488 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
489 |
}, |
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 |
// 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
|
492 |
// 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
|
493 |
// 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
|
494 |
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
|
495 |
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
|
496 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
497 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
498 |
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
|
499 |
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
|
500 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
501 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
502 |
// A crude way of determining if an object is a window |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
503 |
isWindow: 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
|
504 |
return obj && typeof obj === "object" && "setInterval" 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
|
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 |
isNaN: 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
|
508 |
return obj == null || !rdigit.test( obj ) || isNaN( obj ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
509 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
510 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
511 |
type: 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
|
512 |
return obj == null ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
513 |
String( obj ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
514 |
class2type[ toString.call(obj) ] || "object"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
515 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
516 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
517 |
isPlainObject: 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
|
518 |
// 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
|
519 |
// 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
|
520 |
// 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
|
521 |
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
|
522 |
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
|
523 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
524 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
525 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
526 |
// 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
|
527 |
if ( obj.constructor && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
528 |
!hasOwn.call(obj, "constructor") && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
529 |
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
530 |
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
|
531 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
532 |
} 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
|
533 |
// 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
|
534 |
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
|
535 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
536 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
537 |
// 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
|
538 |
// 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
|
539 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
540 |
var key; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
541 |
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
|
542 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
543 |
return key === undefined || hasOwn.call( obj, key ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
544 |
}, |
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 |
isEmptyObject: 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
|
547 |
for ( var name 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
|
548 |
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
|
549 |
} |
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 true; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
553 |
error: function( msg ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
554 |
throw msg; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
555 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
556 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
557 |
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
|
558 |
if ( typeof data !== "string" || !data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
559 |
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
|
560 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
561 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
562 |
// Make sure leading/trailing whitespace is removed (IE can't handle it) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
563 |
data = jQuery.trim( data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
564 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
565 |
// 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
|
566 |
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
|
567 |
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
|
568 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
569 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
570 |
// Make sure the incoming data is actual JSON |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
571 |
// Logic borrowed from http://json.org/json2.js |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
572 |
if ( rvalidchars.test( data.replace( rvalidescape, "@" ) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
573 |
.replace( rvalidtokens, "]" ) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
574 |
.replace( rvalidbraces, "")) ) { |
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 |
return (new Function( "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
|
577 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
578 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
579 |
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
|
580 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
581 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
582 |
// 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
|
583 |
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
|
584 |
var xml, tmp; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
585 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
586 |
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
|
587 |
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
|
588 |
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
|
589 |
} 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
|
590 |
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
|
591 |
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
|
592 |
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
|
593 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
594 |
} 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
|
595 |
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
|
596 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
597 |
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
|
598 |
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
|
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 |
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
|
601 |
}, |
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 |
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
|
604 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
605 |
// 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
|
606 |
// 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
|
607 |
// 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
|
608 |
globalEval: 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
|
609 |
if ( data && rnotwhite.test( data ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
610 |
// 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
|
611 |
// 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
|
612 |
// 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
|
613 |
( 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
|
614 |
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
|
615 |
} )( data ); |
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 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
618 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
619 |
// 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
|
620 |
// 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
|
621 |
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
|
622 |
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
|
623 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
624 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
625 |
nodeName: function( elem, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
626 |
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
627 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
628 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
629 |
// args 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
|
630 |
each: function( object, 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
|
631 |
var name, 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
|
632 |
length = object.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
633 |
isObj = length === undefined || jQuery.isFunction( object ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
634 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
635 |
if ( args ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
636 |
if ( isObj ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
637 |
for ( name in object ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
638 |
if ( callback.apply( object[ name ], args ) === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
639 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
640 |
} |
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
643 |
for ( ; i < length; ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
644 |
if ( callback.apply( object[ i++ ], args ) === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
645 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
646 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
647 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
648 |
} |
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 |
// 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
|
651 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
652 |
if ( isObj ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
653 |
for ( name in object ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
654 |
if ( callback.call( object[ name ], name, object[ name ] ) === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
655 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
656 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
657 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
658 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
659 |
for ( ; i < length; ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
660 |
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
661 |
break; |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
664 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
665 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
666 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
667 |
return object; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
668 |
}, |
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 |
// Use native String.trim function wherever possible |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
671 |
trim: trim ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
672 |
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
|
673 |
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
|
674 |
"" : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
675 |
trim.call( text ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
678 |
// 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
|
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 |
"" : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
682 |
text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); |
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 |
// results 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
|
686 |
makeArray: function( array, results ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
687 |
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
|
688 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
689 |
if ( array != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
690 |
// The window, strings (and functions) also have 'length' |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
691 |
// The extra typeof function check is to prevent crashes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
692 |
// in Safari 2 (See: #3039) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
693 |
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 |
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 type = jQuery.type( array ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
695 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
696 |
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
697 |
push.call( ret, array ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
698 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
699 |
jQuery.merge( ret, array ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
700 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
701 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
702 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
703 |
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
|
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 |
inArray: function( elem, array ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
707 |
if ( !array ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
708 |
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
|
709 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
710 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
711 |
if ( indexOf ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
712 |
return indexOf.call( array, elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
713 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
714 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
715 |
for ( var i = 0, length = array.length; 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
|
716 |
if ( array[ 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
|
717 |
return i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
718 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
719 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
720 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
721 |
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
|
722 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
723 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
724 |
merge: function( first, second ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
725 |
var i = first.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
726 |
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
|
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 |
if ( typeof second.length === "number" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
729 |
for ( var l = second.length; j < l; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
730 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
733 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
734 |
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
|
735 |
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
|
736 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
737 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
738 |
|
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.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
|
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 |
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
|
742 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
743 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
744 |
grep: function( elems, callback, inv ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
745 |
var ret = [], retVal; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
746 |
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
|
747 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
748 |
// 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
|
749 |
// that pass the validator function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
750 |
for ( var i = 0, length = elems.length; 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
|
751 |
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
|
752 |
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
|
753 |
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
|
754 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
755 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
756 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
757 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
760 |
// 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
|
761 |
map: function( elems, callback, arg ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
762 |
var value, key, ret = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
763 |
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
|
764 |
length = elems.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
765 |
// jquery objects are treated as arrays |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
766 |
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; |
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 |
// 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
|
769 |
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
|
770 |
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
|
771 |
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
|
772 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
773 |
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
|
774 |
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
|
775 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
776 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
777 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
778 |
// 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
|
779 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
780 |
for ( key in elems ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
781 |
value = callback( elems[ key ], key, arg ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
782 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
783 |
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
|
784 |
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
|
785 |
} |
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 |
// Flatten any nested arrays |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
790 |
return ret.concat.apply( [], ret ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
791 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
792 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
793 |
// 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
|
794 |
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
|
795 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
796 |
// 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
|
797 |
// arguments. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
798 |
proxy: function( fn, context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
799 |
if ( typeof context === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
800 |
var tmp = fn[ context ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
801 |
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
|
802 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
805 |
// 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
|
806 |
// 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
|
807 |
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
|
808 |
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
|
809 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
810 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
811 |
// Simulated bind |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
812 |
var args = slice.call( arguments, 2 ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
813 |
proxy = function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
814 |
return fn.apply( context, args.concat( slice.call( arguments ) ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
815 |
}; |
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 |
// Set the guid of unique handler to the same of original handler, so it can be removed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
818 |
proxy.guid = fn.guid = fn.guid || proxy.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
|
819 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
820 |
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
|
821 |
}, |
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 |
// Mutifunctional method to get and set values to a collection |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
824 |
// The value/s can optionally be executed if it's a function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
825 |
access: function( elems, key, value, exec, fn, pass ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
826 |
var length = elems.length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
827 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
828 |
// Setting many attributes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
829 |
if ( typeof key === "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
830 |
for ( var k in key ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
831 |
jQuery.access( elems, k, key[k], exec, fn, value ); |
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 elems; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
836 |
// Setting one attribute |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
837 |
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
|
838 |
// Optionally, function values get executed if exec 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
|
839 |
exec = !pass && exec && 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
|
840 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
841 |
for ( var i = 0; 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
|
842 |
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
843 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
844 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
845 |
return elems; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
846 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
847 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
848 |
// Getting an attribute |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
849 |
return length ? fn( elems[0], key ) : undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
850 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
851 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
852 |
now: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
853 |
return (new Date()).getTime(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
854 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
855 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
856 |
// Use of jQuery.browser is frowned upon. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
857 |
// More details: http://docs.jquery.com/Utilities/jQuery.browser |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
858 |
uaMatch: function( ua ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
859 |
ua = ua.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
860 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
861 |
var match = rwebkit.exec( ua ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
862 |
ropera.exec( ua ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
863 |
rmsie.exec( ua ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
864 |
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
865 |
[]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
866 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
867 |
return { browser: match[1] || "", version: match[2] || "0" }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
868 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
869 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
870 |
sub: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
871 |
function jQuerySub( 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
|
872 |
return new jQuerySub.fn.init( 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
|
873 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
874 |
jQuery.extend( true, jQuerySub, this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
875 |
jQuerySub.superclass = this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
876 |
jQuerySub.fn = jQuerySub.prototype = this(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
877 |
jQuerySub.fn.constructor = jQuerySub; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
878 |
jQuerySub.sub = this.sub; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
879 |
jQuerySub.fn.init = function init( 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
|
880 |
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
881 |
context = jQuerySub( context ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
882 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
883 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
884 |
return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
885 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
886 |
jQuerySub.fn.init.prototype = jQuerySub.fn; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
887 |
var rootjQuerySub = jQuerySub(document); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
888 |
return jQuerySub; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
889 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
890 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
891 |
browser: {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
892 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
893 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
894 |
// Populate the class2type map |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
895 |
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
896 |
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
|
897 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
898 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
899 |
browserMatch = jQuery.uaMatch( userAgent ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
900 |
if ( browserMatch.browser ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
901 |
jQuery.browser[ browserMatch.browser ] = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
902 |
jQuery.browser.version = browserMatch.version; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
903 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
904 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
905 |
// Deprecated, use jQuery.browser.webkit instead |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
906 |
if ( jQuery.browser.webkit ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
907 |
jQuery.browser.safari = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
908 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
909 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
910 |
// IE doesn't match non-breaking spaces with \s |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
911 |
if ( rnotwhite.test( "\xA0" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
912 |
trimLeft = /^[\s\xA0]+/; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
913 |
trimRight = /[\s\xA0]+$/; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
914 |
} |
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 |
// 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
|
917 |
rootjQuery = jQuery(document); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
918 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
919 |
// Cleanup functions for the document ready method |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
920 |
if ( document.addEventListener ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
921 |
DOMContentLoaded = function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
922 |
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
923 |
jQuery.ready(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
924 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
925 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
926 |
} else if ( document.attachEvent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
927 |
DOMContentLoaded = function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
928 |
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
929 |
if ( document.readyState === "complete" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
930 |
document.detachEvent( "onreadystatechange", DOMContentLoaded ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
931 |
jQuery.ready(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
932 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
933 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
934 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
935 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
936 |
// The DOM ready check for 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
|
937 |
function doScrollCheck() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
938 |
if ( jQuery.isReady ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
939 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
940 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
941 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
942 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
943 |
// If IE is used, use the trick by Diego Perini |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
944 |
// http://javascript.nwbox.com/IEContentLoaded/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
945 |
document.documentElement.doScroll("left"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
946 |
} 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
|
947 |
setTimeout( doScrollCheck, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
948 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
949 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
950 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
951 |
// and execute any waiting functions |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
952 |
jQuery.ready(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
953 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
954 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
955 |
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
|
956 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
957 |
})(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
958 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
959 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
960 |
var // Promise methods |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
961 |
promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
962 |
// Static reference to slice |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
963 |
sliceDeferred = [].slice; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
964 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
965 |
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
|
966 |
// Create a simple deferred (one callbacks list) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
967 |
_Deferred: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
968 |
var // callbacks list |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
969 |
callbacks = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
970 |
// stored [ context , args ] |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
971 |
fired, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
972 |
// to avoid firing when already doing so |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
973 |
firing, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
974 |
// flag to know if the deferred has been cancelled |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
975 |
cancelled, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
976 |
// the deferred itself |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
977 |
deferred = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
978 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
979 |
// done( f1, f2, ...) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
980 |
done: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
981 |
if ( !cancelled ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
982 |
var args = arguments, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
983 |
i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
984 |
length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
985 |
elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
986 |
type, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
987 |
_fired; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
988 |
if ( fired ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
989 |
_fired = fired; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
990 |
fired = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
991 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
992 |
for ( i = 0, length = args.length; 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
|
993 |
elem = args[ i ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
994 |
type = jQuery.type( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
995 |
if ( type === "array" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
996 |
deferred.done.apply( deferred, elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
997 |
} else if ( type === "function" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
998 |
callbacks.push( elem ); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1001 |
if ( _fired ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1002 |
deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1003 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1004 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1005 |
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
|
1006 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1007 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1008 |
// resolve with given context and args |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1009 |
resolveWith: function( context, args ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1010 |
if ( !cancelled && !fired && !firing ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1011 |
// make sure args are available (#8421) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1012 |
args = args || []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1013 |
firing = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1014 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1015 |
while( callbacks[ 0 ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1016 |
callbacks.shift().apply( context, args ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1017 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1018 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1019 |
finally { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1020 |
fired = [ context, args ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1021 |
firing = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1022 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1023 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1024 |
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
|
1025 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1026 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1027 |
// resolve with this as context and given arguments |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1028 |
resolve: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1029 |
deferred.resolveWith( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1030 |
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
|
1031 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1032 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1033 |
// Has this deferred been resolved? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1034 |
isResolved: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1035 |
return !!( firing || fired ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1036 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1037 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1038 |
// Cancel |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1039 |
cancel: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1040 |
cancelled = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1041 |
callbacks = []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1042 |
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
|
1043 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1044 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1045 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1046 |
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
|
1047 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1048 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1049 |
// Full fledged deferred (two callbacks list) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1050 |
Deferred: function( func ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1051 |
var deferred = jQuery._Deferred(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1052 |
failDeferred = jQuery._Deferred(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1053 |
promise; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1054 |
// Add errorDeferred methods, then and promise |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1055 |
jQuery.extend( deferred, { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1056 |
then: function( doneCallbacks, failCallbacks ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1057 |
deferred.done( doneCallbacks ).fail( failCallbacks ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1058 |
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
|
1059 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1060 |
always: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1061 |
return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1062 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1063 |
fail: failDeferred.done, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1064 |
rejectWith: failDeferred.resolveWith, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1065 |
reject: failDeferred.resolve, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1066 |
isRejected: failDeferred.isResolved, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1067 |
pipe: function( fnDone, fnFail ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1068 |
return jQuery.Deferred(function( newDefer ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1069 |
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
|
1070 |
done: [ fnDone, "resolve" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1071 |
fail: [ fnFail, "reject" ] |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1072 |
}, function( handler, data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1073 |
var fn = data[ 0 ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1074 |
action = data[ 1 ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1075 |
returned; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1076 |
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
|
1077 |
deferred[ handler ](function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1078 |
returned = fn.apply( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1079 |
if ( returned && jQuery.isFunction( returned.promise ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1080 |
returned.promise().then( newDefer.resolve, newDefer.reject ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1081 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1082 |
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1083 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1084 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1085 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1086 |
deferred[ handler ]( newDefer[ action ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1087 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1088 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1089 |
}).promise(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1090 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1091 |
// Get a promise for this deferred |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1092 |
// If obj is provided, the promise aspect is added to 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
|
1093 |
promise: 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
|
1094 |
if ( obj == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1095 |
if ( promise ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1096 |
return promise; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1097 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1098 |
promise = obj = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1099 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1100 |
var i = promiseMethods.length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1101 |
while( i-- ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1102 |
obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1103 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1104 |
return obj; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1105 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1106 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1107 |
// Make sure only one callback list 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
|
1108 |
deferred.done( failDeferred.cancel ).fail( deferred.cancel ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1109 |
// Unexpose cancel |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1110 |
delete deferred.cancel; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1111 |
// 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
|
1112 |
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
|
1113 |
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
|
1114 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1115 |
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
|
1116 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1117 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1118 |
// Deferred helper |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1119 |
when: function( firstParam ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1120 |
var args = arguments, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1121 |
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
|
1122 |
length = args.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1123 |
count = length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1124 |
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1125 |
firstParam : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1126 |
jQuery.Deferred(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1127 |
function resolveFunc( i ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1128 |
return 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
|
1129 |
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1130 |
if ( !( --count ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1131 |
// Strange bug in FF4: |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1132 |
// Values changed onto the arguments object sometimes end up as 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
|
1133 |
// outside the $.when method. Cloning the object into a fresh array solves the issue |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1134 |
deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1135 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1136 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1137 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1138 |
if ( 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
|
1139 |
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
|
1140 |
if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1141 |
args[ i ].promise().then( resolveFunc(i), deferred.reject ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1142 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1143 |
--count; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1144 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1145 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1146 |
if ( !count ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1147 |
deferred.resolveWith( deferred, args ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1148 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1149 |
} else if ( deferred !== firstParam ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1150 |
deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1151 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1152 |
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
|
1153 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1154 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1155 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1156 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1157 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1158 |
jQuery.support = (function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1159 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1160 |
var div = document.createElement( "div" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1161 |
documentElement = document.documentElement, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1162 |
all, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1163 |
a, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1164 |
select, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1165 |
opt, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1166 |
input, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1167 |
marginDiv, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1168 |
support, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1169 |
fragment, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1170 |
body, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1171 |
testElementParent, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1172 |
testElement, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1173 |
testElementStyle, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1174 |
tds, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1175 |
events, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1176 |
eventName, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1177 |
i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1178 |
isSupported; |
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 |
// Preliminary tests |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1181 |
div.setAttribute("className", "t"); |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
1182 |
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1183 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1184 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1185 |
all = div.getElementsByTagName( "*" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1186 |
a = div.getElementsByTagName( "a" )[ 0 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1187 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1188 |
// Can't get basic test support |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1189 |
if ( !all || !all.length || !a ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1190 |
return {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1191 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1192 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1193 |
// First batch of supports tests |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1194 |
select = document.createElement( "select" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1195 |
opt = select.appendChild( document.createElement("option") ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1196 |
input = div.getElementsByTagName( "input" )[ 0 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1197 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1198 |
support = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1199 |
// IE strips leading whitespace when .innerHTML 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
|
1200 |
leadingWhitespace: ( div.firstChild.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
|
1201 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1202 |
// Make sure that tbody elements aren't automatically inserted |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1203 |
// IE will insert them into empty tables |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1204 |
tbody: !div.getElementsByTagName( "tbody" ).length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1205 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1206 |
// Make sure that link elements get serialized correctly by innerHTML |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1207 |
// This requires a wrapper element 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
|
1208 |
htmlSerialize: !!div.getElementsByTagName( "link" ).length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1209 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1210 |
// Get the style information from getAttribute |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1211 |
// (IE uses .cssText instead) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1212 |
style: /top/.test( a.getAttribute("style") ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1213 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1214 |
// Make sure that URLs aren't manipulated |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1215 |
// (IE normalizes it by default) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1216 |
hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1217 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1218 |
// Make sure that element opacity exists |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1219 |
// (IE uses filter instead) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1220 |
// Use a regex to work around a WebKit issue. See #5145 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1221 |
opacity: /^0.55$/.test( a.style.opacity ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1222 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1223 |
// Verify style float existence |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1224 |
// (IE uses styleFloat instead of cssFloat) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1225 |
cssFloat: !!a.style.cssFloat, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1226 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1227 |
// Make sure that if no value is specified for a checkbox |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1228 |
// that it defaults to "on". |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1229 |
// (WebKit defaults to "" instead) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1230 |
checkOn: ( input.value === "on" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1231 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1232 |
// Make sure that a selected-by-default option has a working selected property. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1233 |
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1234 |
optSelected: opt.selected, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1235 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1236 |
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (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
|
1237 |
getSetAttribute: div.className !== "t", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1238 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1239 |
// Will be defined later |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1240 |
submitBubbles: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1241 |
changeBubbles: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1242 |
focusinBubbles: false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1243 |
deleteExpando: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1244 |
noCloneEvent: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1245 |
inlineBlockNeedsLayout: false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1246 |
shrinkWrapBlocks: false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1247 |
reliableMarginRight: true |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1248 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1249 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1250 |
// 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
|
1251 |
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
|
1252 |
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
|
1253 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1254 |
// 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
|
1255 |
// (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
|
1256 |
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
|
1257 |
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
|
1258 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1259 |
// Test to see if it's possible to delete an expando from an element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1260 |
// Fails in 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
|
1261 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1262 |
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
|
1263 |
} 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
|
1264 |
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
|
1265 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1266 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1267 |
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1268 |
div.attachEvent( "onclick", function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1269 |
// Cloning a node shouldn't copy over any |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1270 |
// bound event handlers (IE does this) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1271 |
support.noCloneEvent = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1272 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1273 |
div.cloneNode( true ).fireEvent( "onclick" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1274 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1275 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1276 |
// Check if a radio maintains it's value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1277 |
// after being appended to the DOM |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1278 |
input = document.createElement("input"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1279 |
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
|
1280 |
input.setAttribute("type", "radio"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1281 |
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
|
1282 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1283 |
input.setAttribute("checked", "checked"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1284 |
div.appendChild( input ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1285 |
fragment = document.createDocumentFragment(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1286 |
fragment.appendChild( div.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1287 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1288 |
// WebKit doesn't clone checked state correctly in fragments |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1289 |
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1290 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1291 |
div.innerHTML = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1292 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1293 |
// Figure out if the W3C box model works as expected |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1294 |
div.style.width = div.style.paddingLeft = "1px"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1295 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1296 |
body = document.getElementsByTagName( "body" )[ 0 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1297 |
// We use our own, invisible, body unless the body is already present |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1298 |
// in which case we use a div (#9239) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1299 |
testElement = document.createElement( body ? "div" : "body" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1300 |
testElementStyle = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1301 |
visibility: "hidden", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1302 |
width: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1303 |
height: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1304 |
border: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1305 |
margin: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1306 |
background: "none" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1307 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1308 |
if ( body ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1309 |
jQuery.extend( testElementStyle, { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1310 |
position: "absolute", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1311 |
left: "-1000px", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1312 |
top: "-1000px" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1313 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1314 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1315 |
for ( i in testElementStyle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1316 |
testElement.style[ i ] = testElementStyle[ i ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1317 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1318 |
testElement.appendChild( div ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1319 |
testElementParent = body || documentElement; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1320 |
testElementParent.insertBefore( testElement, testElementParent.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1321 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1322 |
// 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
|
1323 |
// 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
|
1324 |
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
|
1325 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1326 |
support.boxModel = div.offsetWidth === 2; |
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 |
if ( "zoom" in div.style ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1329 |
// Check if natively block-level elements act like inline-block |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1330 |
// elements when setting their display to 'inline' and giving |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1331 |
// them layout |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1332 |
// (IE < 8 does this) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1333 |
div.style.display = "inline"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1334 |
div.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
|
1335 |
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1336 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1337 |
// Check if elements with layout shrink-wrap their children |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1338 |
// (IE 6 does this) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1339 |
div.style.display = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1340 |
div.innerHTML = "<div style='width:4px;'></div>"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1341 |
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1342 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1343 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1344 |
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1345 |
tds = div.getElementsByTagName( "td" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1346 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1347 |
// Check if table cells still have offsetWidth/Height when they are set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1348 |
// to display:none and there are still other visible table cells in a |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1349 |
// table row; if so, offsetWidth/Height are not reliable for use when |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1350 |
// determining if an element has been hidden directly using |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1351 |
// display:none (it is still safe to use offsets if a parent element is |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1352 |
// hidden; don safety goggles and see bug #4512 for more information). |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1353 |
// (only IE 8 fails this test) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1354 |
isSupported = ( tds[ 0 ].offsetHeight === 0 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1355 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1356 |
tds[ 0 ].style.display = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1357 |
tds[ 1 ].style.display = "none"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1358 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1359 |
// Check if empty table cells still have offsetWidth/Height |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1360 |
// (IE < 8 fail this test) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1361 |
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1362 |
div.innerHTML = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1363 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1364 |
// Check if div with explicit width and no margin-right incorrectly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1365 |
// gets computed margin-right based on width of container. For more |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1366 |
// info see bug #3333 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1367 |
// Fails in WebKit before Feb 2011 nightlies |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1368 |
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1369 |
if ( document.defaultView && document.defaultView.getComputedStyle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1370 |
marginDiv = document.createElement( "div" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1371 |
marginDiv.style.width = "0"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1372 |
marginDiv.style.marginRight = "0"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1373 |
div.appendChild( marginDiv ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1374 |
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
|
1375 |
( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1376 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1377 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1378 |
// Remove the body element we added |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1379 |
testElement.innerHTML = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1380 |
testElementParent.removeChild( testElement ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1381 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1382 |
// Technique from Juriy Zaytsev |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1383 |
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1384 |
// We only care about the case where non-standard event systems |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1385 |
// are used, namely in IE. Short-circuiting here helps us to |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1386 |
// avoid an eval call (in setAttribute) which can cause CSP |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1387 |
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1388 |
if ( div.attachEvent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1389 |
for( i in { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1390 |
submit: 1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1391 |
change: 1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1392 |
focusin: 1 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1393 |
} ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1394 |
eventName = "on" + i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1395 |
isSupported = ( eventName in div ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1396 |
if ( !isSupported ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1397 |
div.setAttribute( eventName, "return;" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1398 |
isSupported = ( typeof div[ eventName ] === "function" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1399 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1400 |
support[ i + "Bubbles" ] = isSupported; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1401 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1402 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1403 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1404 |
// Null connected elements to avoid 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
|
1405 |
testElement = fragment = select = opt = body = marginDiv = div = input = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1406 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1407 |
return support; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1408 |
})(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1409 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1410 |
// Keep track of boxModel |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1411 |
jQuery.boxModel = jQuery.support.boxModel; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1412 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1413 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1414 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1415 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1416 |
var rbrace = /^(?:\{.*\}|\[.*\])$/, |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
1417 |
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
|
1418 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1419 |
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
|
1420 |
cache: {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1421 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1422 |
// Please use with caution |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1423 |
uuid: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1424 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1425 |
// Unique for each copy of jQuery on the page |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1426 |
// Non-digits removed to match rinlinejQuery |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1427 |
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1428 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1429 |
// 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
|
1430 |
// 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
|
1431 |
noData: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1432 |
"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
|
1433 |
// Ban all objects except for Flash (which handle expandos) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1434 |
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1435 |
"applet": true |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1436 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1437 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1438 |
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
|
1439 |
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
|
1440 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1441 |
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
|
1442 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1443 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1444 |
data: function( elem, name, data, pvt /* 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
|
1445 |
if ( !jQuery.acceptData( elem ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1446 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1447 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1448 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1449 |
var thisCache, ret, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1450 |
internalKey = 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
|
1451 |
getByName = typeof name === "string", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1452 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1453 |
// We have to handle DOM nodes and JS objects differently because 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
|
1454 |
// can't GC object references properly across the DOM-JS boundary |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1455 |
isNode = elem.nodeType, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1456 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1457 |
// Only DOM nodes need the global jQuery cache; JS object data is |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1458 |
// attached directly to the object so GC can occur automatically |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1459 |
cache = isNode ? jQuery.cache : elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1460 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1461 |
// Only defining an ID for JS objects if its cache already exists allows |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1462 |
// the code to shortcut on the same path as a DOM node with no cache |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1463 |
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && 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
|
1464 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1465 |
// Avoid doing any more work than we need to when trying to get data on an |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1466 |
// object that has no data at all |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1467 |
if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && 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
|
1468 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1469 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1470 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1471 |
if ( !id ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1472 |
// Only DOM nodes need a new unique ID for each element since their data |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1473 |
// ends up in the global cache |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1474 |
if ( isNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1475 |
elem[ jQuery.expando ] = id = ++jQuery.uuid; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1476 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1477 |
id = 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
|
1478 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1479 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1480 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1481 |
if ( !cache[ id ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1482 |
cache[ id ] = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1483 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1484 |
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1485 |
// metadata on plain JS objects when the object is serialized using |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1486 |
// JSON.stringify |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1487 |
if ( !isNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1488 |
cache[ id ].toJSON = 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
|
1489 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1490 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1491 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1492 |
// An object can be passed to jQuery.data instead of a key/value pair; this gets |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1493 |
// shallow copied over onto the existing cache |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1494 |
if ( typeof name === "object" || typeof name === "function" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1495 |
if ( pvt ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1496 |
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1497 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1498 |
cache[ id ] = jQuery.extend(cache[ id ], name); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1499 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1500 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1501 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1502 |
thisCache = cache[ id ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1503 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1504 |
// Internal jQuery data is stored in a separate object inside the object's data |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1505 |
// cache in order to avoid key collisions between internal data and user-defined |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1506 |
// data |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1507 |
if ( pvt ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1508 |
if ( !thisCache[ internalKey ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1509 |
thisCache[ internalKey ] = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1510 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1511 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1512 |
thisCache = thisCache[ internalKey ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1513 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1514 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1515 |
if ( 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
|
1516 |
thisCache[ jQuery.camelCase( name ) ] = data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1517 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1518 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1519 |
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1520 |
// not attempt to inspect the internal events object using jQuery.data, as this |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1521 |
// internal data object is undocumented and subject to change. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1522 |
if ( name === "events" && !thisCache[name] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1523 |
return thisCache[ internalKey ] && thisCache[ internalKey ].events; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1524 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1525 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1526 |
// Check for both converted-to-camel and non-converted data property names |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1527 |
// If a data property was specified |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1528 |
if ( getByName ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1529 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1530 |
// First Try to find as-is property data |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1531 |
ret = thisCache[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1532 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1533 |
// Test for null|undefined property data |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1534 |
if ( ret == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1535 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1536 |
// Try to find the camelCased property |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1537 |
ret = thisCache[ jQuery.camelCase( name ) ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1538 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1539 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1540 |
ret = thisCache; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1541 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1542 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1543 |
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
|
1544 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1545 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1546 |
removeData: function( elem, name, pvt /* 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
|
1547 |
if ( !jQuery.acceptData( elem ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1548 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1549 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1550 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1551 |
var thisCache, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1552 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1553 |
// Reference to internal data cache key |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1554 |
internalKey = 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
|
1555 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1556 |
isNode = elem.nodeType, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1557 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1558 |
// See jQuery.data for more information |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1559 |
cache = isNode ? jQuery.cache : elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1560 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1561 |
// See jQuery.data for more information |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1562 |
id = isNode ? elem[ jQuery.expando ] : 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
|
1563 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1564 |
// If there is already no cache entry for this object, there is no |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1565 |
// purpose in continuing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1566 |
if ( !cache[ id ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1567 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1568 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1569 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1570 |
if ( name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1571 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1572 |
thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1573 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1574 |
if ( thisCache ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1575 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1576 |
// Support interoperable removal of hyphenated or camelcased keys |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1577 |
if ( !thisCache[ name ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1578 |
name = jQuery.camelCase( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1579 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1580 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1581 |
delete thisCache[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1582 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1583 |
// If there is no data left in the cache, we want to continue |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1584 |
// and let the cache object itself get destroyed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1585 |
if ( !isEmptyDataObject(thisCache) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1586 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1587 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1588 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1589 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1590 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1591 |
// See jQuery.data for more information |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1592 |
if ( pvt ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1593 |
delete cache[ id ][ internalKey ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1594 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1595 |
// Don't destroy the parent cache unless the internal data object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1596 |
// had been the only thing left in it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1597 |
if ( !isEmptyDataObject(cache[ id ]) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1598 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1599 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1600 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1601 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1602 |
var internalCache = cache[ id ][ internalKey ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1603 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1604 |
// Browsers that fail expando deletion also refuse to delete expandos on |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1605 |
// the window, but it will allow it on all other JS objects; other browsers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1606 |
// don't care |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1607 |
// Ensure that `cache` is not a window object #10080 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1608 |
if ( jQuery.support.deleteExpando || !cache.setInterval ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1609 |
delete cache[ id ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1610 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1611 |
cache[ id ] = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1612 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1613 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1614 |
// We destroyed the entire user cache at once because it's faster than |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1615 |
// iterating through each key, but we need to continue to persist internal |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1616 |
// data if it existed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1617 |
if ( internalCache ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1618 |
cache[ id ] = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1619 |
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1620 |
// metadata on plain JS objects when the object is serialized using |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1621 |
// JSON.stringify |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1622 |
if ( !isNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1623 |
cache[ id ].toJSON = 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
|
1624 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1625 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1626 |
cache[ id ][ internalKey ] = internalCache; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1627 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1628 |
// Otherwise, we need to eliminate the expando on the node to avoid |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1629 |
// false lookups in the cache for entries that no longer exist |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1630 |
} else if ( isNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1631 |
// IE does not allow us to delete expando properties from nodes, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1632 |
// nor does it have a removeAttribute function on Document nodes; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1633 |
// we must handle all of these cases |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1634 |
if ( jQuery.support.deleteExpando ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1635 |
delete 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
|
1636 |
} else if ( elem.removeAttribute ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1637 |
elem.removeAttribute( 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
|
1638 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1639 |
elem[ jQuery.expando ] = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1640 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1641 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1642 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1643 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1644 |
// 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
|
1645 |
_data: function( elem, name, data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1646 |
return jQuery.data( elem, name, data, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1647 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1648 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1649 |
// 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
|
1650 |
acceptData: 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
|
1651 |
if ( elem.nodeName ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1652 |
var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1653 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1654 |
if ( match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1655 |
return !(match === true || elem.getAttribute("classid") !== match); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1656 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1657 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1658 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1659 |
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
|
1660 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1661 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1662 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1663 |
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
|
1664 |
data: function( key, value ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1665 |
var 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
|
1666 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1667 |
if ( typeof key === "undefined" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1668 |
if ( this.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1669 |
data = jQuery.data( 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
|
1670 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1671 |
if ( this[0].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
|
1672 |
var attr = this[0].attributes, name; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1673 |
for ( var i = 0, l = attr.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1674 |
name = attr[i].name; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1675 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1676 |
if ( name.indexOf( "data-" ) === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1677 |
name = jQuery.camelCase( name.substring(5) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1678 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1679 |
dataAttr( this[0], name, data[ name ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1680 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1681 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1682 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1683 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1684 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1685 |
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
|
1686 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1687 |
} else if ( typeof key === "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1688 |
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
|
1689 |
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
|
1690 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1691 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1692 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1693 |
var parts = key.split("."); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1694 |
parts[1] = parts[1] ? "." + parts[1] : ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1695 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1696 |
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
|
1697 |
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1698 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1699 |
// Try to fetch any internally stored data first |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1700 |
if ( data === undefined && this.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1701 |
data = jQuery.data( this[0], key ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1702 |
data = dataAttr( this[0], 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
|
1703 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1704 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1705 |
return data === undefined && parts[1] ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1706 |
this.data( parts[0] ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1707 |
data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1708 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1709 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1710 |
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
|
1711 |
var $this = 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
|
1712 |
args = [ parts[0], value ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1713 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1714 |
$this.triggerHandler( "setData" + parts[1] + "!", args ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1715 |
jQuery.data( this, key, value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1716 |
$this.triggerHandler( "changeData" + parts[1] + "!", args ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1717 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1718 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1719 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1720 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1721 |
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
|
1722 |
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
|
1723 |
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
|
1724 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1725 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1726 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1727 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1728 |
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
|
1729 |
// 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
|
1730 |
// 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
|
1731 |
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
|
1732 |
|
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
1733 |
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
|
1734 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1735 |
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
|
1736 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1737 |
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
|
1738 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1739 |
data = data === "true" ? true : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1740 |
data === "false" ? false : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1741 |
data === "null" ? null : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1742 |
!jQuery.isNaN( data ) ? parseFloat( data ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1743 |
rbrace.test( data ) ? jQuery.parseJSON( data ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1744 |
data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1745 |
} 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
|
1746 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1747 |
// 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
|
1748 |
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
|
1749 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1750 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1751 |
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
|
1752 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1753 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1754 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1755 |
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
|
1756 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1757 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1758 |
// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1759 |
// property to be considered empty objects; this property always exists in |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1760 |
// order to make sure JSON.stringify does not expose internal metadata |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1761 |
function isEmptyDataObject( obj ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1762 |
for ( var name 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
|
1763 |
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
|
1764 |
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
|
1765 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1766 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1767 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1768 |
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
|
1769 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1770 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1771 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1772 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1773 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1774 |
function handleQueueMarkDefer( elem, 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
|
1775 |
var deferDataKey = type + "defer", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1776 |
queueDataKey = type + "queue", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1777 |
markDataKey = type + "mark", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1778 |
defer = jQuery.data( elem, deferDataKey, undefined, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1779 |
if ( defer && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1780 |
( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1781 |
( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1782 |
// Give room for hard-coded callbacks to fire first |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1783 |
// and eventually mark/queue something else on 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
|
1784 |
setTimeout( function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1785 |
if ( !jQuery.data( elem, queueDataKey, undefined, true ) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1786 |
!jQuery.data( elem, markDataKey, undefined, true ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1787 |
jQuery.removeData( elem, deferDataKey, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1788 |
defer.resolve(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1789 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1790 |
}, 0 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1791 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1792 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1793 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1794 |
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
|
1795 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1796 |
_mark: 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
|
1797 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1798 |
type = (type || "fx") + "mark"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1799 |
jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1800 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1801 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1802 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1803 |
_unmark: function( force, 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
|
1804 |
if ( force !== true ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1805 |
type = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1806 |
elem = force; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1807 |
force = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1808 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1809 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1810 |
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
|
1811 |
var key = type + "mark", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1812 |
count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1813 |
if ( count ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1814 |
jQuery.data( elem, key, count, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1815 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1816 |
jQuery.removeData( elem, key, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1817 |
handleQueueMarkDefer( elem, type, "mark" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1818 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1819 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1820 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1821 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1822 |
queue: function( elem, 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
|
1823 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1824 |
type = (type || "fx") + "queue"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1825 |
var q = jQuery.data( elem, type, undefined, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1826 |
// 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
|
1827 |
if ( data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1828 |
if ( !q || jQuery.isArray(data) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1829 |
q = jQuery.data( elem, type, jQuery.makeArray(data), true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1830 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1831 |
q.push( data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1832 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1833 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1834 |
return q || []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1835 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1836 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1837 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1838 |
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
|
1839 |
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
|
1840 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1841 |
var queue = jQuery.queue( 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
|
1842 |
fn = queue.shift(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1843 |
defer; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1844 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1845 |
// 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
|
1846 |
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
|
1847 |
fn = queue.shift(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1848 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1849 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1850 |
if ( fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1851 |
// 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
|
1852 |
// 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
|
1853 |
if ( 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
|
1854 |
queue.unshift("inprogress"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1855 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1856 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1857 |
fn.call(elem, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1858 |
jQuery.dequeue(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
|
1859 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1860 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1861 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1862 |
if ( !queue.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1863 |
jQuery.removeData( elem, type + "queue", true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1864 |
handleQueueMarkDefer( elem, type, "queue" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1865 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1866 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1867 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1868 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1869 |
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
|
1870 |
queue: 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
|
1871 |
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
|
1872 |
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
|
1873 |
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
|
1874 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1875 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1876 |
if ( 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
|
1877 |
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
|
1878 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1879 |
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
|
1880 |
var queue = jQuery.queue( this, 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
|
1881 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1882 |
if ( type === "fx" && queue[0] !== "inprogress" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1883 |
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
|
1884 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1885 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1886 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1887 |
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
|
1888 |
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
|
1889 |
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
|
1890 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1891 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1892 |
// 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
|
1893 |
// 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
|
1894 |
delay: function( time, type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1895 |
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1896 |
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
|
1897 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1898 |
return this.queue( type, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1899 |
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
|
1900 |
setTimeout(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1901 |
jQuery.dequeue( 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
|
1902 |
}, time ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1903 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1904 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1905 |
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
|
1906 |
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
|
1907 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1908 |
// 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
|
1909 |
// are emptied (fx is the type by default) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1910 |
promise: function( type, object ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1911 |
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
|
1912 |
object = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1913 |
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
|
1914 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1915 |
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
|
1916 |
var defer = jQuery.Deferred(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1917 |
elements = this, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1918 |
i = elements.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1919 |
count = 1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1920 |
deferDataKey = type + "defer", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1921 |
queueDataKey = type + "queue", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1922 |
markDataKey = type + "mark", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1923 |
tmp; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1924 |
function resolve() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1925 |
if ( !( --count ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1926 |
defer.resolveWith( elements, [ elements ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1927 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1928 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1929 |
while( i-- ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1930 |
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1931 |
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1932 |
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1933 |
jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1934 |
count++; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1935 |
tmp.done( resolve ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1936 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1937 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1938 |
resolve(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1939 |
return defer.promise(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1940 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1941 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1942 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1943 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1944 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1945 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1946 |
var rclass = /[\n\t\r]/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1947 |
rspace = /\s+/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1948 |
rreturn = /\r/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1949 |
rtype = /^(?:button|input)$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1950 |
rfocusable = /^(?:button|input|object|select|textarea)$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1951 |
rclickable = /^a(?:rea)?$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1952 |
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1953 |
nodeHook, boolHook; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1954 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1955 |
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
|
1956 |
attr: function( 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
|
1957 |
return jQuery.access( this, name, value, true, jQuery.attr ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1958 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1959 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1960 |
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
|
1961 |
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
|
1962 |
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
|
1963 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1964 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1965 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1966 |
prop: function( 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
|
1967 |
return jQuery.access( this, name, value, true, jQuery.prop ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1968 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1969 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1970 |
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
|
1971 |
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
|
1972 |
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
|
1973 |
// 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
|
1974 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1975 |
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
|
1976 |
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
|
1977 |
} 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
|
1978 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1979 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1980 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1981 |
addClass: 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
|
1982 |
var classNames, i, l, elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1983 |
setClass, c, cl; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1984 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1985 |
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
|
1986 |
return this.each(function( j ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1987 |
jQuery( this ).addClass( value.call(this, j, 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
|
1988 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1989 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1990 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1991 |
if ( value && typeof value === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1992 |
classNames = value.split( rspace ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1993 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1994 |
for ( i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1995 |
elem = 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
|
1996 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
1997 |
if ( elem.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
|
1998 |
if ( !elem.className && classNames.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
|
1999 |
elem.className = value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2000 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2001 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2002 |
setClass = " " + elem.className + " "; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2003 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2004 |
for ( c = 0, cl = classNames.length; c < cl; c++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2005 |
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2006 |
setClass += classNames[ c ] + " "; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2007 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2008 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2009 |
elem.className = jQuery.trim( setClass ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2010 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2011 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2012 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2013 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2014 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2015 |
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
|
2016 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2017 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2018 |
removeClass: 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
|
2019 |
var classNames, i, l, elem, className, c, cl; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2020 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2021 |
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
|
2022 |
return this.each(function( j ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2023 |
jQuery( this ).removeClass( value.call(this, j, 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
|
2024 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2025 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2026 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2027 |
if ( (value && typeof value === "string") || 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
|
2028 |
classNames = (value || "").split( rspace ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2029 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2030 |
for ( i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2031 |
elem = 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
|
2032 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2033 |
if ( elem.nodeType === 1 && elem.className ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2034 |
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
|
2035 |
className = (" " + elem.className + " ").replace( rclass, " " ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2036 |
for ( c = 0, cl = classNames.length; c < cl; c++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2037 |
className = className.replace(" " + classNames[ c ] + " ", " "); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2038 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2039 |
elem.className = jQuery.trim( className ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2040 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2041 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2042 |
elem.className = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2043 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2044 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2045 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2046 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2047 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2048 |
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
|
2049 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2050 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2051 |
toggleClass: function( value, stateVal ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2052 |
var 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
|
2053 |
isBool = typeof stateVal === "boolean"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2054 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2055 |
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
|
2056 |
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
|
2057 |
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
|
2058 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2059 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2060 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2061 |
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
|
2062 |
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
|
2063 |
// 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
|
2064 |
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
|
2065 |
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
|
2066 |
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
|
2067 |
state = stateVal, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2068 |
classNames = value.split( rspace ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2069 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2070 |
while ( (className = classNames[ i++ ]) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2071 |
// check each className given, space seperated list |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2072 |
state = isBool ? state : !self.hasClass( className ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2073 |
self[ state ? "addClass" : "removeClass" ]( className ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2074 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2075 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2076 |
} else if ( type === "undefined" || type === "boolean" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2077 |
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
|
2078 |
// 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
|
2079 |
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
|
2080 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2081 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2082 |
// toggle whole className |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2083 |
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
|
2084 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2085 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2086 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2087 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2088 |
hasClass: function( selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2089 |
var className = " " + selector + " "; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2090 |
for ( var i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2091 |
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2092 |
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
|
2093 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2094 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2095 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2096 |
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
|
2097 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2098 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2099 |
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
|
2100 |
var hooks, ret, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2101 |
elem = 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
|
2102 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2103 |
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
|
2104 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2105 |
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ 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
|
2106 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2107 |
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
|
2108 |
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
|
2109 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2110 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2111 |
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
|
2112 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2113 |
return typeof ret === "string" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2114 |
// handle most common string cases |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2115 |
ret.replace(rreturn, "") : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2116 |
// 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
|
2117 |
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
|
2118 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2119 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2120 |
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
|
2121 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2122 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2123 |
var isFunction = 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
|
2124 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2125 |
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
|
2126 |
var self = jQuery(this), val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2127 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2128 |
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
|
2129 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2130 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2131 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2132 |
if ( isFunction ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2133 |
val = value.call( this, i, self.val() ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2134 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2135 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2138 |
// 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
|
2139 |
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
|
2140 |
val = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2141 |
} 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
|
2142 |
val += ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2143 |
} 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
|
2144 |
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
|
2145 |
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
|
2146 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2147 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2148 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2149 |
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ 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
|
2150 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2151 |
// 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
|
2152 |
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
|
2153 |
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
|
2154 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2155 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2156 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2157 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2158 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2159 |
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
|
2160 |
valHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2161 |
option: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2162 |
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
|
2163 |
// attributes.value is undefined in Blackberry 4.7 but |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2164 |
// uses .value. See #6932 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2165 |
var val = elem.attributes.value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2166 |
return !val || val.specified ? elem.value : elem.text; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2167 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2168 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2169 |
select: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2170 |
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
|
2171 |
var value, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2172 |
index = elem.selectedIndex, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2173 |
values = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2174 |
options = elem.options, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2175 |
one = elem.type === "select-one"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2176 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2177 |
// Nothing was selected |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2178 |
if ( index < 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2179 |
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
|
2180 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2181 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2182 |
// Loop through all the selected options |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2183 |
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2184 |
var option = 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
|
2185 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2186 |
// Don't return options that are disabled or in a disabled optgroup |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2187 |
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2188 |
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2189 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2190 |
// 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
|
2191 |
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
|
2192 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2193 |
// 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
|
2194 |
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
|
2195 |
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
|
2196 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2197 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2198 |
// 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
|
2199 |
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
|
2200 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2201 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2202 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2203 |
// Fixes Bug #2551 -- select.val() broken in IE after form.reset() |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2204 |
if ( one && !values.length && options.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2205 |
return jQuery( options[ index ] ).val(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2206 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2207 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2208 |
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
|
2209 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2210 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2211 |
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
|
2212 |
var values = jQuery.makeArray( value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2213 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2214 |
jQuery(elem).find("option").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
|
2215 |
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2216 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2217 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2218 |
if ( !values.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2219 |
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
|
2220 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2221 |
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
|
2222 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2223 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2224 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2225 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2226 |
attrFn: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2227 |
val: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2228 |
css: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2229 |
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
|
2230 |
text: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2231 |
data: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2232 |
width: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2233 |
height: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2234 |
offset: true |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2235 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2236 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2237 |
attrFix: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2238 |
// Always normalize to ensure hook usage |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2239 |
tabindex: "tabIndex" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2240 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2241 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2242 |
attr: function( elem, name, value, pass ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2243 |
var nType = elem.nodeType; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2244 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2245 |
// 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
|
2246 |
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2247 |
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
|
2248 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2249 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2250 |
if ( pass && name in jQuery.attrFn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2251 |
return jQuery( 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
|
2252 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2253 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2254 |
// Fallback to prop when attributes are not supported |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2255 |
if ( !("getAttribute" in elem) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2256 |
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
|
2257 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2258 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2259 |
var ret, hooks, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2260 |
notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2261 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2262 |
// Normalize the name 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
|
2263 |
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
|
2264 |
name = jQuery.attrFix[ 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
|
2265 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2266 |
hooks = jQuery.attrHooks[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2267 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2268 |
if ( !hooks ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2269 |
// Use boolHook for boolean attributes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2270 |
if ( rboolean.test( name ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2271 |
hooks = boolHook; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2272 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2273 |
// Use nodeHook if available( 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
|
2274 |
} else if ( nodeHook ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2275 |
hooks = nodeHook; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2276 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2277 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2278 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2279 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2280 |
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
|
2281 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2282 |
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
|
2283 |
jQuery.removeAttr( elem, name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2284 |
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
|
2285 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2286 |
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, 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
|
2287 |
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
|
2288 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2289 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2290 |
elem.setAttribute( 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
|
2291 |
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
|
2292 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2293 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2294 |
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2295 |
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
|
2296 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2297 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2298 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2299 |
ret = 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
|
2300 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2301 |
// Non-existent attributes return null, we normalize to undefined |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2302 |
return ret === null ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2303 |
undefined : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2304 |
ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2305 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2306 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2307 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2308 |
removeAttr: function( elem, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2309 |
var propName; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2310 |
if ( elem.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
|
2311 |
name = jQuery.attrFix[ 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
|
2312 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2313 |
jQuery.attr( elem, name, "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2314 |
elem.removeAttribute( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2315 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2316 |
// Set corresponding property to false for boolean attributes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2317 |
if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2318 |
elem[ propName ] = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2319 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2320 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2321 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2322 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2323 |
attrHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2324 |
type: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2325 |
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
|
2326 |
// We can't allow the type property to be changed (since it causes problems 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
|
2327 |
if ( rtype.test( elem.nodeName ) && 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
|
2328 |
jQuery.error( "type property can't be changed" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2329 |
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2330 |
// Setting the type on a radio button after the value resets the value in IE6-9 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2331 |
// Reset value to it's default in case type is set after value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2332 |
// This is for element creation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2333 |
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
|
2334 |
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
|
2335 |
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
|
2336 |
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
|
2337 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2338 |
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
|
2339 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2340 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2341 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2342 |
// Use the value property for back compat |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2343 |
// Use the nodeHook for button elements in IE6/7 (#1954) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2344 |
value: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2345 |
get: function( elem, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2346 |
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2347 |
return nodeHook.get( elem, name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2348 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2349 |
return name in elem ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2350 |
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
|
2351 |
null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2352 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2353 |
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
|
2354 |
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2355 |
return nodeHook.set( 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
|
2356 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2357 |
// Does not return so that setAttribute is also used |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2358 |
elem.value = value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2359 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2360 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2361 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2362 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2363 |
propFix: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2364 |
tabindex: "tabIndex", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2365 |
readonly: "readOnly", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2366 |
"for": "htmlFor", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2367 |
"class": "className", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2368 |
maxlength: "maxLength", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2369 |
cellspacing: "cellSpacing", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2370 |
cellpadding: "cellPadding", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2371 |
rowspan: "rowSpan", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2372 |
colspan: "colSpan", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2373 |
usemap: "useMap", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2374 |
frameborder: "frameBorder", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2375 |
contenteditable: "contentEditable" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2376 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2377 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2378 |
prop: function( 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
|
2379 |
var nType = elem.nodeType; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2380 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2381 |
// 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
|
2382 |
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2383 |
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
|
2384 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2385 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2386 |
var ret, hooks, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2387 |
notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2388 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2389 |
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
|
2390 |
// 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
|
2391 |
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
|
2392 |
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
|
2393 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2394 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2395 |
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
|
2396 |
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, 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
|
2397 |
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
|
2398 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2399 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2400 |
return (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
|
2401 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2402 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2403 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2404 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2405 |
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
|
2406 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2407 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2408 |
return elem[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2409 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2410 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2411 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2412 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2413 |
propHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2414 |
tabIndex: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2415 |
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
|
2416 |
// 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
|
2417 |
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2418 |
var attributeNode = elem.getAttributeNode("tabindex"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2419 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2420 |
return attributeNode && attributeNode.specified ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2421 |
parseInt( attributeNode.value, 10 ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2422 |
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
|
2423 |
0 : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2424 |
undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2425 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2426 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2427 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2428 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2429 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2430 |
// Add the tabindex propHook to attrHooks for back-compat |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2431 |
jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2432 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2433 |
// Hook for boolean attributes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2434 |
boolHook = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2435 |
get: function( elem, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2436 |
// Align boolean attributes with corresponding properties |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2437 |
// Fall back to attribute presence where some booleans are not supported |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2438 |
var attrNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2439 |
return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2440 |
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
|
2441 |
undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2442 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2443 |
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
|
2444 |
var propName; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2445 |
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
|
2446 |
// 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
|
2447 |
jQuery.removeAttr( elem, name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2448 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2449 |
// value is true since we know at this point it's type boolean and not false |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2450 |
// Set boolean attributes to the same name and set the DOM property |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2451 |
propName = 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
|
2452 |
if ( propName in elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2453 |
// Only set the IDL specifically if it already exists on 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
|
2454 |
elem[ propName ] = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2455 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2456 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2457 |
elem.setAttribute( 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
|
2458 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2459 |
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
|
2460 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2461 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2462 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2463 |
// IE6/7 do not support getting/setting some attributes with get/setAttribute |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2464 |
if ( !jQuery.support.getSetAttribute ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2465 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2466 |
// 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
|
2467 |
// This fixes almost every IE6/7 issue |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2468 |
nodeHook = jQuery.valHooks.button = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2469 |
get: function( elem, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2470 |
var ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2471 |
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
|
2472 |
// Return undefined if nodeValue is empty string |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2473 |
return ret && ret.nodeValue !== "" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2474 |
ret.nodeValue : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2475 |
undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2476 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2477 |
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
|
2478 |
// 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
|
2479 |
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
|
2480 |
if ( !ret ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2481 |
ret = document.createAttribute( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2482 |
elem.setAttributeNode( ret ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2483 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2484 |
return (ret.nodeValue = value + ""); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2485 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2486 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2487 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2488 |
// 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
|
2489 |
// 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
|
2490 |
jQuery.each([ "width", "height" ], function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2491 |
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2492 |
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
|
2493 |
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
|
2494 |
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
|
2495 |
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
|
2496 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2497 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2498 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2499 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2500 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2501 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2502 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2503 |
// Some attributes require a special call on IE |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2504 |
if ( !jQuery.support.hrefNormalized ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2505 |
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2506 |
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2507 |
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
|
2508 |
var ret = elem.getAttribute( name, 2 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2509 |
return ret === null ? undefined : ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2510 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2511 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2512 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2513 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2514 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2515 |
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
|
2516 |
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
|
2517 |
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
|
2518 |
// Return undefined in the case of empty string |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2519 |
// Normalize to lowercase since IE uppercases css property names |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2520 |
return elem.style.cssText.toLowerCase() || undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2521 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2522 |
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
|
2523 |
return (elem.style.cssText = "" + value); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2524 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2525 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2526 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2527 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2528 |
// 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
|
2529 |
// 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
|
2530 |
if ( !jQuery.support.optSelected ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2531 |
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2532 |
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
|
2533 |
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
|
2534 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2535 |
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
|
2536 |
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
|
2537 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2538 |
// 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
|
2539 |
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
|
2540 |
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
|
2541 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2542 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2543 |
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
|
2544 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2545 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2546 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2547 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2548 |
// 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
|
2549 |
if ( !jQuery.support.checkOn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2550 |
jQuery.each([ "radio", "checkbox" ], function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2551 |
jQuery.valHooks[ this ] = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2552 |
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
|
2553 |
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2554 |
return elem.getAttribute("value") === null ? "on" : 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
|
2555 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2556 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2557 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2558 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2559 |
jQuery.each([ "radio", "checkbox" ], function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2560 |
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2561 |
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
|
2562 |
if ( jQuery.isArray( value ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2563 |
return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2564 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2565 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2566 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2567 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2568 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2569 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2570 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2571 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2572 |
var rnamespaces = /\.(.*)$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2573 |
rformElems = /^(?:textarea|input|select)$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2574 |
rperiod = /\./g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2575 |
rspaces = / /g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2576 |
rescape = /[^\w\s.|`]/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2577 |
fcleanup = function( nm ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2578 |
return nm.replace(rescape, "\\$&"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2579 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2580 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2581 |
/* |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2582 |
* A number of helper functions used for managing events. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2583 |
* Many of the ideas behind this code originated from |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2584 |
* Dean Edwards' addEvent library. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2585 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2586 |
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
|
2587 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2588 |
// Bind an event to an element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2589 |
// Original by Dean Edwards |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2590 |
add: function( elem, types, handler, data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2591 |
if ( elem.nodeType === 3 || elem.nodeType === 8 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2592 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2593 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2594 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2595 |
if ( handler === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2596 |
handler = returnFalse; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2597 |
} else if ( !handler ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2598 |
// Fixes bug #7229. Fix recommended by jdalton |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2599 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2600 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2601 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2602 |
var handleObjIn, handleObj; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2603 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2604 |
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
|
2605 |
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
|
2606 |
handler = 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
|
2607 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2608 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2609 |
// Make sure that the function being executed has a unique ID |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2610 |
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
|
2611 |
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
|
2612 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2613 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2614 |
// Init the element's event structure |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2615 |
var elemData = jQuery._data( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2616 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2617 |
// If no elemData is found then we must be trying to bind to one of the |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2618 |
// banned noData elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2619 |
if ( !elemData ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2620 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2621 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2622 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2623 |
var events = elemData.events, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2624 |
eventHandle = 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
|
2625 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2626 |
if ( !events ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2627 |
elemData.events = events = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2628 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2629 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2630 |
if ( !eventHandle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2631 |
elemData.handle = eventHandle = function( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2632 |
// 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
|
2633 |
// when an event is called after a page has unloaded |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2634 |
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2635 |
jQuery.event.handle.apply( eventHandle.elem, arguments ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2636 |
undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2637 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2638 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2639 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2640 |
// Add elem as a property of the 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
|
2641 |
// This is to prevent a memory leak with non-native events 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
|
2642 |
eventHandle.elem = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2643 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2644 |
// Handle multiple events separated by a space |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2645 |
// jQuery(...).bind("mouseover mouseout", fn); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2646 |
types = types.split(" "); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2647 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2648 |
var type, i = 0, namespaces; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2649 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2650 |
while ( (type = types[ i++ ]) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2651 |
handleObj = handleObjIn ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2652 |
jQuery.extend({}, handleObjIn) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2653 |
{ handler: handler, data: data }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2654 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2655 |
// Namespaced event handlers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2656 |
if ( type.indexOf(".") > -1 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2657 |
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
|
2658 |
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
|
2659 |
handleObj.namespace = namespaces.slice(0).sort().join("."); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2660 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2661 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2662 |
namespaces = []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2663 |
handleObj.namespace = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2664 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2665 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2666 |
handleObj.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
|
2667 |
if ( !handleObj.guid ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2668 |
handleObj.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
|
2669 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2670 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2671 |
// Get the current list of functions bound to this event |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2672 |
var handlers = 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
|
2673 |
special = jQuery.event.special[ type ] || {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2674 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2675 |
// Init the event handler queue |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2676 |
if ( !handlers ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2677 |
handlers = 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
|
2678 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2679 |
// Check for a special event handler |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2680 |
// Only use addEventListener/attachEvent if the special |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2681 |
// events handler returns false |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2682 |
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
|
2683 |
// 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
|
2684 |
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
|
2685 |
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
|
2686 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2687 |
} 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
|
2688 |
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
|
2689 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2690 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2691 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2692 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2693 |
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
|
2694 |
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
|
2695 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2696 |
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
|
2697 |
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
|
2698 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2699 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2700 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2701 |
// Add the function to the element's handler list |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2702 |
handlers.push( handleObj ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2703 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2704 |
// Keep track of which events have been used, for event optimization |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2705 |
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
|
2706 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2707 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2708 |
// 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
|
2709 |
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
|
2710 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2711 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2712 |
global: {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2713 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2714 |
// Detach an event or set of events from an element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2715 |
remove: function( elem, types, handler, pos ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2716 |
// don't do events 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
|
2717 |
if ( elem.nodeType === 3 || elem.nodeType === 8 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2718 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2719 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2720 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2721 |
if ( handler === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2722 |
handler = returnFalse; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2723 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2724 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2725 |
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2726 |
elemData = jQuery.hasData( elem ) && jQuery._data( elem ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2727 |
events = elemData && elemData.events; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2728 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2729 |
if ( !elemData || !events ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2730 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2731 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2732 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2733 |
// types is actually an event object here |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2734 |
if ( types && types.type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2735 |
handler = types.handler; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2736 |
types = types.type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2737 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2738 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2739 |
// Unbind all events for 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
|
2740 |
if ( !types || typeof types === "string" && types.charAt(0) === "." ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2741 |
types = types || ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2742 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2743 |
for ( type in events ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2744 |
jQuery.event.remove( elem, type + types ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2745 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2746 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2747 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2748 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2749 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2750 |
// Handle multiple events separated by a space |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2751 |
// jQuery(...).unbind("mouseover mouseout", fn); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2752 |
types = types.split(" "); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2753 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2754 |
while ( (type = types[ i++ ]) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2755 |
origType = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2756 |
handleObj = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2757 |
all = 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
|
2758 |
namespaces = []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2759 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2760 |
if ( !all ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2761 |
// Namespaced event handlers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2762 |
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
|
2763 |
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
|
2764 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2765 |
namespace = new RegExp("(^|\\.)" + |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2766 |
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2767 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2768 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2769 |
eventType = 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
|
2770 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2771 |
if ( !eventType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2772 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2773 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2774 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2775 |
if ( !handler ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2776 |
for ( j = 0; j < eventType.length; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2777 |
handleObj = eventType[ j ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2778 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2779 |
if ( all || namespace.test( handleObj.namespace ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2780 |
jQuery.event.remove( elem, origType, handleObj.handler, j ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2781 |
eventType.splice( j--, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2782 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2783 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2784 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2785 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2786 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2787 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2788 |
special = jQuery.event.special[ type ] || {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2789 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2790 |
for ( j = pos || 0; j < eventType.length; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2791 |
handleObj = eventType[ j ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2792 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2793 |
if ( handler.guid === handleObj.guid ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2794 |
// remove the given handler for the given type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2795 |
if ( all || namespace.test( handleObj.namespace ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2796 |
if ( pos == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2797 |
eventType.splice( j--, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2798 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2799 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2800 |
if ( special.remove ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2801 |
special.remove.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
|
2802 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2803 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2804 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2805 |
if ( pos != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2806 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2807 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2808 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2809 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2810 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2811 |
// remove generic event handler if no more handlers exist |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2812 |
if ( eventType.length === 0 || pos != null && eventType.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
|
2813 |
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2814 |
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
|
2815 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2816 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2817 |
ret = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2818 |
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
|
2819 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2820 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2821 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2822 |
// 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
|
2823 |
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
|
2824 |
var handle = 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
|
2825 |
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
|
2826 |
handle.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
|
2827 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2828 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2829 |
delete elemData.events; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2830 |
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
|
2831 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2832 |
if ( jQuery.isEmptyObject( elemData ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2833 |
jQuery.removeData( elem, undefined, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2834 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2835 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2836 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2837 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2838 |
// Events that are safe to short-circuit if no handlers are attached. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2839 |
// Native DOM events should not be added, they may have inline handlers. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2840 |
customEvent: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2841 |
"getData": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2842 |
"setData": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2843 |
"changeData": true |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2844 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2845 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2846 |
trigger: function( event, data, elem, onlyHandlers ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2847 |
// Event object or 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
|
2848 |
var type = event.type || event, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2849 |
namespaces = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2850 |
exclusive; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2851 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2852 |
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
|
2853 |
// Exclusive events trigger only for the exact event (no namespaces) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2854 |
type = type.slice(0, -1); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2855 |
exclusive = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2856 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2857 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2858 |
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
|
2859 |
// 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
|
2860 |
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
|
2861 |
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
|
2862 |
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
|
2863 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2864 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2865 |
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2866 |
// No jQuery handlers for this event type, and it can't have inline handlers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2867 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2868 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2869 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2870 |
// Caller can pass in an Event, Object, or just an event 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
|
2871 |
event = typeof 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
|
2872 |
// jQuery.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
|
2873 |
event[ jQuery.expando ] ? event : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2874 |
// Object literal |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2875 |
new jQuery.Event( type, event ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2876 |
// Just the event 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
|
2877 |
new jQuery.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
|
2878 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2879 |
event.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
|
2880 |
event.exclusive = exclusive; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2881 |
event.namespace = namespaces.join("."); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2882 |
event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2883 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2884 |
// triggerHandler() and global events don't bubble or run the default action |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2885 |
if ( onlyHandlers || !elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2886 |
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
|
2887 |
event.stopPropagation(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2888 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2889 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2890 |
// Handle a global trigger |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2891 |
if ( !elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2892 |
// TODO: Stop taunting the data cache; remove global events and always attach to document |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2893 |
jQuery.each( jQuery.cache, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2894 |
// internalKey variable is just used to make it easier to find |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2895 |
// and potentially change this stuff later; currently it just |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2896 |
// points to 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
|
2897 |
var internalKey = 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
|
2898 |
internalCache = this[ internalKey ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2899 |
if ( internalCache && internalCache.events && internalCache.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
|
2900 |
jQuery.event.trigger( event, data, internalCache.handle.elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2901 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2902 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2903 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2904 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2905 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2906 |
// Don't do events 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
|
2907 |
if ( elem.nodeType === 3 || elem.nodeType === 8 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2908 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2909 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2910 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2911 |
// 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
|
2912 |
event.result = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2913 |
event.target = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2914 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2915 |
// Clone any incoming data and prepend the event, creating the handler arg list |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2916 |
data = data != null ? jQuery.makeArray( data ) : []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2917 |
data.unshift( event ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2918 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2919 |
var cur = elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2920 |
// IE doesn't like method names with a colon (#3533, #8272) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2921 |
ontype = type.indexOf(":") < 0 ? "on" + type : ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2922 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2923 |
// Fire event on the current element, then bubble up the DOM tree |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2924 |
do { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2925 |
var handle = jQuery._data( cur, "handle" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2926 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2927 |
event.currentTarget = cur; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2928 |
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
|
2929 |
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
|
2930 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2931 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2932 |
// Trigger an inline bound script |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2933 |
if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2934 |
event.result = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2935 |
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
|
2936 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2937 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2938 |
// Bubble up to document, then to window |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2939 |
cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2940 |
} while ( cur && !event.isPropagationStopped() ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2941 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2942 |
// If nobody prevented the default action, do it now |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2943 |
if ( !event.isDefaultPrevented() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2944 |
var old, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2945 |
special = jQuery.event.special[ type ] || {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2946 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2947 |
if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2948 |
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2949 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2950 |
// Call a native DOM method on the target with the same name name as the event. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2951 |
// Can't use an .isFunction)() check here because IE6/7 fails that test. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2952 |
// IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2953 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2954 |
if ( ontype && 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
|
2955 |
// Don't re-trigger an onFOO event when we call its FOO() method |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2956 |
old = elem[ ontype ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2957 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2958 |
if ( old ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2959 |
elem[ ontype ] = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2960 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2961 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2962 |
jQuery.event.triggered = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2963 |
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
|
2964 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2965 |
} catch ( ieError ) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2966 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2967 |
if ( old ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2968 |
elem[ ontype ] = old; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2969 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2970 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2971 |
jQuery.event.triggered = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2972 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2973 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2974 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2975 |
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
|
2976 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2977 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2978 |
handle: 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
|
2979 |
event = jQuery.event.fix( event || window.event ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2980 |
// Snapshot the handlers list since a called handler may add/remove events. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2981 |
var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2982 |
run_all = !event.exclusive && !event.namespace, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2983 |
args = Array.prototype.slice.call( 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
|
2984 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2985 |
// Use the fix-ed Event rather than the (read-only) native event |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2986 |
args[0] = event; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2987 |
event.currentTarget = this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2988 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2989 |
for ( var j = 0, l = handlers.length; j < l; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2990 |
var handleObj = handlers[ j ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2991 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2992 |
// Triggered event must 1) be non-exclusive and have no namespace, or |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2993 |
// 2) have namespace(s) a subset or equal to those in the bound event. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2994 |
if ( run_all || event.namespace_re.test( handleObj.namespace ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2995 |
// Pass in a reference to the handler function itself |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2996 |
// So that we can later remove it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2997 |
event.handler = handleObj.handler; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2998 |
event.data = handleObj.data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
2999 |
event.handleObj = handleObj; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3000 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3001 |
var ret = handleObj.handler.apply( this, args ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3002 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3003 |
if ( ret !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3004 |
event.result = ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3005 |
if ( ret === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3006 |
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
|
3007 |
event.stopPropagation(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3008 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3009 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3010 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3011 |
if ( event.isImmediatePropagationStopped() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3012 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3013 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3014 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3015 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3016 |
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
|
3017 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3018 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3019 |
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3020 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3021 |
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
|
3022 |
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
|
3023 |
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
|
3024 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3025 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3026 |
// store a copy of the original 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
|
3027 |
// and "clone" to set read-only properties |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3028 |
var originalEvent = event; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3029 |
event = jQuery.Event( originalEvent ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3030 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3031 |
for ( var i = this.props.length, prop; i; ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3032 |
prop = this.props[ --i ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3033 |
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
|
3034 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3035 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3036 |
// Fix target property, if necessary |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3037 |
if ( !event.target ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3038 |
// Fixes #1925 where srcElement might not be defined either |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3039 |
event.target = event.srcElement || document; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3040 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3041 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3042 |
// check if target is a textnode (safari) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3043 |
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
|
3044 |
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
|
3045 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3046 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3047 |
// Add relatedTarget, if necessary |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3048 |
if ( !event.relatedTarget && event.fromElement ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3049 |
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3050 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3051 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3052 |
// Calculate pageX/Y if missing and clientX/Y available |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3053 |
if ( event.pageX == null && event.clientX != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3054 |
var eventDocument = event.target.ownerDocument || document, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3055 |
doc = eventDocument.documentElement, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3056 |
body = eventDocument.body; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3057 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3058 |
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3059 |
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3060 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3061 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3062 |
// Add which for key events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3063 |
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3064 |
event.which = event.charCode != null ? event.charCode : event.keyCode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3065 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3066 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3067 |
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3068 |
if ( !event.metaKey && event.ctrlKey ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3069 |
event.metaKey = event.ctrlKey; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3070 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3071 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3072 |
// Add which for click: 1 === left; 2 === middle; 3 === right |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3073 |
// Note: button is not normalized, so don't use it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3074 |
if ( !event.which && event.button !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3075 |
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3076 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3077 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3078 |
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
|
3079 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3080 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3081 |
// Deprecated, use jQuery.guid instead |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3082 |
guid: 1E8, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3083 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3084 |
// Deprecated, use jQuery.proxy instead |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3085 |
proxy: jQuery.proxy, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3086 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3087 |
special: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3088 |
ready: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3089 |
// Make sure the ready event is setup |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3090 |
setup: jQuery.bindReady, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3091 |
teardown: 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
|
3092 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3093 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3094 |
live: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3095 |
add: function( handleObj ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3096 |
jQuery.event.add( this, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3097 |
liveConvert( handleObj.origType, handleObj.selector ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3098 |
jQuery.extend({}, handleObj, {handler: liveHandler, guid: 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
|
3099 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3100 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3101 |
remove: function( handleObj ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3102 |
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3103 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3104 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3105 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3106 |
beforeunload: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3107 |
setup: function( data, namespaces, eventHandle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3108 |
// We only want to do this special case on windows |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3109 |
if ( jQuery.isWindow( this ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3110 |
this.onbeforeunload = eventHandle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3111 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3112 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3113 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3114 |
teardown: function( namespaces, eventHandle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3115 |
if ( this.onbeforeunload === eventHandle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3116 |
this.onbeforeunload = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3117 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3118 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3119 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3120 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3121 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3122 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3123 |
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
|
3124 |
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
|
3125 |
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
|
3126 |
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
|
3127 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3128 |
} : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3129 |
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
|
3130 |
if ( elem.detachEvent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3131 |
elem.detachEvent( "on" + 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
|
3132 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3133 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3134 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3135 |
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
|
3136 |
// Allow instantiation without the 'new' keyword |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3137 |
if ( !this.preventDefault ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3138 |
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
|
3139 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3140 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3141 |
// 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
|
3142 |
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
|
3143 |
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
|
3144 |
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
|
3145 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3146 |
// 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
|
3147 |
// by a handler lower down the tree; reflect the correct value. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3148 |
this.isDefaultPrevented = (src.defaultPrevented || src.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
|
3149 |
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3150 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3151 |
// 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
|
3152 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3153 |
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
|
3154 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3155 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3156 |
// 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
|
3157 |
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
|
3158 |
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
|
3159 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3160 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3161 |
// timeStamp is buggy for some events on Firefox(#3843) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3162 |
// So we won't rely on the native value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3163 |
this.timeStamp = 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
|
3164 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3165 |
// 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
|
3166 |
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
|
3167 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3168 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3169 |
function returnFalse() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3170 |
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
|
3171 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3172 |
function returnTrue() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3173 |
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
|
3174 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3175 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3176 |
// 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
|
3177 |
// 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
|
3178 |
jQuery.Event.prototype = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3179 |
preventDefault: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3180 |
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
|
3181 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3182 |
var e = this.originalEvent; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3183 |
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
|
3184 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3185 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3186 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3187 |
// if preventDefault exists run it on the original event |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3188 |
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
|
3189 |
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
|
3190 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3191 |
// otherwise set the returnValue property of the original event to false (IE) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3192 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3193 |
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
|
3194 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3195 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3196 |
stopPropagation: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3197 |
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
|
3198 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3199 |
var e = this.originalEvent; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3200 |
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
|
3201 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3202 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3203 |
// if stopPropagation exists run it on the original event |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3204 |
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
|
3205 |
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
|
3206 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3207 |
// otherwise set the cancelBubble property of the original event to true (IE) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3208 |
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
|
3209 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3210 |
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
|
3211 |
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
|
3212 |
this.stopPropagation(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3213 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3214 |
isDefaultPrevented: returnFalse, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3215 |
isPropagationStopped: returnFalse, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3216 |
isImmediatePropagationStopped: returnFalse |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3217 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3218 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3219 |
// Checks if an event happened on an element within another element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3220 |
// Used in jQuery.event.special.mouseenter and mouseleave handlers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3221 |
var withinElement = 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
|
3222 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3223 |
// Check if mouse(over|out) are still within the same parent element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3224 |
var related = event.relatedTarget, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3225 |
inside = false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3226 |
eventType = 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
|
3227 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3228 |
event.type = event.data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3229 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3230 |
if ( related !== this ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3231 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3232 |
if ( related ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3233 |
inside = jQuery.contains( this, related ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3234 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3235 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3236 |
if ( !inside ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3237 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3238 |
jQuery.event.handle.apply( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3239 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3240 |
event.type = eventType; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3241 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3242 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3243 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3244 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3245 |
// In case of event delegation, we only need to rename the 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
|
3246 |
// liveHandler will take care of the rest. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3247 |
delegate = 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
|
3248 |
event.type = event.data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3249 |
jQuery.event.handle.apply( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3250 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3251 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3252 |
// Create mouseenter and mouseleave events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3253 |
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
|
3254 |
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
|
3255 |
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
|
3256 |
}, 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
|
3257 |
jQuery.event.special[ orig ] = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3258 |
setup: 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
|
3259 |
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3260 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3261 |
teardown: 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
|
3262 |
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3263 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3264 |
}; |
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 |
// submit delegation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3268 |
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
|
3269 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3270 |
jQuery.event.special.submit = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3271 |
setup: function( data, namespaces ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3272 |
if ( !jQuery.nodeName( this, "form" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3273 |
jQuery.event.add(this, "click.specialSubmit", function( e ) { |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
3274 |
// Avoid triggering error on non-existent type attribute in IE VML (#7071) |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3275 |
var elem = e.target, |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
3276 |
type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.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
|
3277 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3278 |
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3279 |
trigger( "submit", this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3280 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3281 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3282 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3283 |
jQuery.event.add(this, "keypress.specialSubmit", function( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3284 |
var elem = e.target, |
7796
8d8bde949535
[jquery] upgrade to jquery 1.6.4
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7781
diff
changeset
|
3285 |
type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.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
|
3286 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3287 |
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3288 |
trigger( "submit", this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3289 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3290 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3291 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3292 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3293 |
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
|
3294 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3295 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3296 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3297 |
teardown: function( namespaces ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3298 |
jQuery.event.remove( this, ".specialSubmit" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3299 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3300 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3301 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3302 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3303 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3304 |
// change delegation, happens here so we have bind. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3305 |
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
|
3306 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3307 |
var changeFilters, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3308 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3309 |
getVal = 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
|
3310 |
var type = jQuery.nodeName( elem, "input" ) ? 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
|
3311 |
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
|
3312 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3313 |
if ( type === "radio" || type === "checkbox" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3314 |
val = elem.checked; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3315 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3316 |
} else if ( type === "select-multiple" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3317 |
val = 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
|
3318 |
jQuery.map( elem.options, 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
|
3319 |
return elem.selected; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3320 |
}).join("-") : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3321 |
""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3322 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3323 |
} else if ( jQuery.nodeName( elem, "select" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3324 |
val = elem.selectedIndex; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3325 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3326 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3327 |
return val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3328 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3329 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3330 |
testChange = function testChange( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3331 |
var elem = e.target, data, val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3332 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3333 |
if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3334 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3335 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3336 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3337 |
data = jQuery._data( elem, "_change_data" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3338 |
val = getVal(elem); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3339 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3340 |
// the current data will be also retrieved by beforeactivate |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3341 |
if ( e.type !== "focusout" || elem.type !== "radio" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3342 |
jQuery._data( elem, "_change_data", val ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3343 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3344 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3345 |
if ( data === undefined || val === data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3346 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3347 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3348 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3349 |
if ( data != null || val ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3350 |
e.type = "change"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3351 |
e.liveFired = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3352 |
jQuery.event.trigger( e, arguments[1], elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3353 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3354 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3355 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3356 |
jQuery.event.special.change = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3357 |
filters: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3358 |
focusout: testChange, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3359 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3360 |
beforedeactivate: testChange, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3361 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3362 |
click: function( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3363 |
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? 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
|
3364 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3365 |
if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3366 |
testChange.call( this, e ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3367 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3368 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3369 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3370 |
// Change has to be called before submit |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3371 |
// Keydown will be called before keypress, which is used in submit-event delegation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3372 |
keydown: function( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3373 |
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? 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
|
3374 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3375 |
if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3376 |
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3377 |
type === "select-multiple" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3378 |
testChange.call( this, e ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3379 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3380 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3381 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3382 |
// Beforeactivate happens also before the previous element is blurred |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3383 |
// with this event you can't trigger a change event, but you can store |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3384 |
// information |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3385 |
beforeactivate: function( e ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3386 |
var elem = e.target; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3387 |
jQuery._data( elem, "_change_data", getVal(elem) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3388 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3389 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3390 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3391 |
setup: function( data, namespaces ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3392 |
if ( this.type === "file" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3393 |
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
|
3394 |
} |
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 |
for ( var type in changeFilters ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3397 |
jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3398 |
} |
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 |
return rformElems.test( this.nodeName ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3401 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3402 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3403 |
teardown: function( namespaces ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3404 |
jQuery.event.remove( this, ".specialChange" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3405 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3406 |
return rformElems.test( this.nodeName ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3407 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3408 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3409 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3410 |
changeFilters = jQuery.event.special.change.filters; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3411 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3412 |
// Handle when the input is .focus()'d |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3413 |
changeFilters.focus = changeFilters.beforeactivate; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3414 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3415 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3416 |
function trigger( type, elem, args ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3417 |
// Piggyback on a donor event to simulate a different one. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3418 |
// Fake originalEvent to avoid donor's stopPropagation, but if the |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3419 |
// simulated event prevents default then we do the same on the donor. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3420 |
// Don't pass args or remember liveFired; they apply to the donor event. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3421 |
var event = jQuery.extend( {}, args[ 0 ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3422 |
event.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
|
3423 |
event.originalEvent = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3424 |
event.liveFired = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3425 |
jQuery.event.handle.call( elem, event ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3426 |
if ( event.isDefaultPrevented() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3427 |
args[ 0 ].preventDefault(); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3430 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3431 |
// 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
|
3432 |
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
|
3433 |
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
|
3434 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3435 |
// Attach a single capturing handler while someone wants focusin/focusout |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3436 |
var 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
|
3437 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3438 |
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
|
3439 |
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
|
3440 |
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
|
3441 |
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
|
3442 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3443 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3444 |
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
|
3445 |
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
|
3446 |
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
|
3447 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3448 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3449 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3450 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3451 |
function handler( donor ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3452 |
// Donor event is always a native one; fix it and switch its type. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3453 |
// Let focusin/out handler cancel the donor focus/blur event. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3454 |
var e = jQuery.event.fix( donor ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3455 |
e.type = fix; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3456 |
e.originalEvent = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3457 |
jQuery.event.trigger( e, null, e.target ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3458 |
if ( e.isDefaultPrevented() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3459 |
donor.preventDefault(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3460 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3461 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3462 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3463 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3464 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3465 |
jQuery.each(["bind", "one"], function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3466 |
jQuery.fn[ name ] = function( type, data, fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3467 |
var handler; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3468 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3469 |
// Handle object literals |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3470 |
if ( typeof type === "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3471 |
for ( var key in type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3472 |
this[ name ](key, data, type[key], fn); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3473 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3474 |
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
|
3475 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3476 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3477 |
if ( arguments.length === 2 || data === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3478 |
fn = data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3479 |
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
|
3480 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3481 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3482 |
if ( name === "one" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3483 |
handler = 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
|
3484 |
jQuery( this ).unbind( event, handler ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3485 |
return fn.apply( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3486 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3487 |
handler.guid = fn.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
|
3488 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3489 |
handler = fn; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3490 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3491 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3492 |
if ( type === "unload" && name !== "one" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3493 |
this.one( type, data, fn ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3494 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3495 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3496 |
for ( var i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3497 |
jQuery.event.add( this[i], type, handler, data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3498 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3499 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3500 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3501 |
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
|
3502 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3503 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3504 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3505 |
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
|
3506 |
unbind: function( type, fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3507 |
// Handle object literals |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3508 |
if ( typeof type === "object" && !type.preventDefault ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3509 |
for ( var key in type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3510 |
this.unbind(key, type[key]); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3511 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3512 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3513 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3514 |
for ( var i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3515 |
jQuery.event.remove( this[i], type, fn ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3516 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3517 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3518 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3519 |
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
|
3520 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3521 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3522 |
delegate: function( selector, types, data, fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3523 |
return this.live( types, data, fn, selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3524 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3525 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3526 |
undelegate: function( selector, types, fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3527 |
if ( arguments.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
|
3528 |
return this.unbind( "live" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3529 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3530 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3531 |
return this.die( types, null, fn, selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3532 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3533 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3534 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3535 |
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
|
3536 |
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
|
3537 |
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
|
3538 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3539 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3540 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3541 |
triggerHandler: 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
|
3542 |
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
|
3543 |
return jQuery.event.trigger( type, data, this[0], true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3544 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3545 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3546 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3547 |
toggle: 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
|
3548 |
// Save reference to arguments for access in closure |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3549 |
var args = arguments, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3550 |
guid = fn.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
|
3551 |
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
|
3552 |
toggler = 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
|
3553 |
// Figure out which function to execute |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3554 |
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3555 |
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3556 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3557 |
// Make sure that clicks stop |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3558 |
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
|
3559 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3560 |
// and execute the function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3561 |
return args[ lastToggle ].apply( this, arguments ) || false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3562 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3563 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3564 |
// link all the functions, so any of them can unbind this click handler |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3565 |
toggler.guid = guid; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3566 |
while ( i < args.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3567 |
args[ i++ ].guid = guid; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3568 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3569 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3570 |
return this.click( toggler ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3571 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3572 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3573 |
hover: function( fnOver, fnOut ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3574 |
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3575 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3576 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3577 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3578 |
var liveMap = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3579 |
focus: "focusin", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3580 |
blur: "focusout", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3581 |
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
|
3582 |
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
|
3583 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3584 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3585 |
jQuery.each(["live", "die"], function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3586 |
jQuery.fn[ name ] = function( types, data, fn, origSelector /* 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
|
3587 |
var type, i = 0, match, namespaces, preType, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3588 |
selector = origSelector || this.selector, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3589 |
context = origSelector ? this : jQuery( 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
|
3590 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3591 |
if ( typeof types === "object" && !types.preventDefault ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3592 |
for ( var key in types ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3593 |
context[ name ]( key, data, types[key], selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3594 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3595 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3596 |
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
|
3597 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3598 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3599 |
if ( name === "die" && !types && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3600 |
origSelector && origSelector.charAt(0) === "." ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3601 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3602 |
context.unbind( origSelector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3603 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3604 |
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
|
3605 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3606 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3607 |
if ( data === false || jQuery.isFunction( data ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3608 |
fn = data || returnFalse; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3609 |
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
|
3610 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3611 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3612 |
types = (types || "").split(" "); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3613 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3614 |
while ( (type = types[ 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
|
3615 |
match = rnamespaces.exec( type ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3616 |
namespaces = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3617 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3618 |
if ( match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3619 |
namespaces = match[0]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3620 |
type = type.replace( rnamespaces, "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3621 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3622 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3623 |
if ( type === "hover" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3624 |
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3625 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3626 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3627 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3628 |
preType = type; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3629 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3630 |
if ( liveMap[ type ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3631 |
types.push( liveMap[ type ] + namespaces ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3632 |
type = type + namespaces; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3633 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3634 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3635 |
type = (liveMap[ type ] || type) + namespaces; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3636 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3637 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3638 |
if ( name === "live" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3639 |
// bind live handler |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3640 |
for ( var j = 0, l = context.length; j < l; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3641 |
jQuery.event.add( context[j], "live." + liveConvert( type, selector ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3642 |
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3643 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3644 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3645 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3646 |
// unbind live handler |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3647 |
context.unbind( "live." + liveConvert( type, selector ), fn ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3648 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3649 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3650 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3651 |
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
|
3652 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3653 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3654 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3655 |
function liveHandler( event ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3656 |
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3657 |
elems = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3658 |
selectors = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3659 |
events = jQuery._data( this, "events" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3660 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3661 |
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3662 |
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3663 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3664 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3665 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3666 |
if ( event.namespace ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3667 |
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3668 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3669 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3670 |
event.liveFired = this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3671 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3672 |
var live = events.live.slice(0); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3673 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3674 |
for ( j = 0; j < live.length; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3675 |
handleObj = live[j]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3676 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3677 |
if ( handleObj.origType.replace( rnamespaces, "" ) === 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
|
3678 |
selectors.push( handleObj.selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3679 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3680 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3681 |
live.splice( j--, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3682 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3683 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3684 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3685 |
match = jQuery( event.target ).closest( selectors, event.currentTarget ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3686 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3687 |
for ( i = 0, l = match.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3688 |
close = match[i]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3689 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3690 |
for ( j = 0; j < live.length; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3691 |
handleObj = live[j]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3692 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3693 |
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3694 |
elem = close.elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3695 |
related = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3696 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3697 |
// Those two events require additional checking |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3698 |
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3699 |
event.type = handleObj.preType; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3700 |
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3701 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3702 |
// Make sure not to accidentally match a child element with the same selector |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3703 |
if ( related && jQuery.contains( elem, related ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3704 |
related = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3705 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3706 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3707 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3708 |
if ( !related || related !== elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3709 |
elems.push({ elem: elem, handleObj: handleObj, level: close.level }); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3710 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3711 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3712 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3713 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3714 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3715 |
for ( i = 0, l = elems.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3716 |
match = 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
|
3717 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3718 |
if ( maxLevel && match.level > maxLevel ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3719 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3720 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3721 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3722 |
event.currentTarget = match.elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3723 |
event.data = match.handleObj.data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3724 |
event.handleObj = match.handleObj; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3725 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3726 |
ret = match.handleObj.origHandler.apply( match.elem, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3727 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3728 |
if ( ret === false || event.isPropagationStopped() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3729 |
maxLevel = match.level; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3730 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3731 |
if ( ret === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3732 |
stop = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3733 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3734 |
if ( event.isImmediatePropagationStopped() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3735 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3736 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3737 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3738 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3739 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3740 |
return stop; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3741 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3742 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3743 |
function liveConvert( type, selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3744 |
return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3745 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3746 |
|
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.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3748 |
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3749 |
"change select submit keydown keypress keyup error").split(" "), function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3750 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3751 |
// Handle event binding |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3752 |
jQuery.fn[ name ] = function( data, fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3753 |
if ( fn == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3754 |
fn = data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3755 |
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
|
3756 |
} |
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 |
return arguments.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
|
3759 |
this.bind( name, data, fn ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3760 |
this.trigger( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3761 |
}; |
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 |
if ( jQuery.attrFn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3764 |
jQuery.attrFn[ name ] = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3765 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3766 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3767 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3768 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3769 |
|
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 |
* Sizzle CSS Selector Engine |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3772 |
* Copyright 2011, The Dojo Foundation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3773 |
* Released under the MIT, BSD, and GPL Licenses. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3774 |
* More information: http://sizzlejs.com/ |
0 | 3775 |
*/ |
7781
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3776 |
(function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3777 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3778 |
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3779 |
done = 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3780 |
toString = Object.prototype.toString, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3781 |
hasDuplicate = false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3782 |
baseHasDuplicate = true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3783 |
rBackslash = /\\/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3784 |
rNonWord = /\W/; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3785 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3786 |
// Here we check if the JavaScript engine is using some sort of |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3787 |
// optimization where it does not always call our comparision |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3788 |
// function. If that is the case, discard the hasDuplicate value. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3789 |
// Thus far that includes Google Chrome. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3790 |
[0, 0].sort(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3791 |
baseHasDuplicate = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3792 |
return 0; |
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 |
var Sizzle = function( selector, context, results, seed ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3796 |
results = results || []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3797 |
context = 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
|
3798 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3799 |
var origContext = context; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3800 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3801 |
if ( context.nodeType !== 1 && context.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
|
3802 |
return []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3803 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3804 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3805 |
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
|
3806 |
return results; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3807 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3808 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3809 |
var m, set, checkSet, extra, ret, cur, pop, i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3810 |
prune = true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3811 |
contextXML = Sizzle.isXML( context ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3812 |
parts = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3813 |
soFar = selector; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3814 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3815 |
// Reset the position of the chunker regexp (start from head) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3816 |
do { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3817 |
chunker.exec( "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3818 |
m = chunker.exec( soFar ); |
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 |
if ( m ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3821 |
soFar = m[3]; |
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 |
parts.push( m[1] ); |
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 |
if ( m[2] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3826 |
extra = m[3]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3827 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3828 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3829 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3830 |
} while ( m ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3831 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3832 |
if ( parts.length > 1 && origPOS.exec( selector ) ) { |
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 |
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3835 |
set = posProcess( parts[0] + parts[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
|
3836 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3837 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3838 |
set = Expr.relative[ parts[0] ] ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3839 |
[ context ] : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3840 |
Sizzle( parts.shift(), context ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3841 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3842 |
while ( parts.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3843 |
selector = parts.shift(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3844 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3845 |
if ( Expr.relative[ selector ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3846 |
selector += parts.shift(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3847 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3848 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3849 |
set = posProcess( selector, set ); |
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3854 |
// Take a shortcut and set the context if the root selector is an ID |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3855 |
// (but not if it'll be faster if the inner selector is an ID) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3856 |
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3857 |
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.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
|
3858 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3859 |
ret = Sizzle.find( parts.shift(), context, contextXML ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3860 |
context = ret.expr ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3861 |
Sizzle.filter( ret.expr, ret.set )[0] : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3862 |
ret.set[0]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3863 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3864 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3865 |
if ( context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3866 |
ret = seed ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3867 |
{ expr: parts.pop(), set: makeArray(seed) } : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3868 |
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3869 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3870 |
set = ret.expr ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3871 |
Sizzle.filter( ret.expr, ret.set ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3872 |
ret.set; |
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 |
if ( parts.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
|
3875 |
checkSet = makeArray( set ); |
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 |
prune = false; |
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 |
while ( parts.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3882 |
cur = parts.pop(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3883 |
pop = cur; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3884 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3885 |
if ( !Expr.relative[ cur ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3886 |
cur = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3887 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3888 |
pop = parts.pop(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3889 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3890 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3891 |
if ( pop == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3892 |
pop = context; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3893 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3894 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3895 |
Expr.relative[ cur ]( checkSet, pop, contextXML ); |
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3899 |
checkSet = parts = []; |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3902 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3903 |
if ( !checkSet ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3904 |
checkSet = set; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3905 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3906 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3907 |
if ( !checkSet ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3908 |
Sizzle.error( cur || selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3909 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3910 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3911 |
if ( toString.call(checkSet) === "[object Array]" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3912 |
if ( !prune ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3913 |
results.push.apply( results, checkSet ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3914 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3915 |
} else if ( context && context.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
|
3916 |
for ( i = 0; checkSet[i] != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3917 |
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3918 |
results.push( set[i] ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3922 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3923 |
for ( i = 0; checkSet[i] != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3924 |
if ( checkSet[i] && checkSet[i].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
|
3925 |
results.push( set[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3926 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3927 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3928 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3929 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3930 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3931 |
makeArray( checkSet, results ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3932 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3933 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3934 |
if ( extra ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3935 |
Sizzle( extra, origContext, results, seed ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3936 |
Sizzle.uniqueSort( results ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3939 |
return results; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3940 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3941 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3942 |
Sizzle.uniqueSort = function( results ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3943 |
if ( sortOrder ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3944 |
hasDuplicate = baseHasDuplicate; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3945 |
results.sort( sortOrder ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3946 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3947 |
if ( hasDuplicate ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3948 |
for ( var i = 1; i < results.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
|
3949 |
if ( results[i] === results[ 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
|
3950 |
results.splice( 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
|
3951 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3952 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3953 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3954 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3955 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3956 |
return results; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3957 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3958 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3959 |
Sizzle.matches = function( expr, set ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3960 |
return Sizzle( expr, null, null, set ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3961 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3962 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3963 |
Sizzle.matchesSelector = function( node, expr ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3964 |
return Sizzle( expr, null, null, [node] ).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
|
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 |
Sizzle.find = function( expr, context, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3968 |
var set; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3969 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3970 |
if ( !expr ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3971 |
return []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3972 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3973 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3974 |
for ( var i = 0, l = Expr.order.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3975 |
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
|
3976 |
type = Expr.order[i]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3977 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3978 |
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3979 |
var left = 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
|
3980 |
match.splice( 1, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3981 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3982 |
if ( left.substr( left.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
|
3983 |
match[1] = (match[1] || "").replace( rBackslash, "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3984 |
set = Expr.find[ type ]( match, context, isXML ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3985 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3986 |
if ( set != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3987 |
expr = expr.replace( Expr.match[ type ], "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3988 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3989 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3990 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3991 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3992 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3993 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3994 |
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
|
3995 |
set = typeof context.getElementsByTagName !== "undefined" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3996 |
context.getElementsByTagName( "*" ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
3997 |
[]; |
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 |
return { set: set, expr: expr }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4001 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4002 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4003 |
Sizzle.filter = function( expr, set, inplace, not ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4004 |
var match, anyFound, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4005 |
old = expr, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4006 |
result = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4007 |
curLoop = set, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4008 |
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4009 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4010 |
while ( expr && set.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4011 |
for ( var type in Expr.filter ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4012 |
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && 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
|
4013 |
var found, item, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4014 |
filter = Expr.filter[ type ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4015 |
left = 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
|
4016 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4017 |
anyFound = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4018 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4019 |
match.splice(1,1); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4020 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4021 |
if ( left.substr( left.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
|
4022 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4023 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4024 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4025 |
if ( curLoop === result ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4026 |
result = []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4027 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4028 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4029 |
if ( Expr.preFilter[ type ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4030 |
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4031 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4032 |
if ( !match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4033 |
anyFound = found = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4034 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4035 |
} else if ( match === true ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4036 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4037 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4038 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4039 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4040 |
if ( match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4041 |
for ( var i = 0; (item = curLoop[i]) != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4042 |
if ( item ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4043 |
found = filter( item, match, i, curLoop ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4044 |
var pass = not ^ !!found; |
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 |
if ( inplace && found != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4047 |
if ( pass ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4048 |
anyFound = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4049 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4050 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4051 |
curLoop[i] = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4052 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4053 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4054 |
} else if ( pass ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4055 |
result.push( item ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4056 |
anyFound = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4057 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4058 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4062 |
if ( found !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4063 |
if ( !inplace ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4064 |
curLoop = result; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4065 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4066 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4067 |
expr = expr.replace( Expr.match[ type ], "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4068 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4069 |
if ( !anyFound ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4070 |
return []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4071 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4072 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4073 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4074 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4075 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4076 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4077 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4078 |
// Improper expression |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4079 |
if ( expr === old ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4080 |
if ( anyFound == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4081 |
Sizzle.error( expr ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4082 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4083 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4084 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4085 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4086 |
} |
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 |
old = expr; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4089 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4090 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4091 |
return curLoop; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4094 |
Sizzle.error = function( msg ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4095 |
throw "Syntax error, unrecognized expression: " + msg; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4096 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4097 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4098 |
var Expr = Sizzle.selectors = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4099 |
order: [ "ID", "NAME", "TAG" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4100 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4101 |
match: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4102 |
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4103 |
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4104 |
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4105 |
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4106 |
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4107 |
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4108 |
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4109 |
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4112 |
leftMatch: {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4113 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4114 |
attrMap: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4115 |
"class": "className", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4116 |
"for": "htmlFor" |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4119 |
attrHandle: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4120 |
href: 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
|
4121 |
return elem.getAttribute( "href" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4122 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4123 |
type: 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
|
4124 |
return elem.getAttribute( "type" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4125 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4128 |
relative: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4129 |
"+": function(checkSet, part){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4130 |
var isPartStr = typeof part === "string", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4131 |
isTag = isPartStr && !rNonWord.test( part ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4132 |
isPartStrNotTag = isPartStr && !isTag; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4133 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4134 |
if ( isTag ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4135 |
part = part.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4136 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4137 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4138 |
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4139 |
if ( (elem = checkSet[i]) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4140 |
while ( (elem = elem.previousSibling) && elem.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
|
4141 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4142 |
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4143 |
elem || false : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4144 |
elem === part; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4145 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4146 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4147 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4148 |
if ( isPartStrNotTag ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4149 |
Sizzle.filter( part, checkSet, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4150 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4151 |
}, |
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 |
">": function( checkSet, part ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4154 |
var elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4155 |
isPartStr = typeof part === "string", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4156 |
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
|
4157 |
l = checkSet.length; |
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 |
if ( isPartStr && !rNonWord.test( part ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4160 |
part = part.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4161 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4162 |
for ( ; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4163 |
elem = checkSet[i]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4164 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4165 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4166 |
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
|
4167 |
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4168 |
} |
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4172 |
for ( ; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4173 |
elem = checkSet[i]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4174 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4175 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4176 |
checkSet[i] = isPartStr ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4177 |
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
|
4178 |
elem.parentNode === part; |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4181 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4182 |
if ( isPartStr ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4183 |
Sizzle.filter( part, checkSet, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4184 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4185 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4186 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4187 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4188 |
"": function(checkSet, part, isXML){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4189 |
var nodeCheck, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4190 |
doneName = done++, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4191 |
checkFn = dirCheck; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4192 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4193 |
if ( typeof part === "string" && !rNonWord.test( part ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4194 |
part = part.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4195 |
nodeCheck = part; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4196 |
checkFn = dirNodeCheck; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4197 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4198 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4199 |
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4200 |
}, |
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 |
"~": function( checkSet, part, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4203 |
var nodeCheck, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4204 |
doneName = done++, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4205 |
checkFn = dirCheck; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4206 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4207 |
if ( typeof part === "string" && !rNonWord.test( part ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4208 |
part = part.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4209 |
nodeCheck = part; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4210 |
checkFn = dirNodeCheck; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4211 |
} |
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 |
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); |
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 |
}, |
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 |
find: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4218 |
ID: function( match, context, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4219 |
if ( typeof context.getElementById !== "undefined" && !isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4220 |
var m = context.getElementById(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
|
4221 |
// 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
|
4222 |
// 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
|
4223 |
return m && m.parentNode ? [m] : []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4224 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4227 |
NAME: function( match, context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4228 |
if ( typeof context.getElementsByName !== "undefined" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4229 |
var ret = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4230 |
results = context.getElementsByName( 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
|
4231 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4232 |
for ( var i = 0, l = results.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4233 |
if ( results[i].getAttribute("name") === 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
|
4234 |
ret.push( results[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4235 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4236 |
} |
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 |
return ret.length === 0 ? 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
|
4239 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4240 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4241 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4242 |
TAG: function( match, context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4243 |
if ( typeof context.getElementsByTagName !== "undefined" ) { |
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 context.getElementsByTagName( 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
|
4245 |
} |
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 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4248 |
preFilter: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4249 |
CLASS: function( match, curLoop, inplace, result, not, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4250 |
match = " " + match[1].replace( rBackslash, "" ) + " "; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4251 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4252 |
if ( isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4253 |
return match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4254 |
} |
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 |
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4257 |
if ( elem ) { |
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 ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4259 |
if ( !inplace ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4260 |
result.push( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4261 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4262 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4263 |
} else if ( inplace ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4264 |
curLoop[i] = false; |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4268 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4269 |
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
|
4270 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4271 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4272 |
ID: function( match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4273 |
return match[1].replace( rBackslash, "" ); |
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 |
TAG: function( match, curLoop ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4277 |
return match[1].replace( rBackslash, "" ).toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4278 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4279 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4280 |
CHILD: function( match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4281 |
if ( match[1] === "nth" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4282 |
if ( !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
|
4283 |
Sizzle.error( match[0] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4284 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4285 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4286 |
match[2] = match[2].replace(/^\+|\s*/g, ''); |
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 |
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4289 |
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4290 |
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4291 |
!/\D/.test( match[2] ) && "0n+" + match[2] || 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
|
4292 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4293 |
// calculate the numbers (first)n+(last) including if they are negative |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4294 |
match[2] = (test[1] + (test[2] || 1)) - 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4295 |
match[3] = test[3] - 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4296 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4297 |
else if ( 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
|
4298 |
Sizzle.error( match[0] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4299 |
} |
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 |
// TODO: Move to normal caching system |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4302 |
match[0] = done++; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4303 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4304 |
return match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4305 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4306 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4307 |
ATTR: function( match, curLoop, inplace, result, not, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4308 |
var name = match[1] = match[1].replace( rBackslash, "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4309 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4310 |
if ( !isXML && Expr.attrMap[name] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4311 |
match[1] = Expr.attrMap[name]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4312 |
} |
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 |
// Handle if an un-quoted value was used |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4315 |
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4316 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4317 |
if ( 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
|
4318 |
match[4] = " " + match[4] + " "; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4319 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4320 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4321 |
return match; |
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 |
PSEUDO: function( match, curLoop, inplace, result, not ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4325 |
if ( match[1] === "not" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4326 |
// If we're dealing with a complex expression, or a simple one |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4327 |
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4328 |
match[3] = Sizzle(match[3], null, null, curLoop); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4329 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4330 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4331 |
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4332 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4333 |
if ( !inplace ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4334 |
result.push.apply( result, ret ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4335 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4336 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4337 |
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
|
4338 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4339 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4340 |
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4341 |
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
|
4342 |
} |
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 match; |
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 |
POS: function( match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4348 |
match.unshift( true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4349 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4350 |
return match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4351 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4352 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4353 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4354 |
filters: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4355 |
enabled: 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
|
4356 |
return elem.disabled === false && elem.type !== "hidden"; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4359 |
disabled: 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
|
4360 |
return elem.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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4363 |
checked: 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
|
4364 |
return elem.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
|
4365 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4366 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4367 |
selected: 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
|
4368 |
// Accessing this property makes selected-by-default |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4369 |
// options in Safari work properly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4370 |
if ( 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
|
4371 |
elem.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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4374 |
return elem.selected === true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4375 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4376 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4377 |
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
|
4378 |
return !!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
|
4379 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4380 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4381 |
empty: 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
|
4382 |
return !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
|
4383 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4384 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4385 |
has: function( elem, i, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4386 |
return !!Sizzle( match[3], elem ).length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4387 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4388 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4389 |
header: 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
|
4390 |
return (/h\d/i).test( elem.nodeName ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4391 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4392 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4393 |
text: 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
|
4394 |
var attr = elem.getAttribute( "type" ), type = 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
|
4395 |
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4396 |
// use getAttribute instead to test this case |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4397 |
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4398 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4399 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4400 |
radio: 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
|
4401 |
return elem.nodeName.toLowerCase() === "input" && "radio" === 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
|
4402 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4403 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4404 |
checkbox: 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
|
4405 |
return elem.nodeName.toLowerCase() === "input" && "checkbox" === 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
|
4406 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4407 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4408 |
file: 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
|
4409 |
return elem.nodeName.toLowerCase() === "input" && "file" === 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
|
4410 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4411 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4412 |
password: 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
|
4413 |
return elem.nodeName.toLowerCase() === "input" && "password" === 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
|
4414 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4415 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4416 |
submit: 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
|
4417 |
var name = elem.nodeName.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4418 |
return (name === "input" || name === "button") && "submit" === 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
|
4419 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4420 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4421 |
image: 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
|
4422 |
return elem.nodeName.toLowerCase() === "input" && "image" === 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
|
4423 |
}, |
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 |
reset: 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
|
4426 |
var name = elem.nodeName.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4427 |
return (name === "input" || name === "button") && "reset" === 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
|
4428 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4429 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4430 |
button: 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
|
4431 |
var name = elem.nodeName.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4432 |
return name === "input" && "button" === elem.type || name === "button"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4433 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4434 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4435 |
input: 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
|
4436 |
return (/input|select|textarea|button/i).test( elem.nodeName ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4437 |
}, |
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 |
focus: 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
|
4440 |
return elem === elem.ownerDocument.activeElement; |
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 |
setFilters: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4444 |
first: 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
|
4445 |
return 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
|
4446 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4447 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4448 |
last: function( elem, i, match, array ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4449 |
return i === array.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
|
4450 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4451 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4452 |
even: 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
|
4453 |
return i % 2 === 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4454 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4455 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4456 |
odd: 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
|
4457 |
return i % 2 === 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4458 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4459 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4460 |
lt: function( elem, i, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4461 |
return i < match[3] - 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4462 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4463 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4464 |
gt: function( elem, i, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4465 |
return i > match[3] - 0; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4468 |
nth: function( elem, i, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4469 |
return match[3] - 0 === i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4470 |
}, |
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 |
eq: function( elem, i, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4473 |
return match[3] - 0 === i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4474 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4475 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4476 |
filter: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4477 |
PSEUDO: function( elem, match, i, array ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4478 |
var name = 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
|
4479 |
filter = Expr.filters[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4480 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4481 |
if ( filter ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4482 |
return filter( elem, i, match, array ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4483 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4484 |
} else if ( name === "contains" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4485 |
return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4486 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4487 |
} else if ( name === "not" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4488 |
var not = match[3]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4489 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4490 |
for ( var j = 0, l = not.length; j < l; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4491 |
if ( not[j] === elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4492 |
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
|
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 |
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
|
4497 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4498 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4499 |
Sizzle.error( 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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4501 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4502 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4503 |
CHILD: function( elem, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4504 |
var type = 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
|
4505 |
node = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4506 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4507 |
switch ( type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4508 |
case "only": |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4509 |
case "first": |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4510 |
while ( (node = node.previousSibling) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4511 |
if ( node.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
|
4512 |
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
|
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4515 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4516 |
if ( type === "first" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4517 |
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
|
4518 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4519 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4520 |
node = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4521 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4522 |
case "last": |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4523 |
while ( (node = node.nextSibling) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4524 |
if ( node.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
|
4525 |
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
|
4526 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4527 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4528 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4529 |
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
|
4530 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4531 |
case "nth": |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4532 |
var first = 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
|
4533 |
last = match[3]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4534 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4535 |
if ( first === 1 && last === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4536 |
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
|
4537 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4538 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4539 |
var doneName = match[0], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4540 |
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
|
4541 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4542 |
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4543 |
var count = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4544 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4545 |
for ( node = parent.firstChild; node; node = node.nextSibling ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4546 |
if ( node.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
|
4547 |
node.nodeIndex = ++count; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4548 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4549 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4550 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4551 |
parent.sizcache = doneName; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4552 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4553 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4554 |
var diff = elem.nodeIndex - last; |
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 |
if ( first === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4557 |
return diff === 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4558 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4559 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4560 |
return ( diff % first === 0 && diff / first >= 0 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4561 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4562 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4563 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4564 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4565 |
ID: function( elem, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4566 |
return elem.nodeType === 1 && elem.getAttribute("id") === match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4567 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4568 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4569 |
TAG: function( elem, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4570 |
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4571 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4572 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4573 |
CLASS: function( elem, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4574 |
return (" " + (elem.className || elem.getAttribute("class")) + " ") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4575 |
.indexOf( 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
|
4576 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4577 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4578 |
ATTR: function( elem, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4579 |
var name = 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
|
4580 |
result = Expr.attrHandle[ name ] ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4581 |
Expr.attrHandle[ name ]( elem ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4582 |
elem[ name ] != null ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4583 |
elem[ name ] : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4584 |
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
|
4585 |
value = result + "", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4586 |
type = 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
|
4587 |
check = match[4]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4588 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4589 |
return result == null ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4590 |
type === "!=" : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4591 |
type === "=" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4592 |
value === check : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4593 |
type === "*=" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4594 |
value.indexOf(check) >= 0 : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4595 |
type === "~=" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4596 |
(" " + value + " ").indexOf(check) >= 0 : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4597 |
!check ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4598 |
value && result !== false : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4599 |
type === "!=" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4600 |
value !== check : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4601 |
type === "^=" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4602 |
value.indexOf(check) === 0 : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4603 |
type === "$=" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4604 |
value.substr(value.length - check.length) === check : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4605 |
type === "|=" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4606 |
value === check || value.substr(0, check.length + 1) === check + "-" : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4607 |
false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4608 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4609 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4610 |
POS: function( elem, match, i, array ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4611 |
var name = 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
|
4612 |
filter = Expr.setFilters[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4613 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4614 |
if ( filter ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4615 |
return filter( elem, i, match, array ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4616 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4617 |
} |
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 |
var origPOS = Expr.match.POS, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4622 |
fescape = function(all, num){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4623 |
return "\\" + (num - 0 + 1); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4624 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4625 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4626 |
for ( var type in Expr.match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4627 |
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4628 |
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4629 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4630 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4631 |
var makeArray = function( array, results ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4632 |
array = Array.prototype.slice.call( array, 0 ); |
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 |
if ( results ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4635 |
results.push.apply( results, array ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4636 |
return results; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4637 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4638 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4639 |
return array; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4640 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4641 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4642 |
// Perform a simple check to determine if the browser is capable of |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4643 |
// converting a NodeList to an array using builtin methods. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4644 |
// Also verifies that the returned array holds DOM nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4645 |
// (which is not the case in the Blackberry browser) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4646 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4647 |
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; |
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 |
// Provide a fallback method if it does not work |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4650 |
} 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
|
4651 |
makeArray = function( array, results ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4652 |
var 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
|
4653 |
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
|
4654 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4655 |
if ( toString.call(array) === "[object Array]" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4656 |
Array.prototype.push.apply( ret, array ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4657 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4658 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4659 |
if ( typeof array.length === "number" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4660 |
for ( var l = array.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4661 |
ret.push( array[i] ); |
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4665 |
for ( ; array[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
|
4666 |
ret.push( array[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4667 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4668 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4669 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4670 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4671 |
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
|
4672 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4673 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4674 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4675 |
var sortOrder, siblingCheck; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4676 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4677 |
if ( document.documentElement.compareDocumentPosition ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4678 |
sortOrder = function( a, b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4679 |
if ( a === b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4680 |
hasDuplicate = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4681 |
return 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4682 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4683 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4684 |
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4685 |
return a.compareDocumentPosition ? -1 : 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4686 |
} |
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 |
return a.compareDocumentPosition(b) & 4 ? -1 : 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4689 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4690 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4691 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4692 |
sortOrder = function( a, b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4693 |
// The nodes are identical, we can exit early |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4694 |
if ( a === b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4695 |
hasDuplicate = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4696 |
return 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4697 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4698 |
// Fallback to using sourceIndex (in IE) if it's available on both nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4699 |
} else if ( a.sourceIndex && b.sourceIndex ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4700 |
return a.sourceIndex - b.sourceIndex; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4701 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4702 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4703 |
var al, bl, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4704 |
ap = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4705 |
bp = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4706 |
aup = a.parentNode, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4707 |
bup = b.parentNode, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4708 |
cur = aup; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4709 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4710 |
// If the nodes are siblings (or identical) we can do a quick check |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4711 |
if ( aup === bup ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4712 |
return siblingCheck( a, b ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4713 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4714 |
// If no parents were found then the nodes are disconnected |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4715 |
} else if ( !aup ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4716 |
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
|
4717 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4718 |
} else if ( !bup ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4719 |
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
|
4720 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4721 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4722 |
// Otherwise they're somewhere else in the tree so we need |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4723 |
// to build up a full list of the parentNodes for comparison |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4724 |
while ( cur ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4725 |
ap.unshift( cur ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4726 |
cur = cur.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4727 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4728 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4729 |
cur = bup; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4730 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4731 |
while ( cur ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4732 |
bp.unshift( cur ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4733 |
cur = cur.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4734 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4735 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4736 |
al = ap.length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4737 |
bl = bp.length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4738 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4739 |
// Start walking down the tree looking for a discrepancy |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4740 |
for ( var i = 0; i < al && i < bl; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4741 |
if ( ap[i] !== bp[i] ) { |
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 siblingCheck( ap[i], bp[i] ); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4745 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4746 |
// We ended someplace up the tree so do a sibling check |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4747 |
return i === al ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4748 |
siblingCheck( a, bp[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
|
4749 |
siblingCheck( ap[i], b, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4750 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4751 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4752 |
siblingCheck = function( a, b, ret ) { |
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 ( a === b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4754 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4757 |
var cur = a.nextSibling; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4758 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4759 |
while ( cur ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4760 |
if ( cur === b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4761 |
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
|
4762 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4763 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4764 |
cur = cur.nextSibling; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4765 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4766 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4767 |
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
|
4768 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4769 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4770 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4771 |
// Utility function for retreiving the text value of an array of DOM nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4772 |
Sizzle.getText = function( elems ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4773 |
var ret = "", elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4774 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4775 |
for ( var i = 0; 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
|
4776 |
elem = 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
|
4777 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4778 |
// Get the text from text nodes and CDATA nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4779 |
if ( elem.nodeType === 3 || elem.nodeType === 4 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4780 |
ret += elem.nodeValue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4781 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4782 |
// Traverse everything else, except 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
|
4783 |
} else if ( elem.nodeType !== 8 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4784 |
ret += Sizzle.getText( elem.childNodes ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4785 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4786 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4787 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4788 |
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
|
4789 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4790 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4791 |
// Check to see if the browser returns elements by name when |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4792 |
// querying by getElementById (and provide a workaround) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4793 |
(function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4794 |
// We're going to inject a fake input element with a specified name |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4795 |
var form = document.createElement("div"), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4796 |
id = "script" + (new Date()).getTime(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4797 |
root = document.documentElement; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4798 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4799 |
form.innerHTML = "<a name='" + id + "'/>"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4800 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4801 |
// Inject it into the root element, check its status, and remove it quickly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4802 |
root.insertBefore( form, root.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4803 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4804 |
// The workaround has to do additional checks after a getElementById |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4805 |
// Which slows things down for other browsers (hence the branching) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4806 |
if ( document.getElementById( id ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4807 |
Expr.find.ID = function( match, context, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4808 |
if ( typeof context.getElementById !== "undefined" && !isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4809 |
var m = context.getElementById(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
|
4810 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4811 |
return m ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4812 |
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === 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
|
4813 |
[m] : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4814 |
undefined : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4815 |
[]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4816 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4819 |
Expr.filter.ID = function( elem, match ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4820 |
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); |
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 |
return elem.nodeType === 1 && node && node.nodeValue === match; |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4825 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4826 |
root.removeChild( form ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4827 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4828 |
// release memory 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
|
4829 |
root = form = null; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4832 |
(function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4833 |
// Check to see if the browser returns only elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4834 |
// when doing getElementsByTagName("*") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4835 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4836 |
// Create a fake element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4837 |
var div = document.createElement("div"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4838 |
div.appendChild( document.createComment("") ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4839 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4840 |
// Make sure no comments are found |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4841 |
if ( div.getElementsByTagName("*").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
|
4842 |
Expr.find.TAG = function( match, context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4843 |
var results = context.getElementsByTagName( 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
|
4844 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4845 |
// Filter out possible comments |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4846 |
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
|
4847 |
var tmp = []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4848 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4849 |
for ( var i = 0; results[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
|
4850 |
if ( results[i].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
|
4851 |
tmp.push( results[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4852 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4853 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4854 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4855 |
results = tmp; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4856 |
} |
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 |
return results; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4859 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4860 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4861 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4862 |
// Check to see if an attribute returns normalized href attributes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4863 |
div.innerHTML = "<a href='#'></a>"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4864 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4865 |
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4866 |
div.firstChild.getAttribute("href") !== "#" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4867 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4868 |
Expr.attrHandle.href = 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
|
4869 |
return elem.getAttribute( "href", 2 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4870 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4871 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4872 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4873 |
// release memory 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
|
4874 |
div = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4875 |
})(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4876 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4877 |
if ( document.querySelectorAll ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4878 |
(function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4879 |
var oldSizzle = Sizzle, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4880 |
div = document.createElement("div"), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4881 |
id = "__sizzle__"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4882 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4883 |
div.innerHTML = "<p class='TEST'></p>"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4884 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4885 |
// Safari can't handle uppercase or unicode characters when |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4886 |
// in quirks mode. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4887 |
if ( div.querySelectorAll && div.querySelectorAll(".TEST").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
|
4888 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4889 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4890 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4891 |
Sizzle = function( query, context, extra, seed ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4892 |
context = 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
|
4893 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4894 |
// Only use querySelectorAll on non-XML documents |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4895 |
// (ID selectors don't work in non-HTML documents) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4896 |
if ( !seed && !Sizzle.isXML(context) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4897 |
// See if we find a selector 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
|
4898 |
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4899 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4900 |
if ( match && (context.nodeType === 1 || context.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
|
4901 |
// Speed-up: Sizzle("TAG") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4902 |
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
|
4903 |
return makeArray( context.getElementsByTagName( query ), extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4904 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4905 |
// Speed-up: Sizzle(".CLASS") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4906 |
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4907 |
return makeArray( context.getElementsByClassName( match[2] ), extra ); |
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 |
if ( context.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
|
4912 |
// Speed-up: Sizzle("body") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4913 |
// The body element only exists once, optimize finding it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4914 |
if ( query === "body" && context.body ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4915 |
return makeArray( [ context.body ], extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4916 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4917 |
// Speed-up: Sizzle("#ID") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4918 |
} else if ( match && match[3] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4919 |
var elem = context.getElementById( match[3] ); |
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 |
// 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
|
4922 |
// 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
|
4923 |
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
|
4924 |
// 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
|
4925 |
// 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
|
4926 |
if ( elem.id === match[3] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4927 |
return makeArray( [ elem ], extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4928 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4929 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4930 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4931 |
return makeArray( [], extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4932 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4933 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4934 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4935 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4936 |
return makeArray( context.querySelectorAll(query), extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4937 |
} catch(qsaError) {} |
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 |
// qSA works strangely on Element-rooted queries |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4940 |
// We can work around this by specifying an extra ID on the root |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4941 |
// and working up from there (Thanks to Andrew Dupont for the technique) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4942 |
// IE 8 doesn't work on object elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4943 |
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4944 |
var oldContext = context, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4945 |
old = context.getAttribute( "id" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4946 |
nid = old || id, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4947 |
hasParent = context.parentNode, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4948 |
relativeHierarchySelector = /^\s*[+~]/.test( query ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4949 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4950 |
if ( !old ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4951 |
context.setAttribute( "id", nid ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4952 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4953 |
nid = nid.replace( /'/g, "\\$&" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4954 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4955 |
if ( relativeHierarchySelector && hasParent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4956 |
context = context.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4957 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4958 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4959 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4960 |
if ( !relativeHierarchySelector || hasParent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4961 |
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4962 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4963 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4964 |
} catch(pseudoError) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4965 |
} finally { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4966 |
if ( !old ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4967 |
oldContext.removeAttribute( "id" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4968 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4969 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4970 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4971 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4972 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4973 |
return oldSizzle(query, context, extra, seed); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4974 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4975 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4976 |
for ( var prop in oldSizzle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4977 |
Sizzle[ prop ] = oldSizzle[ prop ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4978 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4979 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4980 |
// release memory 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
|
4981 |
div = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4982 |
})(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4983 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4984 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4985 |
(function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4986 |
var html = document.documentElement, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4987 |
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4988 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4989 |
if ( matches ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4990 |
// Check to see if it's possible to do matchesSelector |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4991 |
// on a disconnected node (IE 9 fails this) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4992 |
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4993 |
pseudoWorks = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4994 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4995 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4996 |
// This should fail with an exception |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4997 |
// Gecko does not error, returns false instead |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4998 |
matches.call( document.documentElement, "[test!='']:sizzle" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
4999 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5000 |
} catch( pseudoError ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5001 |
pseudoWorks = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5002 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5003 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5004 |
Sizzle.matchesSelector = function( node, expr ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5005 |
// Make sure that attribute selectors are quoted |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5006 |
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5007 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5008 |
if ( !Sizzle.isXML( node ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5009 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5010 |
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5011 |
var ret = matches.call( node, expr ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5012 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5013 |
// IE 9's matchesSelector returns false on disconnected nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5014 |
if ( ret || !disconnectedMatch || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5015 |
// As well, disconnected nodes are said to be in a document |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5016 |
// fragment in IE 9, so check for that |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5017 |
node.document && node.document.nodeType !== 11 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5018 |
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
|
5019 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5020 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5021 |
} 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
|
5022 |
} |
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 |
return Sizzle(expr, null, null, [node]).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
|
5025 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5026 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5027 |
})(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5028 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5029 |
(function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5030 |
var div = document.createElement("div"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5031 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5032 |
div.innerHTML = "<div class='test e'></div><div class='test'></div>"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5033 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5034 |
// Opera can't find a second classname (in 9.6) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5035 |
// Also, make sure that getElementsByClassName actually exists |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5036 |
if ( !div.getElementsByClassName || div.getElementsByClassName("e").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
|
5037 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5038 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5039 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5040 |
// Safari caches class attributes, doesn't catch changes (in 3.2) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5041 |
div.lastChild.className = "e"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5042 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5043 |
if ( div.getElementsByClassName("e").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
|
5044 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5045 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5046 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5047 |
Expr.order.splice(1, 0, "CLASS"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5048 |
Expr.find.CLASS = function( match, context, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5049 |
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5050 |
return context.getElementsByClassName(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
|
5051 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5052 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5053 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5054 |
// release memory 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
|
5055 |
div = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5056 |
})(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5057 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5058 |
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5059 |
for ( var i = 0, l = checkSet.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5060 |
var elem = checkSet[i]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5061 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5062 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5063 |
var match = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5064 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5065 |
elem = 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
|
5066 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5067 |
while ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5068 |
if ( elem.sizcache === doneName ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5069 |
match = checkSet[elem.sizset]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5070 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5071 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5072 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5073 |
if ( elem.nodeType === 1 && !isXML ){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5074 |
elem.sizcache = doneName; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5075 |
elem.sizset = i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5076 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5077 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5078 |
if ( elem.nodeName.toLowerCase() === cur ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5079 |
match = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5080 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5081 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5082 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5083 |
elem = 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
|
5084 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5085 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5086 |
checkSet[i] = match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5087 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5088 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5089 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5090 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5091 |
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5092 |
for ( var i = 0, l = checkSet.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5093 |
var elem = checkSet[i]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5094 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5095 |
if ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5096 |
var match = false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5097 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5098 |
elem = 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
|
5099 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5100 |
while ( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5101 |
if ( elem.sizcache === doneName ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5102 |
match = checkSet[elem.sizset]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5103 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5104 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5105 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5106 |
if ( elem.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
|
5107 |
if ( !isXML ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5108 |
elem.sizcache = doneName; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5109 |
elem.sizset = i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5110 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5111 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5112 |
if ( typeof cur !== "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5113 |
if ( elem === cur ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5114 |
match = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5115 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5116 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5117 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5118 |
} else if ( Sizzle.filter( cur, [elem] ).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
|
5119 |
match = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5120 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5121 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5122 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5123 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5124 |
elem = 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
|
5125 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5126 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5127 |
checkSet[i] = match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5128 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5129 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5130 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5131 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5132 |
if ( document.documentElement.contains ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5133 |
Sizzle.contains = function( a, b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5134 |
return a !== b && (a.contains ? a.contains(b) : true); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5135 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5136 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5137 |
} else if ( document.documentElement.compareDocumentPosition ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5138 |
Sizzle.contains = function( a, b ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5139 |
return !!(a.compareDocumentPosition(b) & 16); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5140 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5141 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5142 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5143 |
Sizzle.contains = function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5144 |
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
|
5145 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5146 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5147 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5148 |
Sizzle.isXML = 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
|
5149 |
// documentElement is verified for cases where it doesn't yet exist |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5150 |
// (such as loading iframes in IE - #4833) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5151 |
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5152 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5153 |
return documentElement ? documentElement.nodeName !== "HTML" : false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5154 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5155 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5156 |
var posProcess = 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
|
5157 |
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
|
5158 |
tmpSet = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5159 |
later = "", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5160 |
root = context.nodeType ? [context] : context; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5161 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5162 |
// Position selectors must be done after the filter |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5163 |
// And so must :not(positional) so we move all PSEUDOs to the end |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5164 |
while ( (match = Expr.match.PSEUDO.exec( selector )) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5165 |
later += match[0]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5166 |
selector = selector.replace( Expr.match.PSEUDO, "" ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5169 |
selector = Expr.relative[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
|
5170 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5171 |
for ( var i = 0, l = root.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5172 |
Sizzle( selector, root[i], tmpSet ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5173 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5174 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5175 |
return Sizzle.filter( later, tmpSet ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5176 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5177 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5178 |
// EXPOSE |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5179 |
jQuery.find = Sizzle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5180 |
jQuery.expr = Sizzle.selectors; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5181 |
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
|
5182 |
jQuery.unique = Sizzle.uniqueSort; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5183 |
jQuery.text = Sizzle.getText; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5184 |
jQuery.isXMLDoc = Sizzle.isXML; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5185 |
jQuery.contains = Sizzle.contains; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5186 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5187 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5188 |
})(); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5191 |
var runtil = /Until$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5192 |
rparentsprev = /^(?:parents|prevUntil|prevAll)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5193 |
// Note: This RegExp should be improved, or likely pulled from Sizzle |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5194 |
rmultiselector = /,/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5195 |
isSimple = /^.[^:#\[\.,]*$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5196 |
slice = Array.prototype.slice, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5197 |
POS = jQuery.expr.match.POS, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5198 |
// 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
|
5199 |
guaranteedUnique = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5200 |
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
|
5201 |
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
|
5202 |
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
|
5203 |
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
|
5204 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5205 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5206 |
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
|
5207 |
find: function( selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5208 |
var self = this, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5209 |
i, l; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5210 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5211 |
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
|
5212 |
return jQuery( selector ).filter(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5213 |
for ( i = 0, l = self.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5214 |
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
|
5215 |
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
|
5216 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5217 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5218 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5219 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5220 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5221 |
var ret = this.pushStack( "", "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
|
5222 |
length, n, r; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5223 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5224 |
for ( i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5225 |
length = ret.length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5226 |
jQuery.find( selector, this[i], ret ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5227 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5228 |
if ( 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
|
5229 |
// Make sure that the results are unique |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5230 |
for ( n = length; n < ret.length; n++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5231 |
for ( r = 0; r < length; r++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5232 |
if ( ret[r] === ret[n] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5233 |
ret.splice(n--, 1); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5234 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5235 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5236 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5237 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5238 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5239 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5240 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5241 |
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
|
5242 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5243 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5244 |
has: function( target ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5245 |
var targets = jQuery( target ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5246 |
return this.filter(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5247 |
for ( var i = 0, l = targets.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5248 |
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
|
5249 |
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
|
5250 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5251 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5252 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5253 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5254 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5255 |
not: function( selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5256 |
return this.pushStack( winnow(this, selector, false), "not", selector); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5257 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5258 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5259 |
filter: function( selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5260 |
return this.pushStack( winnow(this, selector, true), "filter", selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5261 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5262 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5263 |
is: function( selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5264 |
return !!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
|
5265 |
jQuery.filter( selector, this ).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
|
5266 |
this.filter( selector ).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
|
5267 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5268 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5269 |
closest: function( selectors, context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5270 |
var ret = [], i, l, cur = 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
|
5271 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5272 |
// Array |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5273 |
if ( jQuery.isArray( selectors ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5274 |
var match, selector, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5275 |
matches = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5276 |
level = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5277 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5278 |
if ( cur && selectors.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5279 |
for ( i = 0, l = selectors.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5280 |
selector = selectors[i]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5281 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5282 |
if ( !matches[ selector ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5283 |
matches[ selector ] = POS.test( selector ) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5284 |
jQuery( selector, 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
|
5285 |
selector; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5286 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5287 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5288 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5289 |
while ( cur && cur.ownerDocument && cur !== context ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5290 |
for ( selector in matches ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5291 |
match = matches[ selector ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5292 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5293 |
if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5294 |
ret.push({ selector: selector, elem: cur, level: level }); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5295 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5296 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5297 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5298 |
cur = cur.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5299 |
level++; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5300 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5301 |
} |
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 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5306 |
// String |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5307 |
var pos = POS.test( selectors ) || typeof selectors !== "string" ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5308 |
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
|
5309 |
0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5310 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5311 |
for ( i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5312 |
cur = 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
|
5313 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5314 |
while ( cur ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5315 |
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5316 |
ret.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
|
5317 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5318 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5319 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5320 |
cur = cur.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5321 |
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5322 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5323 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5324 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5325 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5326 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5327 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5328 |
ret = ret.length > 1 ? jQuery.unique( ret ) : ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5329 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5330 |
return this.pushStack( ret, "closest", selectors ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5331 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5332 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5333 |
// 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
|
5334 |
// 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
|
5335 |
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
|
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 |
// 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
|
5338 |
if ( !elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5339 |
return ( this[0] && this[0].parentNode ) ? this.prevAll().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
|
5340 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5341 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5342 |
// 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
|
5343 |
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
|
5344 |
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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5347 |
// 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
|
5348 |
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
|
5349 |
// 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
|
5350 |
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
|
5351 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5352 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5353 |
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
|
5354 |
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
|
5355 |
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
|
5356 |
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
|
5357 |
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
|
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 |
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5360 |
all : |
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.unique( all ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5362 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5363 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5364 |
andSelf: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5365 |
return this.add( this.prevObject ); |
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 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5368 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5369 |
// A painfully simple check to see if an element is disconnected |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5370 |
// from a document (should be improved, where feasible). |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5371 |
function isDisconnected( node ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5372 |
return !node || !node.parentNode || node.parentNode.nodeType === 11; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5373 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5374 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5375 |
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
|
5376 |
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
|
5377 |
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
|
5378 |
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
|
5379 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5380 |
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
|
5381 |
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
|
5382 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5383 |
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
|
5384 |
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
|
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 |
next: 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
|
5387 |
return jQuery.nth( elem, 2, "nextSibling" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5388 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5389 |
prev: 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
|
5390 |
return jQuery.nth( elem, 2, "previousSibling" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5391 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5392 |
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
|
5393 |
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
|
5394 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5395 |
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
|
5396 |
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
|
5397 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5398 |
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
|
5399 |
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
|
5400 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5401 |
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
|
5402 |
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
|
5403 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5404 |
siblings: 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
|
5405 |
return jQuery.sibling( elem.parentNode.firstChild, elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5406 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5407 |
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
|
5408 |
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
|
5409 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5410 |
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
|
5411 |
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
|
5412 |
elem.contentDocument || elem.contentWindow.document : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5413 |
jQuery.makeArray( elem.childNodes ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5414 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5415 |
}, 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
|
5416 |
jQuery.fn[ name ] = function( until, selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5417 |
var ret = jQuery.map( this, fn, until ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5418 |
// The variable 'args' was introduced in |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5419 |
// https://github.com/jquery/jquery/commit/52a0238 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5420 |
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5421 |
// http://code.google.com/p/v8/issues/detail?id=1050 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5422 |
args = slice.call(arguments); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5423 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5424 |
if ( !runtil.test( name ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5425 |
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
|
5426 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5427 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5428 |
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
|
5429 |
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
|
5430 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5431 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5432 |
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5433 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5434 |
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5435 |
ret = ret.reverse(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5436 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5437 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5438 |
return this.pushStack( ret, name, args.join(",") ); |
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 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5441 |
|
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.extend({ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5443 |
filter: function( expr, elems, not ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5444 |
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
|
5445 |
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
|
5446 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5447 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5448 |
return elems.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
|
5449 |
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5450 |
jQuery.find.matches(expr, elems); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5451 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5452 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5453 |
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
|
5454 |
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
|
5455 |
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
|
5456 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5457 |
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
|
5458 |
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
|
5459 |
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
|
5460 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5461 |
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
|
5462 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5463 |
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
|
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 |
nth: function( cur, result, dir, elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5467 |
result = result || 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5468 |
var num = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5469 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5470 |
for ( ; cur; 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
|
5471 |
if ( cur.nodeType === 1 && ++num === result ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5472 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5473 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5474 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5475 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5476 |
return cur; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5477 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5478 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5479 |
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
|
5480 |
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
|
5481 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5482 |
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
|
5483 |
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
|
5484 |
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
|
5485 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5486 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5487 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5488 |
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
|
5489 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5490 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5491 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5492 |
// Implement the identical functionality for filter and not |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5493 |
function winnow( elements, qualifier, keep ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5494 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5495 |
// Can't pass null or undefined to indexOf in Firefox 4 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5496 |
// Set to 0 to skip string check |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5497 |
qualifier = qualifier || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5498 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5499 |
if ( jQuery.isFunction( qualifier ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5500 |
return jQuery.grep(elements, 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
|
5501 |
var retVal = !!qualifier.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
|
5502 |
return retVal === keep; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5503 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5504 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5505 |
} else if ( qualifier.nodeType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5506 |
return jQuery.grep(elements, 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
|
5507 |
return (elem === qualifier) === keep; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5508 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5509 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5510 |
} else if ( typeof qualifier === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5511 |
var filtered = jQuery.grep(elements, 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
|
5512 |
return elem.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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5515 |
if ( isSimple.test( qualifier ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5516 |
return jQuery.filter(qualifier, filtered, !keep); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5517 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5518 |
qualifier = jQuery.filter( qualifier, filtered ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5519 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5520 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5521 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5522 |
return jQuery.grep(elements, 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
|
5523 |
return (jQuery.inArray( elem, qualifier ) >= 0) === keep; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5524 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5525 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5526 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5527 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5528 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5529 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5530 |
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5531 |
rleadingWhitespace = /^\s+/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5532 |
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5533 |
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
|
5534 |
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
|
5535 |
rhtml = /<|&#?\w+;/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5536 |
rnocache = /<(?:script|object|embed|option|style)/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5537 |
// 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
|
5538 |
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5539 |
rscriptType = /\/(java|ecma)script/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5540 |
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5541 |
wrapMap = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5542 |
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
|
5543 |
legend: [ 1, "<fieldset>", "</fieldset>" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5544 |
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
|
5545 |
tr: [ 2, "<table><tbody>", "</tbody></table>" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5546 |
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5547 |
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5548 |
area: [ 1, "<map>", "</map>" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5549 |
_default: [ 0, "", "" ] |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5550 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5551 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5552 |
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
|
5553 |
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
|
5554 |
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
|
5555 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5556 |
// IE can't serialize <link> and <script> tags normally |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5557 |
if ( !jQuery.support.htmlSerialize ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5558 |
wrapMap._default = [ 1, "div<div>", "</div>" ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5559 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5560 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5561 |
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
|
5562 |
text: 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
|
5563 |
if ( jQuery.isFunction(text) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5564 |
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
|
5565 |
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
|
5566 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5567 |
self.text( text.call(this, i, self.text()) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5568 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5569 |
} |
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 |
if ( typeof text !== "object" && text !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5572 |
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5575 |
return jQuery.text( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5576 |
}, |
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 |
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
|
5579 |
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
|
5580 |
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
|
5581 |
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
|
5582 |
}); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5585 |
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
|
5586 |
// 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
|
5587 |
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
|
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 |
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
|
5590 |
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
|
5591 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5592 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5593 |
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
|
5594 |
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
|
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 |
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
|
5597 |
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
|
5598 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5599 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5600 |
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
|
5601 |
}).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
|
5602 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5603 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5604 |
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
|
5605 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5606 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5607 |
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
|
5608 |
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
|
5609 |
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
|
5610 |
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
|
5611 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5612 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5613 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5614 |
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
|
5615 |
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
|
5616 |
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
|
5617 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5618 |
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
|
5619 |
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
|
5620 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5621 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5622 |
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
|
5623 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5624 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5625 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5626 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5627 |
wrap: 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
|
5628 |
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
|
5629 |
jQuery( this ).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
|
5630 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5631 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5632 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5633 |
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
|
5634 |
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
|
5635 |
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
|
5636 |
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
|
5637 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5638 |
}).end(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5639 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5640 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5641 |
append: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5642 |
return this.domManip(arguments, true, 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
|
5643 |
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
|
5644 |
this.appendChild( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5645 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5646 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5647 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5648 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5649 |
prepend: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5650 |
return this.domManip(arguments, true, 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
|
5651 |
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
|
5652 |
this.insertBefore( elem, this.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5653 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5654 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5655 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5656 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5657 |
before: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5658 |
if ( this[0] && 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
|
5659 |
return this.domManip(arguments, false, 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
|
5660 |
this.parentNode.insertBefore( 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
|
5661 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5662 |
} else 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
|
5663 |
var set = jQuery(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
|
5664 |
set.push.apply( set, 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
|
5665 |
return this.pushStack( set, "before", arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5666 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5667 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5668 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5669 |
after: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5670 |
if ( this[0] && 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
|
5671 |
return this.domManip(arguments, false, 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
|
5672 |
this.parentNode.insertBefore( elem, this.nextSibling ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5673 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5674 |
} else 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
|
5675 |
var set = this.pushStack( this, "after", arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5676 |
set.push.apply( set, jQuery(arguments[0]).toArray() ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5677 |
return set; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5678 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5679 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5680 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5681 |
// keepData is for internal use only--do not document |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5682 |
remove: function( selector, keepData ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5683 |
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5684 |
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5685 |
if ( !keepData && elem.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
|
5686 |
jQuery.cleanData( elem.getElementsByTagName("*") ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5687 |
jQuery.cleanData( [ elem ] ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5690 |
if ( 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
|
5691 |
elem.parentNode.removeChild( elem ); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5695 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5696 |
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
|
5697 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5698 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5699 |
empty: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5700 |
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5701 |
// Remove element nodes and prevent memory leaks |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5702 |
if ( elem.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
|
5703 |
jQuery.cleanData( elem.getElementsByTagName("*") ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5704 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5705 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5706 |
// Remove any remaining nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5707 |
while ( 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
|
5708 |
elem.removeChild( 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
|
5709 |
} |
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 |
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
|
5713 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5714 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5715 |
clone: function( dataAndEvents, deepDataAndEvents ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5716 |
dataAndEvents = dataAndEvents == null ? false : dataAndEvents; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5717 |
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; |
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 |
return this.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
|
5720 |
return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5721 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5722 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5723 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5724 |
html: 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
|
5725 |
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
|
5726 |
return this[0] && this[0].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
|
5727 |
this[0].innerHTML.replace(rinlinejQuery, "") : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5728 |
null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5729 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5730 |
// See if we can take a shortcut and just use innerHTML |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5731 |
} else if ( typeof value === "string" && !rnocache.test( value ) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5732 |
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5733 |
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5734 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5735 |
value = value.replace(rxhtmlTag, "<$1></$2>"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5736 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5737 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5738 |
for ( var i = 0, l = this.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5739 |
// Remove element nodes and prevent memory leaks |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5740 |
if ( this[i].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
|
5741 |
jQuery.cleanData( this[i].getElementsByTagName("*") ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5742 |
this[i].innerHTML = value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5743 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5744 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5745 |
|
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 using innerHTML throws an exception, use the fallback method |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5747 |
} 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
|
5748 |
this.empty().append( value ); |
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 |
} else 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
|
5752 |
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
|
5753 |
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
|
5754 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5755 |
self.html( value.call(this, i, self.html()) ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5758 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5759 |
this.empty().append( value ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5762 |
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
|
5763 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5764 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5765 |
replaceWith: 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
|
5766 |
if ( this[0] && 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
|
5767 |
// Make sure that the elements are removed from the DOM before they are inserted |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5768 |
// this can help fix replacing a parent with child elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5769 |
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
|
5770 |
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
|
5771 |
var self = jQuery(this), old = self.html(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5772 |
self.replaceWith( value.call( this, i, old ) ); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5775 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5776 |
if ( typeof value !== "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5777 |
value = jQuery( value ).detach(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5778 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5779 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5780 |
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
|
5781 |
var next = this.nextSibling, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5782 |
parent = this.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5783 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5784 |
jQuery( this ).remove(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5785 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5786 |
if ( next ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5787 |
jQuery(next).before( value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5788 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5789 |
jQuery(parent).append( value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5790 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5791 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5792 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5793 |
return this.length ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5794 |
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5795 |
this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5796 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5797 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5798 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5799 |
detach: function( selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5800 |
return this.remove( selector, true ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5803 |
domManip: function( args, table, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5804 |
var results, first, fragment, parent, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5805 |
value = args[0], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5806 |
scripts = []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5807 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5808 |
// We can't cloneNode fragments that contain checked, in WebKit |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5809 |
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5810 |
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
|
5811 |
jQuery(this).domManip( args, table, callback, true ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5812 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5813 |
} |
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 |
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
|
5816 |
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
|
5817 |
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
|
5818 |
args[0] = value.call(this, i, table ? self.html() : undefined); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5819 |
self.domManip( args, table, callback ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5823 |
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
|
5824 |
parent = value && value.parentNode; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5825 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5826 |
// If we're in a fragment, just use that instead of building a new one |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5827 |
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5828 |
results = { fragment: parent }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5829 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5830 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5831 |
results = jQuery.buildFragment( args, this, scripts ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5832 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5833 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5834 |
fragment = results.fragment; |
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 |
if ( fragment.childNodes.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
|
5837 |
first = fragment = fragment.firstChild; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5838 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5839 |
first = fragment.firstChild; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5840 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5841 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5842 |
if ( first ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5843 |
table = table && jQuery.nodeName( first, "tr" ); |
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 |
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5846 |
callback.call( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5847 |
table ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5848 |
root(this[i], first) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5849 |
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
|
5850 |
// Make sure that we do not leak memory by inadvertently discarding |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5851 |
// the original fragment (which might have attached data) instead of |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5852 |
// using it; in addition, use the original fragment object for the last |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5853 |
// item instead of first because it can end up being emptied incorrectly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5854 |
// in certain situations (Bug #8070). |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5855 |
// Fragments from the fragment cache must always be cloned and never used |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5856 |
// in place. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5857 |
results.cacheable || (l > 1 && i < lastIndex) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5858 |
jQuery.clone( fragment, true, true ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5859 |
fragment |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5860 |
); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5861 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5864 |
if ( scripts.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5865 |
jQuery.each( scripts, evalScript ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5866 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5867 |
} |
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 |
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
|
5870 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5873 |
function root( elem, cur ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5874 |
return jQuery.nodeName(elem, "table") ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5875 |
(elem.getElementsByTagName("tbody")[0] || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5876 |
elem.appendChild(elem.ownerDocument.createElement("tbody"))) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5877 |
elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5878 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5879 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5880 |
function cloneCopyEvent( src, dest ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5881 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5882 |
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5883 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5884 |
} |
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 |
var internalKey = 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
|
5887 |
oldData = jQuery.data( src ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5888 |
curData = jQuery.data( dest, oldData ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5889 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5890 |
// Switch to use the internal data object, if it exists, for the next |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5891 |
// stage of data copying |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5892 |
if ( (oldData = oldData[ internalKey ]) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5893 |
var events = oldData.events; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5894 |
curData = curData[ internalKey ] = jQuery.extend({}, oldData); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5895 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5896 |
if ( events ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5897 |
delete curData.handle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5898 |
curData.events = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5899 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5900 |
for ( var type in events ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5901 |
for ( var i = 0, l = events[ type ].length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5902 |
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5903 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5904 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5905 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5906 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5907 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5908 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5909 |
function cloneFixAttributes( src, dest ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5910 |
var nodeName; |
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 |
// We do not need to do anything for non-Elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5913 |
if ( dest.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
|
5914 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5915 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5916 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5917 |
// clearAttributes removes the attributes, which we don't want, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5918 |
// but also removes the attachEvent events, which we *do* want |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5919 |
if ( dest.clearAttributes ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5920 |
dest.clearAttributes(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5921 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5922 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5923 |
// mergeAttributes, in contrast, only merges back on the |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5924 |
// original attributes, not the events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5925 |
if ( dest.mergeAttributes ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5926 |
dest.mergeAttributes( src ); |
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 |
nodeName = dest.nodeName.toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5930 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5931 |
// IE6-8 fail to clone children inside object elements that use |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5932 |
// the proprietary classid attribute value (rather than the type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5933 |
// attribute) to identify the type of content to display |
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 ( nodeName === "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5935 |
dest.outerHTML = src.outerHTML; |
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 |
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5938 |
// IE6-8 fails to persist the checked state of a cloned checkbox |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5939 |
// or radio button. Worse, IE6-7 fail to give the cloned element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5940 |
// a checked appearance if the defaultChecked value isn't also set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5941 |
if ( src.checked ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5942 |
dest.defaultChecked = dest.checked = src.checked; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5943 |
} |
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 |
// IE6-7 get confused and end up setting the value of a cloned |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5946 |
// checkbox/radio button to an empty string instead of "on" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5947 |
if ( dest.value !== src.value ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5948 |
dest.value = src.value; |
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 |
// IE6-8 fails to return the selected option to the default selected |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5952 |
// state when cloning options |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5953 |
} else if ( nodeName === "option" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5954 |
dest.selected = src.defaultSelected; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5955 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5956 |
// IE6-8 fails to set the defaultValue to the correct value when |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5957 |
// cloning other types of input fields |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5958 |
} else if ( nodeName === "input" || nodeName === "textarea" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5959 |
dest.defaultValue = src.defaultValue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5960 |
} |
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 |
// Event data gets referenced instead of copied if the expando |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5963 |
// gets copied too |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5964 |
dest.removeAttribute( 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
|
5965 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5966 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5967 |
jQuery.buildFragment = function( args, nodes, scripts ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5968 |
var fragment, cacheable, cacheresults, doc; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5969 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5970 |
// nodes may contain either an explicit document object, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5971 |
// a jQuery collection or context object. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5972 |
// If nodes[0] contains a valid object to assign to doc |
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 ( nodes && nodes[0] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5974 |
doc = nodes[0].ownerDocument || nodes[0]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5975 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5976 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5977 |
// Ensure that an attr object doesn't incorrectly stand in as a document object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5978 |
// Chrome and Firefox seem to allow this to occur and will throw exception |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5979 |
// Fixes #8950 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5980 |
if ( !doc.createDocumentFragment ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5981 |
doc = document; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5984 |
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5985 |
// Cloning options loses the selected state, so don't cache them |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5986 |
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5987 |
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5988 |
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5989 |
args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5990 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5991 |
cacheable = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5992 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5993 |
cacheresults = jQuery.fragments[ args[0] ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5994 |
if ( cacheresults && cacheresults !== 1 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5995 |
fragment = cacheresults; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5996 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5997 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5998 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
5999 |
if ( !fragment ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6000 |
fragment = doc.createDocumentFragment(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6001 |
jQuery.clean( args, doc, fragment, scripts ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6002 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6003 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6004 |
if ( cacheable ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6005 |
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6006 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6007 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6008 |
return { fragment: fragment, cacheable: cacheable }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6009 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6010 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6011 |
jQuery.fragments = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6012 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6013 |
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
|
6014 |
appendTo: "append", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6015 |
prependTo: "prepend", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6016 |
insertBefore: "before", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6017 |
insertAfter: "after", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6018 |
replaceAll: "replaceWith" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6019 |
}, function( name, original ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6020 |
jQuery.fn[ name ] = function( selector ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6021 |
var ret = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6022 |
insert = jQuery( selector ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6023 |
parent = this.length === 1 && 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
|
6024 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6025 |
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.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
|
6026 |
insert[ original ]( 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
|
6027 |
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
|
6028 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6029 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6030 |
for ( var i = 0, l = insert.length; i < l; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6031 |
var elems = (i > 0 ? this.clone(true) : this).get(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6032 |
jQuery( insert[i] )[ original ]( elems ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6033 |
ret = ret.concat( elems ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6034 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6035 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6036 |
return this.pushStack( ret, name, insert.selector ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6037 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6038 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6039 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6040 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6041 |
function getAll( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6042 |
if ( "getElementsByTagName" in elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6043 |
return elem.getElementsByTagName( "*" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6044 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6045 |
} else if ( "querySelectorAll" in elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6046 |
return elem.querySelectorAll( "*" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6047 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6048 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6049 |
return []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6050 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6051 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6052 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6053 |
// Used in clean, fixes the defaultChecked property |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6054 |
function fixDefaultChecked( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6055 |
if ( elem.type === "checkbox" || elem.type === "radio" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6056 |
elem.defaultChecked = elem.checked; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6057 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6058 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6059 |
// Finds all inputs and passes them to fixDefaultChecked |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6060 |
function findInputs( elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6061 |
if ( jQuery.nodeName( elem, "input" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6062 |
fixDefaultChecked( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6063 |
} else if ( "getElementsByTagName" in elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6064 |
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6065 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6066 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6067 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6068 |
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
|
6069 |
clone: function( elem, dataAndEvents, deepDataAndEvents ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6070 |
var clone = elem.cloneNode(true), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6071 |
srcElements, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6072 |
destElements, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6073 |
i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6074 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6075 |
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6076 |
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6077 |
// IE copies events bound via attachEvent when using cloneNode. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6078 |
// Calling detachEvent on the clone will also remove the events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6079 |
// from the original. In order to get around this, we use some |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6080 |
// proprietary methods to clear the events. Thanks to MooTools |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6081 |
// guys for this hotness. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6082 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6083 |
cloneFixAttributes( elem, clone ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6084 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6085 |
// Using Sizzle here is crazy slow, so we use getElementsByTagName |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6086 |
// instead |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6087 |
srcElements = getAll( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6088 |
destElements = getAll( clone ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6089 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6090 |
// Weird iteration because IE will replace the length property |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6091 |
// with an element if you are cloning the body and one of the |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6092 |
// elements on the page has a name or id of "length" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6093 |
for ( i = 0; srcElements[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
|
6094 |
// Ensure that the destination node is not null; Fixes #9587 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6095 |
if ( destElements[i] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6096 |
cloneFixAttributes( srcElements[i], destElements[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6097 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6098 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6099 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6100 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6101 |
// Copy the events from the original to the clone |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6102 |
if ( dataAndEvents ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6103 |
cloneCopyEvent( elem, clone ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6104 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6105 |
if ( deepDataAndEvents ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6106 |
srcElements = getAll( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6107 |
destElements = getAll( clone ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6108 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6109 |
for ( i = 0; srcElements[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
|
6110 |
cloneCopyEvent( srcElements[i], destElements[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6111 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6112 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6113 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6114 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6115 |
srcElements = destElements = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6116 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6117 |
// Return the cloned set |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6118 |
return clone; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6119 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6120 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6121 |
clean: function( elems, context, fragment, scripts ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6122 |
var checkScriptType; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6123 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6124 |
context = 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
|
6125 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6126 |
// !context.createElement fails in IE with an error but returns typeof 'object' |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6127 |
if ( typeof context.createElement === "undefined" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6128 |
context = context.ownerDocument || context[0] && context[0].ownerDocument || document; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6129 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6130 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6131 |
var ret = [], j; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6132 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6133 |
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6134 |
if ( typeof elem === "number" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6135 |
elem += ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6136 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6137 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6138 |
if ( !elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6139 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6140 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6141 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6142 |
// Convert html string into DOM nodes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6143 |
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
|
6144 |
if ( !rhtml.test( elem ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6145 |
elem = context.createTextNode( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6146 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6147 |
// Fix "XHTML"-style tags in 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
|
6148 |
elem = elem.replace(rxhtmlTag, "<$1></$2>"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6149 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6150 |
// Trim whitespace, otherwise indexOf won't work as expected |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6151 |
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6152 |
wrap = wrapMap[ tag ] || wrapMap._default, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6153 |
depth = wrap[0], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6154 |
div = context.createElement("div"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6155 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6156 |
// Go to html and back, then peel off extra wrappers |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6157 |
div.innerHTML = wrap[1] + elem + wrap[2]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6158 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6159 |
// Move to the right depth |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6160 |
while ( depth-- ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6161 |
div = div.lastChild; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6162 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6163 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6164 |
// Remove IE's autoinserted <tbody> from table fragments |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6165 |
if ( !jQuery.support.tbody ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6166 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6167 |
// String was a <table>, *may* have spurious <tbody> |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6168 |
var hasBody = rtbody.test(elem), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6169 |
tbody = tag === "table" && !hasBody ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6170 |
div.firstChild && div.firstChild.childNodes : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6171 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6172 |
// String was a bare <thead> or <tfoot> |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6173 |
wrap[1] === "<table>" && !hasBody ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6174 |
div.childNodes : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6175 |
[]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6176 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6177 |
for ( j = tbody.length - 1; j >= 0 ; --j ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6178 |
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6179 |
tbody[ j ].parentNode.removeChild( tbody[ j ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6180 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6181 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6182 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6183 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6184 |
// IE completely kills leading whitespace when innerHTML 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
|
6185 |
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6186 |
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6187 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6188 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6189 |
elem = div.childNodes; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6190 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6191 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6192 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6193 |
// Resets defaultChecked for any radios and checkboxes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6194 |
// about to be appended to the DOM in IE 6/7 (#8060) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6195 |
var len; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6196 |
if ( !jQuery.support.appendChecked ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6197 |
if ( elem[0] && typeof (len = elem.length) === "number" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6198 |
for ( j = 0; j < len; j++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6199 |
findInputs( elem[j] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6200 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6201 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6202 |
findInputs( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6203 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6204 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6205 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6206 |
if ( elem.nodeType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6207 |
ret.push( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6208 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6209 |
ret = jQuery.merge( ret, elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6210 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6211 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6212 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6213 |
if ( fragment ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6214 |
checkScriptType = 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
|
6215 |
return !elem.type || rscriptType.test( 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
|
6216 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6217 |
for ( i = 0; ret[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
|
6218 |
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6219 |
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6220 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6221 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6222 |
if ( ret[i].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
|
6223 |
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6224 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6225 |
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6226 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6227 |
fragment.appendChild( ret[i] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6228 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6229 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6230 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6231 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6232 |
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
|
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 |
cleanData: function( elems ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6236 |
var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6237 |
deleteExpando = jQuery.support.deleteExpando; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6238 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6239 |
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6240 |
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6241 |
continue; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6242 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6243 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6244 |
id = 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
|
6245 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6246 |
if ( id ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6247 |
data = cache[ id ] && cache[ id ][ internalKey ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6248 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6249 |
if ( data && data.events ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6250 |
for ( var type in data.events ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6251 |
if ( special[ type ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6252 |
jQuery.event.remove( 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
|
6253 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6254 |
// This is a shortcut to avoid jQuery.event.remove's overhead |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6255 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6256 |
jQuery.removeEvent( elem, type, data.handle ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6257 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6258 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6259 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6260 |
// Null the DOM reference to avoid IE6/7/8 leak (#7054) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6261 |
if ( data.handle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6262 |
data.handle.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
|
6263 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6264 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6265 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6266 |
if ( deleteExpando ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6267 |
delete 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
|
6268 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6269 |
} else if ( elem.removeAttribute ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6270 |
elem.removeAttribute( 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
|
6271 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6272 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6273 |
delete cache[ id ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6274 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6275 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6276 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6277 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6278 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6279 |
function evalScript( 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
|
6280 |
if ( elem.src ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6281 |
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
|
6282 |
url: elem.src, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6283 |
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
|
6284 |
dataType: "script" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6285 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6286 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6287 |
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6288 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6289 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6290 |
if ( 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
|
6291 |
elem.parentNode.removeChild( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6292 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6293 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6294 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6295 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6296 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6297 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6298 |
var ralpha = /alpha\([^)]*\)/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6299 |
ropacity = /opacity=([^)]*)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6300 |
// fixed for IE9, see #8346 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6301 |
rupper = /([A-Z]|^ms)/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6302 |
rnumpx = /^-?\d+(?:px)?$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6303 |
rnum = /^-?\d/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6304 |
rrelNum = /^([\-+])=([\-+.\de]+)/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6305 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6306 |
cssShow = { position: "absolute", visibility: "hidden", display: "block" }, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6307 |
cssWidth = [ "Left", "Right" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6308 |
cssHeight = [ "Top", "Bottom" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6309 |
curCSS, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6310 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6311 |
getComputedStyle, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6312 |
currentStyle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6313 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6314 |
jQuery.fn.css = function( 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
|
6315 |
// Setting 'undefined' is a no-op |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6316 |
if ( arguments.length === 2 && 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
|
6317 |
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
|
6318 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6319 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6320 |
return jQuery.access( this, name, value, true, function( 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
|
6321 |
return 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
|
6322 |
jQuery.style( 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
|
6323 |
jQuery.css( elem, name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6324 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6325 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6326 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6327 |
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
|
6328 |
// 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
|
6329 |
// 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
|
6330 |
cssHooks: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6331 |
opacity: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6332 |
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
|
6333 |
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
|
6334 |
// We should always get a number back from opacity |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6335 |
var ret = curCSS( elem, "opacity", "opacity" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6336 |
return ret === "" ? "1" : ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6337 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6338 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6339 |
return elem.style.opacity; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6340 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6341 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6342 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6343 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6344 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6345 |
// Exclude the following css properties to add px |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6346 |
cssNumber: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6347 |
"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
|
6348 |
"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
|
6349 |
"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
|
6350 |
"opacity": true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6351 |
"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
|
6352 |
"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
|
6353 |
"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
|
6354 |
"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
|
6355 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6356 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6357 |
// 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
|
6358 |
// 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
|
6359 |
cssProps: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6360 |
// 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
|
6361 |
"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
|
6362 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6363 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6364 |
// 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
|
6365 |
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
|
6366 |
// 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
|
6367 |
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
|
6368 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6369 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6370 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6371 |
// Make sure that we're working with the right name |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6372 |
var ret, type, origName = jQuery.camelCase( name ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6373 |
style = elem.style, hooks = jQuery.cssHooks[ origName ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6374 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6375 |
name = jQuery.cssProps[ origName ] || origName; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6376 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6377 |
// 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
|
6378 |
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
|
6379 |
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
|
6380 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6381 |
// 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
|
6382 |
if ( type === "string" && (ret = rrelNum.exec( value )) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6383 |
value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6384 |
// 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
|
6385 |
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
|
6386 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6387 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6388 |
// 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
|
6389 |
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
|
6390 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6391 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6392 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6393 |
// 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
|
6394 |
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
|
6395 |
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
|
6396 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6397 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6398 |
// If a hook was provided, use that value, otherwise just set the specified value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6399 |
if ( !hooks || !("set" in hooks) || (value = hooks.set( 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
|
6400 |
// 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
|
6401 |
// 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
|
6402 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6403 |
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
|
6404 |
} 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
|
6405 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6406 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6407 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6408 |
// 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
|
6409 |
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
|
6410 |
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
|
6411 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6412 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6413 |
// 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
|
6414 |
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
|
6415 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6416 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6417 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6418 |
css: function( elem, name, extra ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6419 |
var ret, hooks; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6420 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6421 |
// Make sure that we're working with the right name |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6422 |
name = jQuery.camelCase( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6423 |
hooks = 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
|
6424 |
name = jQuery.cssProps[ 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
|
6425 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6426 |
// cssFloat needs a special treatment |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6427 |
if ( name === "cssFloat" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6428 |
name = "float"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6429 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6430 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6431 |
// If a hook was provided get the 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
|
6432 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, 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
|
6433 |
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
|
6434 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6435 |
// Otherwise, if a way to get the computed value exists, use that |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6436 |
} else if ( curCSS ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6437 |
return curCSS( elem, name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6438 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6439 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6440 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6441 |
// A method for quickly swapping in/out CSS properties to get correct calculations |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6442 |
swap: function( elem, options, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6443 |
var old = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6444 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6445 |
// Remember the old values, and insert the new ones |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6446 |
for ( var 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
|
6447 |
old[ name ] = elem.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
|
6448 |
elem.style[ name ] = 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
|
6449 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6450 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6451 |
callback.call( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6452 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6453 |
// Revert the old values |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6454 |
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
|
6455 |
elem.style[ name ] = old[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6456 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6457 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6458 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6459 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6460 |
// DEPRECATED, Use jQuery.css() instead |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6461 |
jQuery.curCSS = jQuery.css; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6462 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6463 |
jQuery.each(["height", "width"], function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6464 |
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
|
6465 |
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
|
6466 |
var val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6467 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6468 |
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
|
6469 |
if ( elem.offsetWidth !== 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6470 |
return getWH( elem, name, extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6471 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6472 |
jQuery.swap( elem, cssShow, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6473 |
val = getWH( elem, name, extra ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6474 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6475 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6476 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6477 |
return val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6478 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6479 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6480 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6481 |
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
|
6482 |
if ( rnumpx.test( value ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6483 |
// ignore negative width and height values #1599 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6484 |
value = parseFloat( value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6485 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6486 |
if ( value >= 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6487 |
return 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
|
6488 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6489 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6490 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6491 |
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
|
6492 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6493 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6494 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6495 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6496 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6497 |
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
|
6498 |
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
|
6499 |
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
|
6500 |
// 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
|
6501 |
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.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
|
6502 |
( parseFloat( RegExp.$1 ) / 100 ) + "" : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6503 |
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
|
6504 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6505 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6506 |
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
|
6507 |
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
|
6508 |
currentStyle = elem.currentStyle, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6509 |
opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6510 |
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
|
6511 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6512 |
// 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
|
6513 |
// 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
|
6514 |
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
|
6515 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6516 |
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6517 |
if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6518 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6519 |
// 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
|
6520 |
// 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
|
6521 |
// 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
|
6522 |
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
|
6523 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6524 |
// if there there is no filter style applied in a css rule, we are done |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6525 |
if ( currentStyle && !currentStyle.filter ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6526 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6527 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6528 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6529 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6530 |
// 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
|
6531 |
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
|
6532 |
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
|
6533 |
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
|
6534 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6535 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6536 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6537 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6538 |
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
|
6539 |
// This hook cannot be added until DOM ready because the support test |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6540 |
// for it is not run until after DOM ready |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6541 |
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
|
6542 |
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
|
6543 |
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
|
6544 |
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6545 |
// Work around by temporarily setting element display to inline-block |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6546 |
var ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6547 |
jQuery.swap( elem, { "display": "inline-block" }, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6548 |
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
|
6549 |
ret = curCSS( elem, "margin-right", "marginRight" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6550 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6551 |
ret = elem.style.marginRight; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6552 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6553 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6554 |
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
|
6555 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6556 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6557 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6558 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6559 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6560 |
if ( document.defaultView && document.defaultView.getComputedStyle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6561 |
getComputedStyle = function( elem, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6562 |
var ret, defaultView, computedStyle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6563 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6564 |
name = name.replace( rupper, "-$1" ).toLowerCase(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6565 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6566 |
if ( !(defaultView = elem.ownerDocument.defaultView) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6567 |
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
|
6568 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6569 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6570 |
if ( (computedStyle = defaultView.getComputedStyle( 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
|
6571 |
ret = computedStyle.getPropertyValue( name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6572 |
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6573 |
ret = jQuery.style( elem, name ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6574 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6575 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6576 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6577 |
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
|
6578 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6579 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6580 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6581 |
if ( document.documentElement.currentStyle ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6582 |
currentStyle = function( elem, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6583 |
var left, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6584 |
ret = elem.currentStyle && elem.currentStyle[ name ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6585 |
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6586 |
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
|
6587 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6588 |
// From the awesome hack by Dean Edwards |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6589 |
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6590 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6591 |
// If we're not dealing with a regular pixel number |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6592 |
// but a number that has a weird ending, we need to convert it to pixels |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6593 |
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6594 |
// Remember the original values |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6595 |
left = style.left; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6596 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6597 |
// Put in the new values to get a computed value out |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6598 |
if ( rsLeft ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6599 |
elem.runtimeStyle.left = elem.currentStyle.left; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6600 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6601 |
style.left = name === "fontSize" ? "1em" : (ret || 0); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6602 |
ret = style.pixelLeft + "px"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6603 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6604 |
// Revert the changed values |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6605 |
style.left = left; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6606 |
if ( rsLeft ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6607 |
elem.runtimeStyle.left = rsLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6608 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6609 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6610 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6611 |
return ret === "" ? "auto" : ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6612 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6613 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6614 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6615 |
curCSS = getComputedStyle || currentStyle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6616 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6617 |
function getWH( elem, name, extra ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6618 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6619 |
// Start with offset property |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6620 |
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6621 |
which = name === "width" ? cssWidth : cssHeight; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6622 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6623 |
if ( val > 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6624 |
if ( extra !== "border" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6625 |
jQuery.each( which, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6626 |
if ( !extra ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6627 |
val -= parseFloat( jQuery.css( elem, "padding" + 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
|
6628 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6629 |
if ( extra === "margin" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6630 |
val += parseFloat( jQuery.css( elem, extra + 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
|
6631 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6632 |
val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6633 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6634 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6635 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6636 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6637 |
return val + "px"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6638 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6639 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6640 |
// Fall back to computed then uncomputed css if necessary |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6641 |
val = curCSS( elem, 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
|
6642 |
if ( val < 0 || 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
|
6643 |
val = elem.style[ name ] || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6644 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6645 |
// Normalize "", auto, and prepare for extra |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6646 |
val = parseFloat( val ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6647 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6648 |
// Add padding, border, margin |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6649 |
if ( extra ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6650 |
jQuery.each( which, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6651 |
val += parseFloat( jQuery.css( elem, "padding" + 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
|
6652 |
if ( extra !== "padding" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6653 |
val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6654 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6655 |
if ( extra === "margin" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6656 |
val += parseFloat( jQuery.css( elem, extra + 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
|
6657 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6658 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6659 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6660 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6661 |
return val + "px"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6662 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6663 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6664 |
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
|
6665 |
jQuery.expr.filters.hidden = 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
|
6666 |
var width = elem.offsetWidth, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6667 |
height = elem.offsetHeight; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6668 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6669 |
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6670 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6671 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6672 |
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
|
6673 |
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
|
6674 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6675 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6676 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6677 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6678 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6679 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6680 |
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
|
6681 |
rbracket = /\[\]$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6682 |
rCRLF = /\r?\n/g, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6683 |
rhash = /#.*$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6684 |
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
|
6685 |
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6686 |
// #7653, #8125, #8152: local protocol detection |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6687 |
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6688 |
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
|
6689 |
rprotocol = /^\/\//, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6690 |
rquery = /\?/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6691 |
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6692 |
rselectTextarea = /^(?:select|textarea)/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6693 |
rspacesAjax = /\s+/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6694 |
rts = /([?&])_=[^&]*/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6695 |
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6696 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6697 |
// 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
|
6698 |
_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
|
6699 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6700 |
/* Prefilters |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6701 |
* 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
|
6702 |
* 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
|
6703 |
* - 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
|
6704 |
* - 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
|
6705 |
* 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
|
6706 |
* 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
|
6707 |
* 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
|
6708 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6709 |
prefilters = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6710 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6711 |
/* 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
|
6712 |
* 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
|
6713 |
* 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
|
6714 |
* 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
|
6715 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6716 |
transports = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6717 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6718 |
// 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
|
6719 |
ajaxLocation, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6720 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6721 |
// Document location segments |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6722 |
ajaxLocParts, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6723 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6724 |
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6725 |
allTypes = ["*/"] + ["*"]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6726 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6727 |
// #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
|
6728 |
// 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
|
6729 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6730 |
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
|
6731 |
} 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
|
6732 |
// 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
|
6733 |
// 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
|
6734 |
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
|
6735 |
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
|
6736 |
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
|
6737 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6738 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6739 |
// 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
|
6740 |
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
|
6741 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6742 |
// 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
|
6743 |
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
|
6744 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6745 |
// 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
|
6746 |
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
|
6747 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6748 |
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
|
6749 |
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
|
6750 |
dataTypeExpression = "*"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6751 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6752 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6753 |
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
|
6754 |
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6755 |
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
|
6756 |
length = dataTypes.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6757 |
dataType, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6758 |
list, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6759 |
placeBefore; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6760 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6761 |
// For each dataType in the dataTypeExpression |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6762 |
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
|
6763 |
dataType = dataTypes[ i ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6764 |
// We control if we're asked to add before |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6765 |
// any existing element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6766 |
placeBefore = /^\+/.test( dataType ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6767 |
if ( placeBefore ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6768 |
dataType = dataType.substr( 1 ) || "*"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6769 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6770 |
list = structure[ dataType ] = structure[ dataType ] || []; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6771 |
// then we add to the structure accordingly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6772 |
list[ placeBefore ? "unshift" : "push" ]( func ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6773 |
} |
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 |
// Base inspection function for prefilters and transports |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6779 |
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6780 |
dataType /* internal */, inspected /* internal */ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6781 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6782 |
dataType = dataType || options.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
|
6783 |
inspected = inspected || {}; |
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 |
inspected[ dataType ] = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6786 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6787 |
var list = structure[ dataType ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6788 |
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
|
6789 |
length = list ? list.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
|
6790 |
executeOnly = ( structure === prefilters ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6791 |
selection; |
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 |
for(; i < length && ( executeOnly || !selection ); i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6794 |
selection = list[ i ]( options, originalOptions, jqXHR ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6795 |
// If we got redirected to another dataType |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6796 |
// we try there if executing only and not done already |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6797 |
if ( typeof selection === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6798 |
if ( !executeOnly || inspected[ selection ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6799 |
selection = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6800 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6801 |
options.dataTypes.unshift( selection ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6802 |
selection = inspectPrefiltersOrTransports( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6803 |
structure, options, originalOptions, jqXHR, selection, inspected ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6804 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6805 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6806 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6807 |
// If we're only executing or nothing was selected |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6808 |
// we try the catchall dataType if not done already |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6809 |
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6810 |
selection = inspectPrefiltersOrTransports( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6811 |
structure, options, originalOptions, jqXHR, "*", inspected ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6812 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6813 |
// unnecessary when only executing (prefilters) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6814 |
// but it'll be ignored by the caller in that case |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6815 |
return selection; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6816 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6817 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6818 |
// 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
|
6819 |
// 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
|
6820 |
// 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
|
6821 |
function ajaxExtend( target, src ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6822 |
var key, deep, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6823 |
flatOptions = jQuery.ajaxSettings.flatOptions || {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6824 |
for( key in src ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6825 |
if ( src[ key ] !== undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6826 |
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6827 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6828 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6829 |
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
|
6830 |
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
|
6831 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6832 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6833 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6834 |
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
|
6835 |
load: function( url, params, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6836 |
if ( typeof url !== "string" && _load ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6837 |
return _load.apply( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6838 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6839 |
// Don't do a request if no elements are being requested |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6840 |
} else if ( !this.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6841 |
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
|
6842 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6843 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6844 |
var off = url.indexOf( " " ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6845 |
if ( off >= 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6846 |
var selector = url.slice( off, url.length ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6847 |
url = url.slice( 0, off ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6848 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6849 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6850 |
// Default to a GET request |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6851 |
var 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
|
6852 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6853 |
// If the second parameter was provided |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6854 |
if ( params ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6855 |
// If it's a function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6856 |
if ( jQuery.isFunction( params ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6857 |
// We assume that it's the callback |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6858 |
callback = params; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6859 |
params = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6860 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6861 |
// Otherwise, build a param string |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6862 |
} else if ( typeof params === "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6863 |
params = jQuery.param( params, jQuery.ajaxSettings.traditional ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6864 |
type = "POST"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6865 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6866 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6867 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6868 |
var self = this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6869 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6870 |
// Request the remote document |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6871 |
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
|
6872 |
url: url, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6873 |
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
|
6874 |
dataType: "html", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6875 |
data: params, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6876 |
// Complete callback (responseText is 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
|
6877 |
complete: function( jqXHR, status, responseText ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6878 |
// Store the response as specified by the jqXHR object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6879 |
responseText = jqXHR.responseText; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6880 |
// If successful, inject the HTML into all the matched elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6881 |
if ( jqXHR.isResolved() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6882 |
// #4825: Get the actual response in case |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6883 |
// a dataFilter is present in ajaxSettings |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6884 |
jqXHR.done(function( r ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6885 |
responseText = r; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6886 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6887 |
// See if a selector was specified |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6888 |
self.html( selector ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6889 |
// Create a dummy div to hold the results |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6890 |
jQuery("<div>") |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6891 |
// inject the contents of the document in, removing the scripts |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6892 |
// to avoid any 'Permission Denied' errors 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
|
6893 |
.append(responseText.replace(rscript, "")) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6894 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6895 |
// Locate the specified elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6896 |
.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
|
6897 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6898 |
// If not, just inject the full result |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6899 |
responseText ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6900 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6901 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6902 |
if ( callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6903 |
self.each( callback, [ responseText, status, jqXHR ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6904 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6905 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6906 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6907 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6908 |
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
|
6909 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6910 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6911 |
serialize: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6912 |
return jQuery.param( this.serializeArray() ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6913 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6914 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6915 |
serializeArray: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6916 |
return this.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
|
6917 |
return this.elements ? jQuery.makeArray( this.elements ) : this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6918 |
}) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6919 |
.filter(function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6920 |
return this.name && !this.disabled && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6921 |
( this.checked || rselectTextarea.test( this.nodeName ) || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6922 |
rinput.test( 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
|
6923 |
}) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6924 |
.map(function( 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
|
6925 |
var val = jQuery( this ).val(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6926 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6927 |
return 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
|
6928 |
null : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6929 |
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
|
6930 |
jQuery.map( val, function( val, i ){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6931 |
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6932 |
}) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6933 |
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6934 |
}).get(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6935 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6936 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6937 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6938 |
// Attach a bunch of functions for handling common AJAX events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6939 |
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6940 |
jQuery.fn[ o ] = function( f ){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6941 |
return this.bind( o, f ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6945 |
jQuery.each( [ "get", "post" ], function( i, method ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6946 |
jQuery[ method ] = function( url, data, callback, type ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6947 |
// shift arguments if data argument was omitted |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6948 |
if ( jQuery.isFunction( data ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6949 |
type = type || callback; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6950 |
callback = data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6951 |
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
|
6952 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6953 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6954 |
return 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
|
6955 |
type: method, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6956 |
url: url, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6957 |
data: data, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6958 |
success: callback, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6959 |
dataType: type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6960 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6961 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6962 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6963 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6964 |
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
|
6965 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6966 |
getScript: function( url, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6967 |
return jQuery.get( url, undefined, callback, "script" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6968 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6969 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6970 |
getJSON: function( url, data, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6971 |
return jQuery.get( url, data, callback, "json" ); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6974 |
// Creates a full fledged settings object into target |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6975 |
// with both ajaxSettings and settings fields. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6976 |
// If target is omitted, writes into ajaxSettings. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6977 |
ajaxSetup: function( target, settings ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6978 |
if ( settings ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6979 |
// Building a settings object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6980 |
ajaxExtend( target, jQuery.ajaxSettings ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6981 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6982 |
// Extending ajaxSettings |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6983 |
settings = target; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6984 |
target = jQuery.ajaxSettings; |
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 |
ajaxExtend( target, settings ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6987 |
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
|
6988 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6989 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6990 |
ajaxSettings: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6991 |
url: ajaxLocation, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6992 |
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
|
6993 |
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
|
6994 |
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
|
6995 |
contentType: "application/x-www-form-urlencoded", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6996 |
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
|
6997 |
async: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6998 |
/* |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
6999 |
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
|
7000 |
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
|
7001 |
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
|
7002 |
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
|
7003 |
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
|
7004 |
cache: null, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7005 |
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
|
7006 |
headers: {}, |
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 |
accepts: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7010 |
xml: "application/xml, 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
|
7011 |
html: "text/html", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7012 |
text: "text/plain", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7013 |
json: "application/json, text/javascript", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7014 |
"*": allTypes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7015 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7016 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7017 |
contents: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7018 |
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
|
7019 |
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
|
7020 |
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
|
7021 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7022 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7023 |
responseFields: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7024 |
xml: "responseXML", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7025 |
text: "responseText" |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7026 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7027 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7028 |
// List of data converters |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7029 |
// 1) key format is "source_type destination_type" (a single space in-between) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7030 |
// 2) the catchall symbol "*" can be used for source_type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7031 |
converters: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7032 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7033 |
// Convert anything to text |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7034 |
"* text": window.String, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7035 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7036 |
// 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
|
7037 |
"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
|
7038 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7039 |
// 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
|
7040 |
"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
|
7041 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7042 |
// 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
|
7043 |
"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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7046 |
// 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
|
7047 |
// 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
|
7048 |
// 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
|
7049 |
// 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
|
7050 |
flatOptions: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7051 |
context: true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7052 |
url: true |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7053 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7054 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7055 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7056 |
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
|
7057 |
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
|
7058 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7059 |
// 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
|
7060 |
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
|
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 |
// 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
|
7063 |
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
|
7064 |
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
|
7065 |
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
|
7066 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7067 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7068 |
// 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
|
7069 |
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
|
7070 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7071 |
var // Create the final options object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7072 |
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
|
7073 |
// 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
|
7074 |
callbackContext = s.context || s, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7075 |
// Context for global events |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7076 |
// It's the callbackContext if one was provided in the options |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7077 |
// and if it's a DOM node or a jQuery collection |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7078 |
globalEventContext = callbackContext !== s && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7079 |
( callbackContext.nodeType || callbackContext instanceof jQuery ) ? |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7080 |
jQuery( callbackContext ) : 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
|
7081 |
// Deferreds |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7082 |
deferred = jQuery.Deferred(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7083 |
completeDeferred = jQuery._Deferred(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7084 |
// 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
|
7085 |
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
|
7086 |
// ifModified key |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7087 |
ifModifiedKey, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7088 |
// 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
|
7089 |
requestHeaders = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7090 |
requestHeadersNames = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7091 |
// 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
|
7092 |
responseHeadersString, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7093 |
responseHeaders, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7094 |
// transport |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7095 |
transport, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7096 |
// timeout handle |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7097 |
timeoutTimer, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7098 |
// Cross-domain detection vars |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7099 |
parts, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7100 |
// 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
|
7101 |
state = 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7102 |
// To know if global events are to be dispatched |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7103 |
fireGlobals, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7104 |
// Loop variable |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7105 |
i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7106 |
// 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
|
7107 |
jqXHR = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7108 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7109 |
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
|
7110 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7111 |
// Caches the header |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7112 |
setRequestHeader: function( 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
|
7113 |
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
|
7114 |
var lname = 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
|
7115 |
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7116 |
requestHeaders[ 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
|
7117 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7118 |
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
|
7119 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7120 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7121 |
// Raw string |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7122 |
getAllResponseHeaders: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7123 |
return state === 2 ? responseHeadersString : null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7124 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7125 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7126 |
// 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
|
7127 |
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
|
7128 |
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
|
7129 |
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
|
7130 |
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
|
7131 |
responseHeaders = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7132 |
while( ( match = rheaders.exec( responseHeadersString ) ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7133 |
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
|
7134 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7135 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7136 |
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
|
7137 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7138 |
return match === undefined ? null : match; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7139 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7140 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7141 |
// 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
|
7142 |
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
|
7143 |
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
|
7144 |
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
|
7145 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7146 |
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
|
7147 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7148 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7149 |
// 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
|
7150 |
abort: function( statusText ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7151 |
statusText = statusText || "abort"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7152 |
if ( transport ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7153 |
transport.abort( statusText ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7154 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7155 |
done( 0, statusText ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7156 |
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
|
7157 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7158 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7159 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7160 |
// 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
|
7161 |
// It is defined here because jslint complains if it is declared |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7162 |
// at the end of the function (which would be more logical and readable) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7163 |
function done( status, nativeStatusText, responses, headers ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7164 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7165 |
// 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
|
7166 |
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
|
7167 |
return; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7168 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7169 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7170 |
// 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
|
7171 |
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
|
7172 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7173 |
// 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
|
7174 |
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
|
7175 |
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
|
7176 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7177 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7178 |
// 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
|
7179 |
// (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
|
7180 |
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
|
7181 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7182 |
// 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
|
7183 |
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
|
7184 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7185 |
// 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
|
7186 |
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
|
7187 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7188 |
var isSuccess, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7189 |
success, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7190 |
error, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7191 |
statusText = nativeStatusText, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7192 |
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7193 |
lastModified, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7194 |
etag; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7195 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7196 |
// If successful, handle type chaining |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7197 |
if ( status >= 200 && status < 300 || status === 304 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7198 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7199 |
// 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
|
7200 |
if ( s.ifModified ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7201 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7202 |
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7203 |
jQuery.lastModified[ ifModifiedKey ] = lastModified; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7204 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7205 |
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7206 |
jQuery.etag[ ifModifiedKey ] = etag; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7207 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7208 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7209 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7210 |
// If not modified |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7211 |
if ( status === 304 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7212 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7213 |
statusText = "notmodified"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7214 |
isSuccess = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7215 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7216 |
// If we have data |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7217 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7218 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7219 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7220 |
success = ajaxConvert( s, response ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7221 |
statusText = "success"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7222 |
isSuccess = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7223 |
} 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
|
7224 |
// We have a parsererror |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7225 |
statusText = "parsererror"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7226 |
error = e; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7227 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7228 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7229 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7230 |
// 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
|
7231 |
// 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
|
7232 |
error = statusText; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7233 |
if( !statusText || status ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7234 |
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
|
7235 |
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
|
7236 |
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
|
7237 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7238 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7239 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7240 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7241 |
// 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
|
7242 |
jqXHR.status = status; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7243 |
jqXHR.statusText = "" + ( nativeStatusText || statusText ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7244 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7245 |
// 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
|
7246 |
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
|
7247 |
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
|
7248 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7249 |
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
|
7250 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7251 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7252 |
// 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
|
7253 |
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
|
7254 |
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
|
7255 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7256 |
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
|
7257 |
globalEventContext.trigger( "ajax" + ( isSuccess ? "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
|
7258 |
[ jqXHR, s, isSuccess ? 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
|
7259 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7260 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7261 |
// Complete |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7262 |
completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7263 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7264 |
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
|
7265 |
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
|
7266 |
// 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
|
7267 |
if ( !( --jQuery.active ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7268 |
jQuery.event.trigger( "ajaxStop" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7269 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7270 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7271 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7272 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7273 |
// Attach deferreds |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7274 |
deferred.promise( jqXHR ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7275 |
jqXHR.success = jqXHR.done; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7276 |
jqXHR.error = jqXHR.fail; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7277 |
jqXHR.complete = completeDeferred.done; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7278 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7279 |
// 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
|
7280 |
jqXHR.statusCode = function( map ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7281 |
if ( map ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7282 |
var tmp; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7283 |
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
|
7284 |
for( tmp in map ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7285 |
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7286 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7287 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7288 |
tmp = map[ jqXHR.status ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7289 |
jqXHR.then( tmp, tmp ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7290 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7291 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7292 |
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
|
7293 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7294 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7295 |
// Remove hash character (#7531: and string promotion) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7296 |
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7297 |
// We also use the url parameter if available |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7298 |
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, 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
|
7299 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7300 |
// Extract dataTypes list |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7301 |
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7302 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7303 |
// Determine if a cross-domain request is in order |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7304 |
if ( s.crossDomain == null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7305 |
parts = rurl.exec( s.url.toLowerCase() ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7306 |
s.crossDomain = !!( parts && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7307 |
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7308 |
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7309 |
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7310 |
); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7311 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7312 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7313 |
// Convert data if not already a string |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7314 |
if ( s.data && s.processData && typeof s.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
|
7315 |
s.data = jQuery.param( s.data, s.traditional ); |
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 |
// Apply prefilters |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7319 |
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7320 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7321 |
// If request was aborted inside a prefiler, stop there |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7322 |
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
|
7323 |
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
|
7324 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7325 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7326 |
// We can fire global events as of now if asked to |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7327 |
fireGlobals = s.global; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7328 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7329 |
// Uppercase the type |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7330 |
s.type = s.type.toUpperCase(); |
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 |
// Determine if request has content |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7333 |
s.hasContent = !rnoContent.test( s.type ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7334 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7335 |
// Watch for a new set of requests |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7336 |
if ( fireGlobals && jQuery.active++ === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7337 |
jQuery.event.trigger( "ajaxStart" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7338 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7339 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7340 |
// More options handling for requests with no content |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7341 |
if ( !s.hasContent ) { |
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 |
// If data is available, append data to url |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7344 |
if ( s.data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7345 |
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7346 |
// #9682: remove data so that it's not used in an eventual retry |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7347 |
delete s.data; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7350 |
// Get ifModifiedKey before adding the anti-cache parameter |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7351 |
ifModifiedKey = 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
|
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 |
// Add anti-cache in url 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
|
7354 |
if ( 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
|
7355 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7356 |
var ts = 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
|
7357 |
// try replacing _= if it is there |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7358 |
ret = s.url.replace( rts, "$1_=" + ts ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7359 |
|
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 nothing was replaced, add timestamp to the end |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7361 |
s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7362 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7363 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7364 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7365 |
// Set the correct header, if data is being sent |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7366 |
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7367 |
jqXHR.setRequestHeader( "Content-Type", s.contentType ); |
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 |
// 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
|
7371 |
if ( s.ifModified ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7372 |
ifModifiedKey = ifModifiedKey || 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
|
7373 |
if ( jQuery.lastModified[ ifModifiedKey ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7374 |
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); |
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 |
if ( jQuery.etag[ ifModifiedKey ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7377 |
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7378 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7379 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7380 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7381 |
// Set the Accepts header for the server, depending on 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
|
7382 |
jqXHR.setRequestHeader( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7383 |
"Accept", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7384 |
s.dataTypes[ 0 ] && s.accepts[ s.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
|
7385 |
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7386 |
s.accepts[ "*" ] |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7387 |
); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7388 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7389 |
// Check for headers option |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7390 |
for ( i in s.headers ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7391 |
jqXHR.setRequestHeader( i, s.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
|
7392 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7393 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7394 |
// Allow custom headers/mimetypes and early abort |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7395 |
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || 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
|
7396 |
// Abort if not done already |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7397 |
jqXHR.abort(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7398 |
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
|
7399 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7400 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7401 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7402 |
// Install callbacks on deferreds |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7403 |
for ( i in { success: 1, error: 1, complete: 1 } ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7404 |
jqXHR[ i ]( s[ i ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7405 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7406 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7407 |
// Get transport |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7408 |
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7409 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7410 |
// If no transport, we auto-abort |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7411 |
if ( !transport ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7412 |
done( -1, "No Transport" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7413 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7414 |
jqXHR.readyState = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7415 |
// Send global event |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7416 |
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
|
7417 |
globalEventContext.trigger( "ajaxSend", [ 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
|
7418 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7419 |
// Timeout |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7420 |
if ( s.async && s.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
|
7421 |
timeoutTimer = setTimeout( function(){ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7422 |
jqXHR.abort( "timeout" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7423 |
}, s.timeout ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7424 |
} |
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 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7427 |
state = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7428 |
transport.send( requestHeaders, done ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7429 |
} 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
|
7430 |
// Propagate exception as error if not done |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7431 |
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
|
7432 |
done( -1, e ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7433 |
// Simply rethrow otherwise |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7434 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7435 |
jQuery.error( e ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7436 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7437 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7438 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7439 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7440 |
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
|
7441 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7442 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7443 |
// Serialize an array of form elements or a set of |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7444 |
// key/values into a query string |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7445 |
param: function( a, traditional ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7446 |
var s = [], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7447 |
add = function( key, value ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7448 |
// If value is a function, invoke it and return its value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7449 |
value = jQuery.isFunction( value ) ? value() : value; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7450 |
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7451 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7452 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7453 |
// Set traditional to true for jQuery <= 1.3.2 behavior. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7454 |
if ( traditional === undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7455 |
traditional = jQuery.ajaxSettings.traditional; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7456 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7457 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7458 |
// If an array was passed in, assume that it is an array of form elements. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7459 |
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7460 |
// Serialize the form elements |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7461 |
jQuery.each( a, function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7462 |
add( this.name, this.value ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7463 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7464 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7465 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7466 |
// If traditional, encode the "old" way (the way 1.3.2 or older |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7467 |
// did it), otherwise encode params recursively. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7468 |
for ( var prefix in a ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7469 |
buildParams( prefix, a[ prefix ], traditional, add ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7470 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7471 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7472 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7473 |
// Return the resulting serialization |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7474 |
return s.join( "&" ).replace( r20, "+" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7475 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7476 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7477 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7478 |
function buildParams( prefix, obj, traditional, add ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7479 |
if ( jQuery.isArray( obj ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7480 |
// Serialize array item. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7481 |
jQuery.each( obj, function( i, v ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7482 |
if ( traditional || rbracket.test( prefix ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7483 |
// Treat each array item as a scalar. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7484 |
add( prefix, v ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7485 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7486 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7487 |
// If array item is non-scalar (array or object), encode its |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7488 |
// numeric index to resolve deserialization ambiguity issues. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7489 |
// Note that rack (as of 1.0.0) can't currently deserialize |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7490 |
// nested arrays properly, and attempting to do so may cause |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7491 |
// a server error. Possible fixes are to modify rack's |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7492 |
// deserialization algorithm or to provide an option or flag |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7493 |
// to force array serialization to be shallow. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7494 |
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7495 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7496 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7497 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7498 |
} else if ( !traditional && obj != null && typeof obj === "object" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7499 |
// Serialize object item. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7500 |
for ( var name 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
|
7501 |
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7502 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7503 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7504 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7505 |
// Serialize scalar item. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7506 |
add( prefix, obj ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7507 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7508 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7509 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7510 |
// This is still on the jQuery object... for now |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7511 |
// Want to move this to jQuery.ajax some day |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7512 |
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
|
7513 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7514 |
// Counter for holding the number of active queries |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7515 |
active: 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7516 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7517 |
// Last-Modified header cache for next request |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7518 |
lastModified: {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7519 |
etag: {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7520 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7521 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7522 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7523 |
/* 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
|
7524 |
* - sets all responseXXX fields accordingly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7525 |
* - 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
|
7526 |
* - 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
|
7527 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7528 |
function ajaxHandleResponses( s, jqXHR, responses ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7529 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7530 |
var contents = s.contents, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7531 |
dataTypes = s.dataTypes, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7532 |
responseFields = s.responseFields, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7533 |
ct, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7534 |
type, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7535 |
finalDataType, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7536 |
firstDataType; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7537 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7538 |
// Fill responseXXX fields |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7539 |
for( type in responseFields ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7540 |
if ( 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
|
7541 |
jqXHR[ responseFields[type] ] = responses[ type ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7542 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7543 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7544 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7545 |
// 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
|
7546 |
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
|
7547 |
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
|
7548 |
if ( ct === undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7549 |
ct = s.mimeType || jqXHR.getResponseHeader( "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
|
7550 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7551 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7552 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7553 |
// 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
|
7554 |
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
|
7555 |
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
|
7556 |
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
|
7557 |
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
|
7558 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7559 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7560 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7561 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7562 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7563 |
// 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
|
7564 |
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
|
7565 |
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
|
7566 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7567 |
// 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
|
7568 |
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
|
7569 |
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
|
7570 |
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
|
7571 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7572 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7573 |
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
|
7574 |
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
|
7575 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7576 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7577 |
// 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
|
7578 |
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
|
7579 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7580 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7581 |
// 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
|
7582 |
// 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
|
7583 |
// 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
|
7584 |
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
|
7585 |
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
|
7586 |
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
|
7587 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7588 |
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
|
7589 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7590 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7591 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7592 |
// Chain conversions given the request and the original response |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7593 |
function ajaxConvert( s, response ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7594 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7595 |
// Apply the dataFilter 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
|
7596 |
if ( s.dataFilter ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7597 |
response = s.dataFilter( response, s.dataType ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7598 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7599 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7600 |
var dataTypes = s.dataTypes, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7601 |
converters = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7602 |
i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7603 |
key, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7604 |
length = dataTypes.length, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7605 |
tmp, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7606 |
// Current and previous dataTypes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7607 |
current = 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
|
7608 |
prev, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7609 |
// Conversion expression |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7610 |
conversion, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7611 |
// Conversion function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7612 |
conv, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7613 |
// Conversion functions (transitive conversion) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7614 |
conv1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7615 |
conv2; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7616 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7617 |
// For each dataType in the chain |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7618 |
for( i = 1; 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
|
7619 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7620 |
// Create converters map |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7621 |
// with lowercased keys |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7622 |
if ( 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
|
7623 |
for( key in s.converters ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7624 |
if( typeof key === "string" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7625 |
converters[ key.toLowerCase() ] = s.converters[ key ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7626 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7627 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7628 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7629 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7630 |
// Get the dataTypes |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7631 |
prev = current; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7632 |
current = dataTypes[ i ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7633 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7634 |
// If current is auto dataType, update it to prev |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7635 |
if( current === "*" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7636 |
current = prev; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7637 |
// If no auto and dataTypes are actually different |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7638 |
} else if ( prev !== "*" && prev !== current ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7639 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7640 |
// Get the converter |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7641 |
conversion = prev + " " + current; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7642 |
conv = converters[ conversion ] || converters[ "* " + current ]; |
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 |
// If there is no direct converter, search transitively |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7645 |
if ( !conv ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7646 |
conv2 = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7647 |
for( conv1 in converters ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7648 |
tmp = conv1.split( " " ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7649 |
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7650 |
conv2 = converters[ tmp[1] + " " + current ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7651 |
if ( conv2 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7652 |
conv1 = converters[ conv1 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7653 |
if ( conv1 === true ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7654 |
conv = conv2; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7655 |
} else if ( conv2 === true ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7656 |
conv = conv1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7657 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7658 |
break; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7659 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7660 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7661 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7662 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7663 |
// If we found no converter, dispatch an error |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7664 |
if ( !( conv || conv2 ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7665 |
jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7666 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7667 |
// If found converter is not an equivalence |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7668 |
if ( conv !== true ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7669 |
// Convert with 1 or 2 converters accordingly |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7670 |
response = conv ? conv( response ) : conv2( conv1(response) ); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7674 |
return response; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7675 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7676 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7677 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7678 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7679 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7680 |
var jsc = 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
|
7681 |
jsre = /(\=)\?(&|$)|\?\?/i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7682 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7683 |
// Default jsonp settings |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7684 |
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
|
7685 |
jsonp: "callback", |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7686 |
jsonpCallback: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7687 |
return jQuery.expando + "_" + ( jsc++ ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7688 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7689 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7690 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7691 |
// Detect, normalize options and install callbacks for jsonp requests |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7692 |
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7693 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7694 |
var inspectData = s.contentType === "application/x-www-form-urlencoded" && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7695 |
( typeof s.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
|
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 |
if ( s.dataTypes[ 0 ] === "jsonp" || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7698 |
s.jsonp !== false && ( jsre.test( 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
|
7699 |
inspectData && jsre.test( s.data ) ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7700 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7701 |
var responseContainer, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7702 |
jsonpCallback = s.jsonpCallback = |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7703 |
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7704 |
previous = window[ jsonpCallback ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7705 |
url = 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
|
7706 |
data = s.data, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7707 |
replace = "$1" + jsonpCallback + "$2"; |
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 |
if ( s.jsonp !== false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7710 |
url = url.replace( jsre, replace ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7711 |
if ( s.url === url ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7712 |
if ( inspectData ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7713 |
data = data.replace( jsre, replace ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7714 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7715 |
if ( s.data === data ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7716 |
// Add callback manually |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7717 |
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7718 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7719 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7720 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7721 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7722 |
s.url = url; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7723 |
s.data = data; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7724 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7725 |
// Install callback |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7726 |
window[ jsonpCallback ] = function( response ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7727 |
responseContainer = [ response ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7728 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7729 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7730 |
// Clean-up function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7731 |
jqXHR.always(function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7732 |
// Set callback back to previous value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7733 |
window[ jsonpCallback ] = previous; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7734 |
// Call if it was a function and we have a response |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7735 |
if ( responseContainer && jQuery.isFunction( previous ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7736 |
window[ jsonpCallback ]( responseContainer[ 0 ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7737 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7738 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7739 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7740 |
// Use data converter to retrieve json after script execution |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7741 |
s.converters["script json"] = function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7742 |
if ( !responseContainer ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7743 |
jQuery.error( jsonpCallback + " was not called" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7744 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7745 |
return responseContainer[ 0 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7746 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7747 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7748 |
// force json dataType |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7749 |
s.dataTypes[ 0 ] = "json"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7750 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7751 |
// Delegate to script |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7752 |
return "script"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7753 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7754 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7755 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7756 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7757 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7758 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7759 |
// 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
|
7760 |
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
|
7761 |
accepts: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7762 |
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
|
7763 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7764 |
contents: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7765 |
script: /javascript|ecmascript/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7766 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7767 |
converters: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7768 |
"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
|
7769 |
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
|
7770 |
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
|
7771 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7772 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7775 |
// 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
|
7776 |
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
|
7777 |
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
|
7778 |
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
|
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 |
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
|
7781 |
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
|
7782 |
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
|
7783 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7784 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7785 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7786 |
// 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
|
7787 |
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
|
7788 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7789 |
// 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
|
7790 |
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
|
7791 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7792 |
var script, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7793 |
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7794 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7795 |
return { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7796 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7797 |
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
|
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 |
script = document.createElement( "script" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7800 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7801 |
script.async = "async"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7802 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7803 |
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
|
7804 |
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
|
7805 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7806 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7807 |
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
|
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 |
// 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
|
7810 |
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
|
7811 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7812 |
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
|
7813 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7814 |
// 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
|
7815 |
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
|
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 |
// Remove the script |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7818 |
if ( head && script.parentNode ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7819 |
head.removeChild( script ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7820 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7821 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7822 |
// Dereference the script |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7823 |
script = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7824 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7825 |
// 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
|
7826 |
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
|
7827 |
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
|
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7830 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7831 |
// Use insertBefore instead of appendChild to circumvent an IE6 bug. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7832 |
// This arises when a base node is used (#2709 and #4378). |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7833 |
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
|
7834 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7835 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7836 |
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
|
7837 |
if ( script ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7838 |
script.onload( 0, 1 ); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7841 |
}; |
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 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7844 |
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7848 |
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7849 |
xhrOnUnloadAbort = window.ActiveXObject ? function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7850 |
// Abort all pending requests |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7851 |
for ( var key in xhrCallbacks ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7852 |
xhrCallbacks[ key ]( 0, 1 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7853 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7854 |
} : false, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7855 |
xhrId = 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7856 |
xhrCallbacks; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7857 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7858 |
// 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
|
7859 |
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
|
7860 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7861 |
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
|
7862 |
} 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
|
7863 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7864 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7865 |
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
|
7866 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7867 |
return new window.ActiveXObject( "Microsoft.XMLHTTP" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7868 |
} 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
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7871 |
// 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
|
7872 |
// (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
|
7873 |
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
|
7874 |
/* 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
|
7875 |
* 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
|
7876 |
* 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
|
7877 |
* 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
|
7878 |
* 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
|
7879 |
*/ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7880 |
function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7881 |
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
|
7882 |
} : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7883 |
// 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
|
7884 |
createStandardXHR; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7885 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7886 |
// Determine support properties |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7887 |
(function( xhr ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7888 |
jQuery.extend( jQuery.support, { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7889 |
ajax: !!xhr, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7890 |
cors: !!xhr && ( "withCredentials" in xhr ) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7891 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7892 |
})( jQuery.ajaxSettings.xhr() ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7893 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7894 |
// Create transport if the browser can provide an xhr |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7895 |
if ( jQuery.support.ajax ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7896 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7897 |
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
|
7898 |
// 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
|
7899 |
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
|
7900 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7901 |
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
|
7902 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7903 |
return { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7904 |
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
|
7905 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7906 |
// Get a new xhr |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7907 |
var xhr = s.xhr(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7908 |
handle, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7909 |
i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7910 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7911 |
// 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
|
7912 |
// 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
|
7913 |
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
|
7914 |
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
|
7915 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7916 |
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
|
7917 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7918 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7919 |
// 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
|
7920 |
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
|
7921 |
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
|
7922 |
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
|
7923 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7924 |
} |
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 |
// 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
|
7927 |
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
|
7928 |
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
|
7929 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7930 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7931 |
// 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
|
7932 |
// 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
|
7933 |
// 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
|
7934 |
// (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
|
7935 |
// 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
|
7936 |
if ( !s.crossDomain && !headers["X-Requested-With"] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7937 |
headers[ "X-Requested-With" ] = "XMLHttpRequest"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7938 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7939 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7940 |
// 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
|
7941 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7942 |
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
|
7943 |
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
|
7944 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7945 |
} catch( _ ) {} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7946 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7947 |
// 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
|
7948 |
// 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
|
7949 |
// 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
|
7950 |
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
|
7951 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7952 |
// Listener |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7953 |
callback = 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
|
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 |
var status, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7956 |
statusText, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7957 |
responseHeaders, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7958 |
responses, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7959 |
xml; |
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 |
// Firefox throws exceptions when accessing properties |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7962 |
// of an xhr when a network error occured |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7963 |
// 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
|
7964 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7965 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7966 |
// 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
|
7967 |
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
|
7968 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7969 |
// 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
|
7970 |
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
|
7971 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7972 |
// 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
|
7973 |
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
|
7974 |
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
|
7975 |
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
|
7976 |
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
|
7977 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7978 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7979 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7980 |
// 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
|
7981 |
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
|
7982 |
// 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
|
7983 |
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
|
7984 |
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
|
7985 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7986 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7987 |
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
|
7988 |
responseHeaders = xhr.getAllResponseHeaders(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7989 |
responses = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7990 |
xml = xhr.responseXML; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7991 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7992 |
// Construct response list |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7993 |
if ( xml && xml.documentElement /* #4958 */ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7994 |
responses.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
|
7995 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7996 |
responses.text = xhr.responseText; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7997 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
7998 |
// 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
|
7999 |
// 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
|
8000 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8001 |
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
|
8002 |
} 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
|
8003 |
// 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
|
8004 |
statusText = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8005 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8006 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8007 |
// 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
|
8008 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8009 |
// 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
|
8010 |
// (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
|
8011 |
// 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
|
8012 |
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
|
8013 |
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
|
8014 |
// 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
|
8015 |
} 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
|
8016 |
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
|
8017 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8018 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8019 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8020 |
} 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
|
8021 |
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
|
8022 |
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
|
8023 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8024 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8025 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8026 |
// 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
|
8027 |
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
|
8028 |
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
|
8029 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8030 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8031 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8032 |
// if we're in sync mode or it's in cache |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8033 |
// and has been retrieved directly (IE6 & IE7) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8034 |
// we need to manually fire the callback |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8035 |
if ( !s.async || 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
|
8036 |
callback(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8037 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8038 |
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
|
8039 |
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
|
8040 |
// 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
|
8041 |
// 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
|
8042 |
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
|
8043 |
xhrCallbacks = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8044 |
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
|
8045 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8046 |
// 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
|
8047 |
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
|
8048 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8049 |
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
|
8050 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8051 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8052 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8053 |
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
|
8054 |
if ( callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8055 |
callback(0,1); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8056 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8057 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8058 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8059 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8060 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8061 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8062 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8063 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8064 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8065 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8066 |
var elemdisplay = {}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8067 |
iframe, iframeDoc, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8068 |
rfxtypes = /^(?:toggle|show|hide)$/, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8069 |
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8070 |
timerId, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8071 |
fxAttrs = [ |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8072 |
// height animations |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8073 |
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8074 |
// width animations |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8075 |
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8076 |
// opacity animations |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8077 |
[ "opacity" ] |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8078 |
], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8079 |
fxNow; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8080 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8081 |
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
|
8082 |
show: 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
|
8083 |
var elem, display; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8084 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8085 |
if ( speed || speed === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8086 |
return this.animate( genFx("show", 3), 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
|
8087 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8088 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8089 |
for ( var i = 0, j = this.length; i < j; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8090 |
elem = 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
|
8091 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8092 |
if ( 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
|
8093 |
display = elem.style.display; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8094 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8095 |
// Reset the inline display of this element to learn if it is |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8096 |
// being hidden by cascaded rules or not |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8097 |
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8098 |
display = elem.style.display = ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8099 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8100 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8101 |
// Set elements which have been overridden with display: none |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8102 |
// in a stylesheet to whatever the default browser style is |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8103 |
// for such an element |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8104 |
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8105 |
jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName)); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8106 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8107 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8108 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8109 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8110 |
// Set the display of most of the elements in a second loop |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8111 |
// to avoid the constant reflow |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8112 |
for ( i = 0; i < j; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8113 |
elem = 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
|
8114 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8115 |
if ( 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
|
8116 |
display = elem.style.display; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8117 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8118 |
if ( display === "" || display === "none" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8119 |
elem.style.display = jQuery._data(elem, "olddisplay") || ""; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8120 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8121 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8122 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8123 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8124 |
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
|
8125 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8126 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8127 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8128 |
hide: 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
|
8129 |
if ( speed || speed === 0 ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8130 |
return this.animate( genFx("hide", 3), 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
|
8131 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8132 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8133 |
for ( var i = 0, j = this.length; i < j; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8134 |
if ( this[i].style ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8135 |
var display = jQuery.css( this[i], "display" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8136 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8137 |
if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8138 |
jQuery._data( this[i], "olddisplay", display ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8139 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8140 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8141 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8142 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8143 |
// Set the display of the elements in a second loop |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8144 |
// to avoid the constant reflow |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8145 |
for ( i = 0; i < j; i++ ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8146 |
if ( this[i].style ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8147 |
this[i].style.display = "none"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8148 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8149 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8150 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8151 |
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
|
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 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8154 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8155 |
// Save the old toggle function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8156 |
_toggle: jQuery.fn.toggle, |
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 |
toggle: function( fn, fn2, callback ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8159 |
var bool = typeof fn === "boolean"; |
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 |
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8162 |
this._toggle.apply( this, arguments ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8163 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8164 |
} else if ( fn == null || bool ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8165 |
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
|
8166 |
var state = bool ? fn : jQuery(this).is(":hidden"); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8167 |
jQuery(this)[ state ? "show" : "hide" ](); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8168 |
}); |
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8171 |
this.animate(genFx("toggle", 3), fn, fn2, callback); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8174 |
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
|
8175 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8176 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8177 |
fadeTo: function( speed, to, 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
|
8178 |
return this.filter(":hidden").css("opacity", 0).show().end() |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8179 |
.animate({opacity: to}, 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
|
8180 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8181 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8182 |
animate: function( prop, 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
|
8183 |
var optall = jQuery.speed(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
|
8184 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8185 |
if ( jQuery.isEmptyObject( prop ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8186 |
return this.each( optall.complete, [ false ] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8187 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8188 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8189 |
// Do not change referenced properties as per-property easing will be lost |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8190 |
prop = jQuery.extend( {}, prop ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8191 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8192 |
return this[ optall.queue === false ? "each" : "queue" ](function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8193 |
// XXX 'this' does not always have a nodeName when running the |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8194 |
// test suite |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8195 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8196 |
if ( optall.queue === false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8197 |
jQuery._mark( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8198 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8199 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8200 |
var opt = jQuery.extend( {}, optall ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8201 |
isElement = 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
|
8202 |
hidden = isElement && jQuery(this).is(":hidden"), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8203 |
name, val, p, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8204 |
display, e, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8205 |
parts, start, end, unit; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8206 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8207 |
// will store per property easing and be used to determine when an animation is complete |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8208 |
opt.animatedProperties = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8209 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8210 |
for ( p in prop ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8211 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8212 |
// property name normalization |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8213 |
name = jQuery.camelCase( p ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8214 |
if ( p !== name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8215 |
prop[ name ] = prop[ p ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8216 |
delete prop[ p ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8217 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8218 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8219 |
val = prop[ name ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8220 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8221 |
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8222 |
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
|
8223 |
opt.animatedProperties[ name ] = val[ 1 ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8224 |
val = prop[ name ] = val[ 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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8226 |
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing'; |
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 |
if ( val === "hide" && hidden || val === "show" && !hidden ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8230 |
return opt.complete.call( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8231 |
} |
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 |
if ( isElement && ( name === "height" || name === "width" ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8234 |
// Make sure that nothing sneaks out |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8235 |
// Record all 3 overflow attributes because IE does not |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8236 |
// change the overflow attribute when overflowX and |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8237 |
// overflowY are set to the same value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8238 |
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; |
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 |
// Set display property to inline-block for height/width |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8241 |
// animations on inline elements that are having width/height |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8242 |
// animated |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8243 |
if ( jQuery.css( this, "display" ) === "inline" && |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8244 |
jQuery.css( this, "float" ) === "none" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8245 |
if ( !jQuery.support.inlineBlockNeedsLayout ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8246 |
this.style.display = "inline-block"; |
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 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8249 |
display = defaultDisplay( this.nodeName ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8250 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8251 |
// inline-level elements accept inline-block; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8252 |
// block-level elements need to be inline with layout |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8253 |
if ( display === "inline" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8254 |
this.style.display = "inline-block"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8255 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8256 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8257 |
this.style.display = "inline"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8258 |
this.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
|
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 |
} |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8264 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8265 |
if ( opt.overflow != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8266 |
this.style.overflow = "hidden"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8267 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8268 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8269 |
for ( p in prop ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8270 |
e = new jQuery.fx( this, opt, p ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8271 |
val = prop[ p ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8272 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8273 |
if ( rfxtypes.test(val) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8274 |
e[ val === "toggle" ? hidden ? "show" : "hide" : val ](); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8275 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8276 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8277 |
parts = rfxnum.exec( val ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8278 |
start = e.cur(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8279 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8280 |
if ( parts ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8281 |
end = parseFloat( parts[2] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8282 |
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8283 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8284 |
// We need to compute starting value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8285 |
if ( unit !== "px" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8286 |
jQuery.style( this, p, (end || 1) + unit); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8287 |
start = ((end || 1) / e.cur()) * start; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8288 |
jQuery.style( this, p, start + unit); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8289 |
} |
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 |
// If a +=/-= token was provided, we're doing a relative animation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8292 |
if ( parts[1] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8293 |
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8294 |
} |
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 |
e.custom( start, end, unit ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8297 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8298 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8299 |
e.custom( start, val, "" ); |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8302 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8303 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8304 |
// For JS strict compliance |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8305 |
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
|
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 |
stop: function( clearQueue, gotoEnd ) { |
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 ( clearQueue ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8311 |
this.queue([]); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8312 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8313 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8314 |
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
|
8315 |
var timers = jQuery.timers, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8316 |
i = timers.length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8317 |
// clear marker counters if we know they won'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
|
8318 |
if ( !gotoEnd ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8319 |
jQuery._unmark( true, this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8320 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8321 |
while ( i-- ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8322 |
if ( timers[i].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
|
8323 |
if (gotoEnd) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8324 |
// force the next step to be the last |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8325 |
timers[i](true); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8326 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8327 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8328 |
timers.splice(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
|
8329 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8330 |
} |
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 |
// start the next in the queue if the last step wasn't forced |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8334 |
if ( !gotoEnd ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8335 |
this.dequeue(); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8338 |
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
|
8339 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8340 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8341 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8342 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8343 |
// 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
|
8344 |
function createFxNow() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8345 |
setTimeout( clearFxNow, 0 ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8346 |
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
|
8347 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8348 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8349 |
function clearFxNow() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8350 |
fxNow = undefined; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8351 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8352 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8353 |
// Generate parameters to create a standard animation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8354 |
function genFx( type, num ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8355 |
var obj = {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8356 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8357 |
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8358 |
obj[ 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
|
8359 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8360 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8361 |
return obj; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8362 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8363 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8364 |
// 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
|
8365 |
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
|
8366 |
slideDown: genFx("show", 1), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8367 |
slideUp: genFx("hide", 1), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8368 |
slideToggle: genFx("toggle", 1), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8369 |
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
|
8370 |
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
|
8371 |
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
|
8372 |
}, 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
|
8373 |
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
|
8374 |
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
|
8375 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8376 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8377 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8378 |
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
|
8379 |
speed: function( speed, easing, fn ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8380 |
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8381 |
complete: fn || !fn && easing || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8382 |
jQuery.isFunction( speed ) && speed, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8383 |
duration: speed, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8384 |
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8385 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8386 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8387 |
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8388 |
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8389 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8390 |
// Queueing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8391 |
opt.old = opt.complete; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8392 |
opt.complete = function( noUnmark ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8393 |
if ( jQuery.isFunction( opt.old ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8394 |
opt.old.call( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8395 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8396 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8397 |
if ( opt.queue !== false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8398 |
jQuery.dequeue( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8399 |
} else if ( noUnmark !== false ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8400 |
jQuery._unmark( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8401 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8402 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8403 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8404 |
return opt; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8405 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8406 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8407 |
easing: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8408 |
linear: function( p, n, firstNum, diff ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8409 |
return firstNum + diff * p; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8410 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8411 |
swing: function( p, n, firstNum, diff ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8412 |
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8413 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8414 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8415 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8416 |
timers: [], |
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 |
fx: function( elem, options, prop ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8419 |
this.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
|
8420 |
this.elem = elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8421 |
this.prop = prop; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8422 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8423 |
options.orig = options.orig || {}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8424 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8425 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8426 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8427 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8428 |
jQuery.fx.prototype = { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8429 |
// Simple function for setting a style value |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8430 |
update: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8431 |
if ( this.options.step ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8432 |
this.options.step.call( this.elem, this.now, this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8433 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8434 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8435 |
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8436 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8437 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8438 |
// Get the current size |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8439 |
cur: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8440 |
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8441 |
return this.elem[ this.prop ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8442 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8443 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8444 |
var parsed, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8445 |
r = jQuery.css( this.elem, this.prop ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8446 |
// Empty strings, null, undefined and "auto" are converted to 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8447 |
// complex values such as "rotate(1rad)" are returned as is, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8448 |
// simple values such as "10px" are parsed to Float. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8449 |
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8450 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8451 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8452 |
// Start an animation from one number to another |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8453 |
custom: function( from, to, unit ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8454 |
var self = this, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8455 |
fx = jQuery.fx; |
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 |
this.startTime = fxNow || createFxNow(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8458 |
this.start = from; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8459 |
this.end = to; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8460 |
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8461 |
this.now = this.start; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8462 |
this.pos = this.state = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8463 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8464 |
function t( gotoEnd ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8465 |
return self.step(gotoEnd); |
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 |
t.elem = this.elem; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8469 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8470 |
if ( t() && jQuery.timers.push(t) && !timerId ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8471 |
timerId = setInterval( fx.tick, fx.interval ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8472 |
} |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8475 |
// Simple 'show' function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8476 |
show: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8477 |
// Remember where we started, so that we can go back to it later |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8478 |
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8479 |
this.options.show = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8480 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8481 |
// Begin the animation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8482 |
// Make sure that we start at a small width/height to avoid any |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8483 |
// flash of content |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8484 |
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8485 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8486 |
// Start by showing 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
|
8487 |
jQuery( this.elem ).show(); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8490 |
// Simple 'hide' function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8491 |
hide: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8492 |
// Remember where we started, so that we can go back to it later |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8493 |
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8494 |
this.options.hide = true; |
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 |
// Begin the animation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8497 |
this.custom(this.cur(), 0); |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8500 |
// Each step of an animation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8501 |
step: function( gotoEnd ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8502 |
var t = fxNow || createFxNow(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8503 |
done = true, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8504 |
elem = this.elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8505 |
options = this.options, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8506 |
i, n; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8507 |
|
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 ( gotoEnd || t >= options.duration + this.startTime ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8509 |
this.now = this.end; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8510 |
this.pos = this.state = 1; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8511 |
this.update(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8512 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8513 |
options.animatedProperties[ this.prop ] = true; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8514 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8515 |
for ( i in options.animatedProperties ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8516 |
if ( options.animatedProperties[i] !== true ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8517 |
done = false; |
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8520 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8521 |
if ( done ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8522 |
// Reset the overflow |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8523 |
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { |
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 |
jQuery.each( [ "", "X", "Y" ], function (index, value) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8526 |
elem.style[ "overflow" + value ] = options.overflow[index]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8527 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8528 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8529 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8530 |
// Hide the element if the "hide" operation was done |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8531 |
if ( options.hide ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8532 |
jQuery(elem).hide(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8533 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8534 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8535 |
// Reset the properties, if the item has been hidden or shown |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8536 |
if ( options.hide || options.show ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8537 |
for ( var p in options.animatedProperties ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8538 |
jQuery.style( elem, p, options.orig[p] ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8539 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8540 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8541 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8542 |
// Execute the complete function |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8543 |
options.complete.call( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8544 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8545 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8546 |
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
|
8547 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8548 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8549 |
// classical easing cannot be used with an Infinity duration |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8550 |
if ( options.duration == Infinity ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8551 |
this.now = t; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8552 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8553 |
n = t - this.startTime; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8554 |
this.state = n / options.duration; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8555 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8556 |
// Perform the easing function, defaults to swing |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8557 |
this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8558 |
this.now = this.start + ((this.end - this.start) * this.pos); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8559 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8560 |
// Perform the next step of the animation |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8561 |
this.update(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8562 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8563 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8564 |
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
|
8565 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8566 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8567 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8568 |
jQuery.extend( jQuery.fx, { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8569 |
tick: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8570 |
for ( var timers = jQuery.timers, i = 0 ; i < timers.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
|
8571 |
if ( !timers[i]() ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8572 |
timers.splice(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
|
8573 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8574 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8575 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8576 |
if ( !timers.length ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8577 |
jQuery.fx.stop(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8578 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8579 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8580 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8581 |
interval: 13, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8582 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8583 |
stop: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8584 |
clearInterval( timerId ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8585 |
timerId = null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8586 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8587 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8588 |
speeds: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8589 |
slow: 600, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8590 |
fast: 200, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8591 |
// Default speed |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8592 |
_default: 400 |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8593 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8594 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8595 |
step: { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8596 |
opacity: function( fx ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8597 |
jQuery.style( fx.elem, "opacity", fx.now ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8598 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8599 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8600 |
_default: function( fx ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8601 |
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8602 |
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8603 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8604 |
fx.elem[ fx.prop ] = fx.now; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8605 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8606 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8607 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8608 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8609 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8610 |
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
|
8611 |
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
|
8612 |
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
|
8613 |
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
|
8614 |
}).length; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8615 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8616 |
} |
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 |
// Try to restore the default display value of an element |
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 defaultDisplay( nodeName ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8620 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8621 |
if ( !elemdisplay[ nodeName ] ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8622 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8623 |
var body = document.body, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8624 |
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8625 |
display = elem.css( "display" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8626 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8627 |
elem.remove(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8628 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8629 |
// If the simple way fails, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8630 |
// get element's real default display by attaching it to a temp iframe |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8631 |
if ( display === "none" || display === "" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8632 |
// No iframe to use yet, so create it |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8633 |
if ( !iframe ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8634 |
iframe = document.createElement( "iframe" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8635 |
iframe.frameBorder = iframe.width = iframe.height = 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8636 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8637 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8638 |
body.appendChild( iframe ); |
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 |
// Create a cacheable copy of the iframe document on first call. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8641 |
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8642 |
// document to it; WebKit & Firefox won't allow reusing the iframe document. |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8643 |
if ( !iframeDoc || !iframe.createElement ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8644 |
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8645 |
iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8646 |
iframeDoc.close(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8647 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8648 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8649 |
elem = iframeDoc.createElement( nodeName ); |
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 |
iframeDoc.body.appendChild( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8652 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8653 |
display = jQuery.css( elem, "display" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8654 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8655 |
body.removeChild( iframe ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8656 |
} |
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 |
// Store the correct default display |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8659 |
elemdisplay[ nodeName ] = display; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8660 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8661 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8662 |
return elemdisplay[ nodeName ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8663 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8664 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8665 |
|
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8668 |
var rtable = /^t(?:able|d|h)$/i, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8669 |
rroot = /^(?:body|html)$/i; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8670 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8671 |
if ( "getBoundingClientRect" in document.documentElement ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8672 |
jQuery.fn.offset = function( options ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8673 |
var elem = this[0], box; |
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 |
if ( options ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8676 |
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
|
8677 |
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
|
8678 |
}); |
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 |
if ( !elem || !elem.ownerDocument ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8682 |
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
|
8683 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8684 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8685 |
if ( elem === elem.ownerDocument.body ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8686 |
return jQuery.offset.bodyOffset( elem ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8687 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8688 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8689 |
try { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8690 |
box = elem.getBoundingClientRect(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8691 |
} 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
|
8692 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8693 |
var doc = elem.ownerDocument, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8694 |
docElem = doc.documentElement; |
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 |
// Make sure we're not dealing with a disconnected 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
|
8697 |
if ( !box || !jQuery.contains( docElem, elem ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8698 |
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8699 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8700 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8701 |
var body = doc.body, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8702 |
win = getWindow(doc), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8703 |
clientTop = docElem.clientTop || body.clientTop || 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8704 |
clientLeft = docElem.clientLeft || body.clientLeft || 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8705 |
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8706 |
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8707 |
top = box.top + scrollTop - clientTop, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8708 |
left = box.left + scrollLeft - clientLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8709 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8710 |
return { top: top, left: left }; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8713 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8714 |
jQuery.fn.offset = function( options ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8715 |
var elem = 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
|
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 |
if ( options ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8718 |
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
|
8719 |
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
|
8720 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8721 |
} |
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 |
if ( !elem || !elem.ownerDocument ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8724 |
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
|
8725 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8726 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8727 |
if ( elem === elem.ownerDocument.body ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8728 |
return jQuery.offset.bodyOffset( elem ); |
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 |
jQuery.offset.initialize(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8732 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8733 |
var computedStyle, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8734 |
offsetParent = elem.offsetParent, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8735 |
prevOffsetParent = elem, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8736 |
doc = elem.ownerDocument, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8737 |
docElem = doc.documentElement, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8738 |
body = doc.body, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8739 |
defaultView = doc.defaultView, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8740 |
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8741 |
top = elem.offsetTop, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8742 |
left = elem.offsetLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8743 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8744 |
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8745 |
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8746 |
break; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8749 |
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8750 |
top -= elem.scrollTop; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8751 |
left -= elem.scrollLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8752 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8753 |
if ( elem === offsetParent ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8754 |
top += elem.offsetTop; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8755 |
left += elem.offsetLeft; |
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 |
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8758 |
top += parseFloat( computedStyle.borderTopWidth ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8759 |
left += parseFloat( computedStyle.borderLeftWidth ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8760 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8761 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8762 |
prevOffsetParent = offsetParent; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8763 |
offsetParent = elem.offsetParent; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8764 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8765 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8766 |
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8767 |
top += parseFloat( computedStyle.borderTopWidth ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8768 |
left += parseFloat( computedStyle.borderLeftWidth ) || 0; |
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 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8771 |
prevComputedStyle = computedStyle; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8772 |
} |
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 |
if ( prevComputedStyle.position === "relative" || prevComputedStyle.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
|
8775 |
top += body.offsetTop; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8776 |
left += body.offsetLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8777 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8778 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8779 |
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8780 |
top += Math.max( docElem.scrollTop, body.scrollTop ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8781 |
left += Math.max( docElem.scrollLeft, body.scrollLeft ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8782 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8783 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8784 |
return { top: top, left: left }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8785 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8786 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8787 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8788 |
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
|
8789 |
initialize: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8790 |
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8791 |
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8792 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8793 |
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8794 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8795 |
container.innerHTML = html; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8796 |
body.insertBefore( container, body.firstChild ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8797 |
innerDiv = container.firstChild; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8798 |
checkDiv = innerDiv.firstChild; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8799 |
td = innerDiv.nextSibling.firstChild.firstChild; |
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 |
this.doesNotAddBorder = (checkDiv.offsetTop !== 5); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8802 |
this.doesAddBorderForTableAndCells = (td.offsetTop === 5); |
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 |
checkDiv.style.position = "fixed"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8805 |
checkDiv.style.top = "20px"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8806 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8807 |
// safari subtracts parent border width here which is 5px |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8808 |
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8809 |
checkDiv.style.position = checkDiv.style.top = ""; |
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 |
innerDiv.style.overflow = "hidden"; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8812 |
innerDiv.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
|
8813 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8814 |
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8815 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8816 |
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8817 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8818 |
body.removeChild( container ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8819 |
jQuery.offset.initialize = 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
|
8820 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8821 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8822 |
bodyOffset: function( body ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8823 |
var top = body.offsetTop, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8824 |
left = body.offsetLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8825 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8826 |
jQuery.offset.initialize(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8827 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8828 |
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8829 |
top += parseFloat( jQuery.css(body, "marginTop") ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8830 |
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8831 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8832 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8833 |
return { top: top, left: left }; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8834 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8835 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8836 |
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
|
8837 |
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
|
8838 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8839 |
// 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
|
8840 |
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
|
8841 |
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
|
8842 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8843 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8844 |
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
|
8845 |
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
|
8846 |
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
|
8847 |
curCSSLeft = jQuery.css( elem, "left" ), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8848 |
calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8849 |
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
|
8850 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8851 |
// 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
|
8852 |
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
|
8853 |
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
|
8854 |
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
|
8855 |
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
|
8856 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8857 |
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
|
8858 |
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
|
8859 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8860 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8861 |
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
|
8862 |
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
|
8863 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8864 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8865 |
if (options.top != null) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8866 |
props.top = (options.top - curOffset.top) + curTop; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8867 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8868 |
if (options.left != null) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8869 |
props.left = (options.left - curOffset.left) + curLeft; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8870 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8871 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8872 |
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
|
8873 |
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
|
8874 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8875 |
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
|
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 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8878 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8879 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8880 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8881 |
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
|
8882 |
position: function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8883 |
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
|
8884 |
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
|
8885 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8886 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8887 |
var elem = 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
|
8888 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8889 |
// Get *real* offsetParent |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8890 |
offsetParent = this.offsetParent(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8891 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8892 |
// Get correct offsets |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8893 |
offset = this.offset(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8894 |
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8895 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8896 |
// Subtract element margins |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8897 |
// 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
|
8898 |
// 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
|
8899 |
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8900 |
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8901 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8902 |
// Add offsetParent borders |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8903 |
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8904 |
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8905 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8906 |
// Subtract the two offsets |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8907 |
return { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8908 |
top: offset.top - parentOffset.top, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8909 |
left: offset.left - parentOffset.left |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8910 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8911 |
}, |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8912 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8913 |
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
|
8914 |
return this.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
|
8915 |
var offsetParent = this.offsetParent || document.body; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8916 |
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "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
|
8917 |
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
|
8918 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8919 |
return offsetParent; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8920 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8921 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8922 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8923 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8924 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8925 |
// Create scrollLeft and scrollTop methods |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8926 |
jQuery.each( ["Left", "Top"], function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8927 |
var method = "scroll" + name; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8928 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8929 |
jQuery.fn[ method ] = function( val ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8930 |
var elem, win; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8931 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8932 |
if ( val === undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8933 |
elem = 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
|
8934 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8935 |
if ( !elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8936 |
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
|
8937 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8938 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8939 |
win = 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
|
8940 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8941 |
// Return the scroll offset |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8942 |
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8943 |
jQuery.support.boxModel && win.document.documentElement[ method ] || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8944 |
win.document.body[ method ] : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8945 |
elem[ method ]; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8946 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8947 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8948 |
// Set the scroll offset |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8949 |
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
|
8950 |
win = getWindow( this ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8951 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8952 |
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
|
8953 |
win.scrollTo( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8954 |
!i ? val : jQuery( win ).scrollLeft(), |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8955 |
i ? val : jQuery( win ).scrollTop() |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8956 |
); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8957 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8958 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8959 |
this[ method ] = val; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8960 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8961 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8962 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8963 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8964 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8965 |
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
|
8966 |
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
|
8967 |
elem : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8968 |
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
|
8969 |
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
|
8970 |
false; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8971 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8972 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8973 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8974 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8975 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8976 |
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8977 |
jQuery.each([ "Height", "Width" ], function( i, name ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8978 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8979 |
var type = 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
|
8980 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8981 |
// innerHeight and innerWidth |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8982 |
jQuery.fn[ "inner" + name ] = function() { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8983 |
var elem = 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
|
8984 |
return elem && 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
|
8985 |
parseFloat( jQuery.css( elem, type, "padding" ) ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8986 |
null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8987 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8988 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8989 |
// outerHeight and outerWidth |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8990 |
jQuery.fn[ "outer" + name ] = function( margin ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8991 |
var elem = 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
|
8992 |
return elem && 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
|
8993 |
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8994 |
null; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8995 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8996 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8997 |
jQuery.fn[ type ] = function( size ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8998 |
// Get window width or height |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
8999 |
var elem = 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
|
9000 |
if ( !elem ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9001 |
return size == null ? null : this; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9002 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9003 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9004 |
if ( jQuery.isFunction( size ) ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9005 |
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
|
9006 |
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
|
9007 |
self[ type ]( size.call( this, i, self[ type ]() ) ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9008 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9009 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9010 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9011 |
if ( 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
|
9012 |
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9013 |
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9014 |
var docElemProp = elem.document.documentElement[ "client" + name ], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9015 |
body = elem.document.body; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9016 |
return elem.document.compatMode === "CSS1Compat" && docElemProp || |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9017 |
body && body[ "client" + name ] || docElemProp; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9018 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9019 |
// Get document width or height |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9020 |
} else if ( 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
|
9021 |
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9022 |
return Math.max( |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9023 |
elem.documentElement["client" + name], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9024 |
elem.body["scroll" + name], elem.documentElement["scroll" + name], |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9025 |
elem.body["offset" + name], elem.documentElement["offset" + name] |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9026 |
); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9027 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9028 |
// Get or set width or height on 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
|
9029 |
} else if ( size === undefined ) { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9030 |
var orig = jQuery.css( 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
|
9031 |
ret = parseFloat( orig ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9032 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9033 |
return jQuery.isNaN( ret ) ? orig : ret; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9034 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9035 |
// Set the width or height on the element (default to pixels if value is unitless) |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9036 |
} else { |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9037 |
return this.css( type, typeof size === "string" ? size : size + "px" ); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9038 |
} |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9039 |
}; |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9040 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9041 |
}); |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9042 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9043 |
|
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9044 |
// Expose jQuery to the global object |
e95cfd5eca61
[js] closes #1558870 : update to jquery 1.6 (1.6.3)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7303
diff
changeset
|
9045 |
window.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
|
9046 |
})(window); |