| author | ymh <ymh.work@gmail.com> |
| Fri, 06 May 2011 02:12:30 +0200 | |
| changeset 104 | 16c793110f40 |
| parent 101 | 0b8e098398de |
| permissions | -rw-r--r-- |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
/*! |
| 101 | 2 |
* jQuery JavaScript Library v1.6 |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
* http://jquery.com/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
* |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
* Copyright 2011, John Resig |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
* Dual licensed under the MIT or GPL Version 2 licenses. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
* http://jquery.org/license |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
* |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
* Includes Sizzle.js |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
* http://sizzlejs.com/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
* Copyright 2011, The Dojo Foundation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
* Released under the MIT, BSD, and GPL Licenses. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
* |
| 101 | 14 |
* Date: Mon May 2 13:50:00 2011 -0400 |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
*/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
(function( window, undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
// Use the correct document accordingly with window argument (sandbox) |
| 101 | 19 |
var document = window.document, |
20 |
navigator = window.navigator, |
|
21 |
location = window.location; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
var jQuery = (function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
// Define a local copy of jQuery |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
var jQuery = function( selector, context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
// The jQuery object is actually just the init constructor 'enhanced' |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
return new jQuery.fn.init( selector, context, rootjQuery ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
// Map over jQuery in case of overwrite |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
_jQuery = window.jQuery, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
// Map over the $ in case of overwrite |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
_$ = window.$, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
// A central reference to the root jQuery(document) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
rootjQuery, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
// A simple way to check for HTML strings or ID strings |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
// (both of which we optimize for) |
| 101 | 41 |
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
// Check if a string has a non-whitespace character in it |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
rnotwhite = /\S/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
// Used for trimming whitespace |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
trimLeft = /^\s+/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
trimRight = /\s+$/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
// Check for digits |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
51 |
rdigit = /\d/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
// Match a standalone tag |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
// JSON RegExp |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
rvalidchars = /^[\],:{}\s]*$/,
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
60 |
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
61 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
62 |
// Useragent RegExp |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
rwebkit = /(webkit)[ \/]([\w.]+)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
64 |
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
rmsie = /(msie) ([\w.]+)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
66 |
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
// Keep a UserAgent string for use with jQuery.browser |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
userAgent = navigator.userAgent, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
// For matching the engine and version of the browser |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
browserMatch, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
// The deferred used on DOM ready |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
readyList, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
76 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
77 |
// The ready event handler |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
DOMContentLoaded, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
80 |
// Save a reference to some core methods |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
toString = Object.prototype.toString, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
hasOwn = Object.prototype.hasOwnProperty, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
push = Array.prototype.push, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
slice = Array.prototype.slice, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
85 |
trim = String.prototype.trim, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
86 |
indexOf = Array.prototype.indexOf, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
// [[Class]] -> type pairs |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
class2type = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
jQuery.fn = jQuery.prototype = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
constructor: jQuery, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
93 |
init: function( selector, context, rootjQuery ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
94 |
var match, elem, ret, doc; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
95 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
// Handle $(""), $(null), or $(undefined)
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
97 |
if ( !selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
98 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
// Handle $(DOMElement) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
if ( selector.nodeType ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
103 |
this.context = this[0] = selector; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
104 |
this.length = 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
106 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
107 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
108 |
// The body element only exists once, optimize finding it |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
109 |
if ( selector === "body" && !context && document.body ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
110 |
this.context = document; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
111 |
this[0] = document.body; |
| 101 | 112 |
this.selector = selector; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
113 |
this.length = 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
114 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
115 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
117 |
// Handle HTML strings |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
118 |
if ( typeof selector === "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
// Are we dealing with HTML string or an ID? |
| 101 | 120 |
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
121 |
// Assume that strings that start and end with <> are HTML and skip the regex check |
|
122 |
match = [ null, selector, null ]; |
|
123 |
||
124 |
} else {
|
|
125 |
match = quickExpr.exec( selector ); |
|
126 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
127 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
128 |
// Verify a match, and that no context was specified for #id |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
129 |
if ( match && (match[1] || !context) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
130 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
131 |
// HANDLE: $(html) -> $(array) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
132 |
if ( match[1] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
133 |
context = context instanceof jQuery ? context[0] : context; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
134 |
doc = (context ? context.ownerDocument || context : document); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
135 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
136 |
// If a single string is passed in and it's a single tag |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
137 |
// just do a createElement and skip the rest |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
138 |
ret = rsingleTag.exec( selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
139 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
140 |
if ( ret ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
141 |
if ( jQuery.isPlainObject( context ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
142 |
selector = [ document.createElement( ret[1] ) ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
143 |
jQuery.fn.attr.call( selector, context, true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
144 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
145 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
146 |
selector = [ doc.createElement( ret[1] ) ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
147 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
148 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
149 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
150 |
ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
151 |
selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
152 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
153 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
154 |
return jQuery.merge( this, selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
155 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
156 |
// HANDLE: $("#id")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
157 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
158 |
elem = document.getElementById( match[2] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
159 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
160 |
// Check parentNode to catch when Blackberry 4.6 returns |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
161 |
// nodes that are no longer in the document #6963 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
162 |
if ( elem && elem.parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
163 |
// Handle the case where IE and Opera return items |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
164 |
// by name instead of ID |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
165 |
if ( elem.id !== match[2] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
166 |
return rootjQuery.find( selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
167 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
168 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
169 |
// Otherwise, we inject the element directly into the jQuery object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
170 |
this.length = 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
171 |
this[0] = elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
172 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
173 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
174 |
this.context = document; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
175 |
this.selector = selector; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
176 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
177 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
178 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
179 |
// HANDLE: $(expr, $(...)) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
180 |
} else if ( !context || context.jquery ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
181 |
return (context || rootjQuery).find( selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
182 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
183 |
// HANDLE: $(expr, context) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
184 |
// (which is just equivalent to: $(context).find(expr) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
185 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
186 |
return this.constructor( context ).find( selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
187 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
188 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
189 |
// HANDLE: $(function) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
190 |
// Shortcut for document ready |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
191 |
} else if ( jQuery.isFunction( selector ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
192 |
return rootjQuery.ready( selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
193 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
194 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
195 |
if (selector.selector !== undefined) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
196 |
this.selector = selector.selector; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
197 |
this.context = selector.context; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
198 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
199 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
200 |
return jQuery.makeArray( selector, this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
201 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
202 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
203 |
// Start with an empty selector |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
204 |
selector: "", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
205 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
206 |
// The current version of jQuery being used |
| 101 | 207 |
jquery: "1.6", |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
208 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
209 |
// The default length of a jQuery object is 0 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
210 |
length: 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
211 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
212 |
// The number of elements contained in the matched element set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
213 |
size: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
214 |
return this.length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
215 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
216 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
217 |
toArray: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
218 |
return slice.call( this, 0 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
219 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
220 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
221 |
// Get the Nth element in the matched element set OR |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
222 |
// Get the whole matched element set as a clean array |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
223 |
get: function( num ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
224 |
return num == null ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
225 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
226 |
// Return a 'clean' array |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
227 |
this.toArray() : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
228 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
229 |
// Return just the object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
230 |
( num < 0 ? this[ this.length + num ] : this[ num ] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
231 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
232 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
233 |
// Take an array of elements and push it onto the stack |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
234 |
// (returning the new matched element set) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
235 |
pushStack: function( elems, name, selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
236 |
// Build a new jQuery matched element set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
237 |
var ret = this.constructor(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
238 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
239 |
if ( jQuery.isArray( elems ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
240 |
push.apply( ret, elems ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
241 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
242 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
243 |
jQuery.merge( ret, elems ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
244 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
245 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
246 |
// Add the old object onto the stack (as a reference) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
247 |
ret.prevObject = this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
248 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
249 |
ret.context = this.context; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
250 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
251 |
if ( name === "find" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
252 |
ret.selector = this.selector + (this.selector ? " " : "") + selector; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
253 |
} else if ( name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
254 |
ret.selector = this.selector + "." + name + "(" + selector + ")";
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
255 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
256 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
257 |
// Return the newly-formed element set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
258 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
259 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
260 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
261 |
// Execute a callback for every element in the matched set. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
262 |
// (You can seed the arguments with an array of args, but this is |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
263 |
// only used internally.) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
264 |
each: function( callback, args ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
265 |
return jQuery.each( this, callback, args ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
266 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
267 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
268 |
ready: function( fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
269 |
// Attach the listeners |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
270 |
jQuery.bindReady(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
271 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
272 |
// Add the callback |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
273 |
readyList.done( fn ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
274 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
275 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
276 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
277 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
278 |
eq: function( i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
279 |
return i === -1 ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
280 |
this.slice( i ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
281 |
this.slice( i, +i + 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
282 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
283 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
284 |
first: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
285 |
return this.eq( 0 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
286 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
287 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
288 |
last: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
289 |
return this.eq( -1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
290 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
291 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
292 |
slice: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
293 |
return this.pushStack( slice.apply( this, arguments ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
294 |
"slice", slice.call(arguments).join(",") );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
295 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
296 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
297 |
map: function( callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
298 |
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
299 |
return callback.call( elem, i, elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
300 |
})); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
301 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
302 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
303 |
end: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
304 |
return this.prevObject || this.constructor(null); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
305 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
306 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
307 |
// For internal use only. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
308 |
// Behaves like an Array's method, not like a jQuery method. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
309 |
push: push, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
310 |
sort: [].sort, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
311 |
splice: [].splice |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
312 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
313 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
314 |
// Give the init function the jQuery prototype for later instantiation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
315 |
jQuery.fn.init.prototype = jQuery.fn; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
316 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
317 |
jQuery.extend = jQuery.fn.extend = function() {
|
| 101 | 318 |
var options, name, src, copy, copyIsArray, clone, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
319 |
target = arguments[0] || {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
320 |
i = 1, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
321 |
length = arguments.length, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
322 |
deep = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
323 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
324 |
// Handle a deep copy situation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
325 |
if ( typeof target === "boolean" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
326 |
deep = target; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
327 |
target = arguments[1] || {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
328 |
// skip the boolean and the target |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
329 |
i = 2; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
330 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
331 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
332 |
// Handle case when target is a string or something (possible in deep copy) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
333 |
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
334 |
target = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
335 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
336 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
337 |
// extend jQuery itself if only one argument is passed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
338 |
if ( length === i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
339 |
target = this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
340 |
--i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
341 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
342 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
343 |
for ( ; i < length; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
344 |
// Only deal with non-null/undefined values |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
345 |
if ( (options = arguments[ i ]) != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
346 |
// Extend the base object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
347 |
for ( name in options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
348 |
src = target[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
349 |
copy = options[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
350 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
351 |
// Prevent never-ending loop |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
352 |
if ( target === copy ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
353 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
354 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
355 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
356 |
// Recurse if we're merging plain objects or arrays |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
357 |
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
358 |
if ( copyIsArray ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
359 |
copyIsArray = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
360 |
clone = src && jQuery.isArray(src) ? src : []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
361 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
362 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
363 |
clone = src && jQuery.isPlainObject(src) ? src : {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
364 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
365 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
366 |
// Never move original objects, clone them |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
367 |
target[ name ] = jQuery.extend( deep, clone, copy ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
368 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
369 |
// Don't bring in undefined values |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
370 |
} else if ( copy !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
371 |
target[ name ] = copy; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
372 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
373 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
374 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
375 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
376 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
377 |
// Return the modified object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
378 |
return target; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
379 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
380 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
381 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
382 |
noConflict: function( deep ) {
|
| 101 | 383 |
if ( window.$ === jQuery ) {
|
384 |
window.$ = _$; |
|
385 |
} |
|
386 |
||
387 |
if ( deep && window.jQuery === jQuery ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
388 |
window.jQuery = _jQuery; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
389 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
390 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
391 |
return jQuery; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
392 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
393 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
394 |
// Is the DOM ready to be used? Set to true once it occurs. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
395 |
isReady: false, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
396 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
397 |
// A counter to track how many items to wait for before |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
398 |
// the ready event fires. See #6781 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
399 |
readyWait: 1, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
400 |
|
| 101 | 401 |
// Hold (or release) the ready event |
402 |
holdReady: function( hold ) {
|
|
403 |
if ( hold ) {
|
|
404 |
jQuery.readyWait++; |
|
405 |
} else {
|
|
406 |
jQuery.ready( true ); |
|
407 |
} |
|
408 |
}, |
|
409 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
410 |
// Handle when the DOM is ready |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
411 |
ready: function( wait ) {
|
| 101 | 412 |
// Either a released hold or an DOMready/load event and not yet ready |
413 |
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
414 |
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
415 |
if ( !document.body ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
416 |
return setTimeout( jQuery.ready, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
417 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
418 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
419 |
// Remember that the DOM is ready |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
420 |
jQuery.isReady = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
421 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
422 |
// If a normal DOM Ready event fired, decrement, and wait if need be |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
423 |
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
424 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
425 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
426 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
427 |
// If there are functions bound, to execute |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
428 |
readyList.resolveWith( document, [ jQuery ] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
429 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
430 |
// Trigger any bound ready events |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
431 |
if ( jQuery.fn.trigger ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
432 |
jQuery( document ).trigger( "ready" ).unbind( "ready" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
433 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
434 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
435 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
436 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
437 |
bindReady: function() {
|
| 101 | 438 |
if ( readyList ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
439 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
440 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
441 |
|
| 101 | 442 |
readyList = jQuery._Deferred(); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
443 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
444 |
// Catch cases where $(document).ready() is called after the |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
445 |
// browser event has already occurred. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
446 |
if ( document.readyState === "complete" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
447 |
// Handle it asynchronously to allow scripts the opportunity to delay ready |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
448 |
return setTimeout( jQuery.ready, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
449 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
450 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
451 |
// Mozilla, Opera and webkit nightlies currently support this event |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
452 |
if ( document.addEventListener ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
453 |
// Use the handy event callback |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
454 |
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
455 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
456 |
// A fallback to window.onload, that will always work |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
457 |
window.addEventListener( "load", jQuery.ready, false ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
458 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
459 |
// If IE event model is used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
460 |
} else if ( document.attachEvent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
461 |
// ensure firing before onload, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
462 |
// maybe late but safe also for iframes |
| 101 | 463 |
document.attachEvent( "onreadystatechange", DOMContentLoaded ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
464 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
465 |
// A fallback to window.onload, that will always work |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
466 |
window.attachEvent( "onload", jQuery.ready ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
467 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
468 |
// If IE and not a frame |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
469 |
// continually check to see if the document is ready |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
470 |
var toplevel = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
471 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
472 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
473 |
toplevel = window.frameElement == null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
474 |
} catch(e) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
475 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
476 |
if ( document.documentElement.doScroll && toplevel ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
477 |
doScrollCheck(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
478 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
479 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
480 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
481 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
482 |
// See test/unit/core.js for details concerning isFunction. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
483 |
// Since version 1.3, DOM methods and functions like alert |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
484 |
// aren't supported. They return false on IE (#2968). |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
485 |
isFunction: function( obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
486 |
return jQuery.type(obj) === "function"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
487 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
488 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
489 |
isArray: Array.isArray || function( obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
490 |
return jQuery.type(obj) === "array"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
491 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
492 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
493 |
// A crude way of determining if an object is a window |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
494 |
isWindow: function( obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
495 |
return obj && typeof obj === "object" && "setInterval" in obj; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
496 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
497 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
498 |
isNaN: function( obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
499 |
return obj == null || !rdigit.test( obj ) || isNaN( obj ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
500 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
501 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
502 |
type: function( obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
503 |
return obj == null ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
504 |
String( obj ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
505 |
class2type[ toString.call(obj) ] || "object"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
506 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
507 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
508 |
isPlainObject: function( obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
509 |
// Must be an Object. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
510 |
// Because of IE, we also have to check the presence of the constructor property. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
511 |
// Make sure that DOM nodes and window objects don't pass through, as well |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
512 |
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
513 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
514 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
515 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
516 |
// Not own constructor property must be Object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
517 |
if ( obj.constructor && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
518 |
!hasOwn.call(obj, "constructor") && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
519 |
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
520 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
521 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
522 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
523 |
// Own properties are enumerated firstly, so to speed up, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
524 |
// if last one is own, then all properties are own. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
525 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
526 |
var key; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
527 |
for ( key in obj ) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
528 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
529 |
return key === undefined || hasOwn.call( obj, key ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
530 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
531 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
532 |
isEmptyObject: function( obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
533 |
for ( var name in obj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
534 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
535 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
536 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
537 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
538 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
539 |
error: function( msg ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
540 |
throw msg; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
541 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
542 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
543 |
parseJSON: function( data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
544 |
if ( typeof data !== "string" || !data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
545 |
return null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
546 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
547 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
548 |
// Make sure leading/trailing whitespace is removed (IE can't handle it) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
549 |
data = jQuery.trim( data ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
550 |
|
| 101 | 551 |
// Attempt to parse using the native JSON parser first |
552 |
if ( window.JSON && window.JSON.parse ) {
|
|
553 |
return window.JSON.parse( data ); |
|
554 |
} |
|
555 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
556 |
// Make sure the incoming data is actual JSON |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
557 |
// Logic borrowed from http://json.org/json2.js |
| 101 | 558 |
if ( rvalidchars.test( data.replace( rvalidescape, "@" ) |
559 |
.replace( rvalidtokens, "]" ) |
|
560 |
.replace( rvalidbraces, "")) ) {
|
|
561 |
||
562 |
return (new Function( "return " + data ))(); |
|
563 |
||
564 |
} |
|
565 |
jQuery.error( "Invalid JSON: " + data ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
566 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
567 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
568 |
// Cross-browser xml parsing |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
569 |
// (xml & tmp used internally) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
570 |
parseXML: function( data , xml , tmp ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
571 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
572 |
if ( window.DOMParser ) { // Standard
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
573 |
tmp = new DOMParser(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
574 |
xml = tmp.parseFromString( data , "text/xml" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
575 |
} else { // IE
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
576 |
xml = new ActiveXObject( "Microsoft.XMLDOM" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
577 |
xml.async = "false"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
578 |
xml.loadXML( data ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
579 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
580 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
581 |
tmp = xml.documentElement; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
582 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
583 |
if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
584 |
jQuery.error( "Invalid XML: " + data ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
585 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
586 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
587 |
return xml; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
588 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
589 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
590 |
noop: function() {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
591 |
|
| 101 | 592 |
// Evaluates a script in a global context |
593 |
// Workarounds based on findings by Jim Driscoll |
|
594 |
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
595 |
globalEval: function( data ) {
|
| 101 | 596 |
if ( data && rnotwhite.test( data ) ) {
|
597 |
// We use execScript on Internet Explorer |
|
598 |
// We use an anonymous function so that context is window |
|
599 |
// rather than jQuery in Firefox |
|
600 |
( window.execScript || function( data ) {
|
|
601 |
window[ "eval" ].call( window, data ); |
|
602 |
} )( data ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
603 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
604 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
605 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
606 |
nodeName: function( elem, name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
607 |
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
608 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
609 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
610 |
// args is for internal usage only |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
611 |
each: function( object, callback, args ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
612 |
var name, i = 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
613 |
length = object.length, |
| 101 | 614 |
isObj = length === undefined || jQuery.isFunction( object ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
615 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
616 |
if ( args ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
617 |
if ( isObj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
618 |
for ( name in object ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
619 |
if ( callback.apply( object[ name ], args ) === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
620 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
621 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
622 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
623 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
624 |
for ( ; i < length; ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
625 |
if ( callback.apply( object[ i++ ], args ) === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
626 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
627 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
628 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
629 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
630 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
631 |
// A special, fast, case for the most common use of each |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
632 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
633 |
if ( isObj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
634 |
for ( name in object ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
635 |
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
636 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
637 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
638 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
639 |
} else {
|
| 101 | 640 |
for ( ; i < length; ) {
|
641 |
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
|
|
642 |
break; |
|
643 |
} |
|
644 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
645 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
646 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
647 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
648 |
return object; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
649 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
650 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
651 |
// Use native String.trim function wherever possible |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
652 |
trim: trim ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
653 |
function( text ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
654 |
return text == null ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
655 |
"" : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
656 |
trim.call( text ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
657 |
} : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
658 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
659 |
// Otherwise use our own trimming functionality |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
660 |
function( text ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
661 |
return text == null ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
662 |
"" : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
663 |
text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
664 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
665 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
666 |
// results is for internal usage only |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
667 |
makeArray: function( array, results ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
668 |
var ret = results || []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
669 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
670 |
if ( array != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
671 |
// The window, strings (and functions) also have 'length' |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
672 |
// The extra typeof function check is to prevent crashes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
673 |
// in Safari 2 (See: #3039) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
674 |
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 |
| 101 | 675 |
var type = jQuery.type( array ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
676 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
677 |
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
678 |
push.call( ret, array ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
679 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
680 |
jQuery.merge( ret, array ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
681 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
682 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
683 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
684 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
685 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
686 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
687 |
inArray: function( elem, array ) {
|
| 101 | 688 |
|
689 |
if ( indexOf ) {
|
|
690 |
return indexOf.call( array, elem ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
691 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
692 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
693 |
for ( var i = 0, length = array.length; i < length; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
694 |
if ( array[ i ] === elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
695 |
return i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
696 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
697 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
698 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
699 |
return -1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
700 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
701 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
702 |
merge: function( first, second ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
703 |
var i = first.length, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
704 |
j = 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
705 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
706 |
if ( typeof second.length === "number" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
707 |
for ( var l = second.length; j < l; j++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
708 |
first[ i++ ] = second[ j ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
709 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
710 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
711 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
712 |
while ( second[j] !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
713 |
first[ i++ ] = second[ j++ ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
714 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
715 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
716 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
717 |
first.length = i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
718 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
719 |
return first; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
720 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
721 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
722 |
grep: function( elems, callback, inv ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
723 |
var ret = [], retVal; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
724 |
inv = !!inv; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
725 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
726 |
// Go through the array, only saving the items |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
727 |
// that pass the validator function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
728 |
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
729 |
retVal = !!callback( elems[ i ], i ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
730 |
if ( inv !== retVal ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
731 |
ret.push( elems[ i ] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
732 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
733 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
734 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
735 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
736 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
737 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
738 |
// arg is for internal usage only |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
739 |
map: function( elems, callback, arg ) {
|
| 101 | 740 |
var value, key, ret = [], |
741 |
i = 0, |
|
742 |
length = elems.length, |
|
743 |
// jquery objects are treated as arrays |
|
744 |
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
745 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
746 |
// Go through the array, translating each of the items to their |
| 101 | 747 |
if ( isArray ) {
|
748 |
for ( ; i < length; i++ ) {
|
|
749 |
value = callback( elems[ i ], i, arg ); |
|
750 |
||
751 |
if ( value != null ) {
|
|
752 |
ret[ ret.length ] = value; |
|
753 |
} |
|
754 |
} |
|
755 |
||
756 |
// Go through every key on the object, |
|
757 |
} else {
|
|
758 |
for ( key in elems ) {
|
|
759 |
value = callback( elems[ key ], key, arg ); |
|
760 |
||
761 |
if ( value != null ) {
|
|
762 |
ret[ ret.length ] = value; |
|
763 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
764 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
765 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
766 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
767 |
// Flatten any nested arrays |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
768 |
return ret.concat.apply( [], ret ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
769 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
770 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
771 |
// A global GUID counter for objects |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
772 |
guid: 1, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
773 |
|
| 101 | 774 |
// Bind a function to a context, optionally partially applying any |
775 |
// arguments. |
|
776 |
proxy: function( fn, context ) {
|
|
777 |
if ( typeof context === "string" ) {
|
|
778 |
var tmp = fn[ context ]; |
|
779 |
context = fn; |
|
780 |
fn = tmp; |
|
781 |
} |
|
782 |
||
783 |
// Quick check to determine if target is callable, in the spec |
|
784 |
// this throws a TypeError, but we will just return undefined. |
|
785 |
if ( !jQuery.isFunction( fn ) ) {
|
|
786 |
return undefined; |
|
787 |
} |
|
788 |
||
789 |
// Simulated bind |
|
790 |
var args = slice.call( arguments, 2 ), |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
791 |
proxy = function() {
|
| 101 | 792 |
return fn.apply( context, args.concat( slice.call( arguments ) ) ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
793 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
794 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
795 |
// Set the guid of unique handler to the same of original handler, so it can be removed |
| 101 | 796 |
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; |
797 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
798 |
return proxy; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
799 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
800 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
801 |
// Mutifunctional method to get and set values to a collection |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
802 |
// The value/s can be optionally by executed if its a function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
803 |
access: function( elems, key, value, exec, fn, pass ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
804 |
var length = elems.length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
805 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
806 |
// Setting many attributes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
807 |
if ( typeof key === "object" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
808 |
for ( var k in key ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
809 |
jQuery.access( elems, k, key[k], exec, fn, value ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
810 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
811 |
return elems; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
812 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
813 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
814 |
// Setting one attribute |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
815 |
if ( value !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
816 |
// Optionally, function values get executed if exec is true |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
817 |
exec = !pass && exec && jQuery.isFunction(value); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
818 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
819 |
for ( var i = 0; i < length; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
820 |
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
821 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
822 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
823 |
return elems; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
824 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
825 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
826 |
// Getting an attribute |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
827 |
return length ? fn( elems[0], key ) : undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
828 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
829 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
830 |
now: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
831 |
return (new Date()).getTime(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
832 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
833 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
834 |
// Use of jQuery.browser is frowned upon. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
835 |
// More details: http://docs.jquery.com/Utilities/jQuery.browser |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
836 |
uaMatch: function( ua ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
837 |
ua = ua.toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
838 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
839 |
var match = rwebkit.exec( ua ) || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
840 |
ropera.exec( ua ) || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
841 |
rmsie.exec( ua ) || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
842 |
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
843 |
[]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
844 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
845 |
return { browser: match[1] || "", version: match[2] || "0" };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
846 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
847 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
848 |
sub: function() {
|
| 101 | 849 |
function jQuerySub( selector, context ) {
|
850 |
return new jQuerySub.fn.init( selector, context ); |
|
851 |
} |
|
852 |
jQuery.extend( true, jQuerySub, this ); |
|
853 |
jQuerySub.superclass = this; |
|
854 |
jQuerySub.fn = jQuerySub.prototype = this(); |
|
855 |
jQuerySub.fn.constructor = jQuerySub; |
|
856 |
jQuerySub.sub = this.sub; |
|
857 |
jQuerySub.fn.init = function init( selector, context ) {
|
|
858 |
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
|
859 |
context = jQuerySub( context ); |
|
860 |
} |
|
861 |
||
862 |
return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
863 |
}; |
| 101 | 864 |
jQuerySub.fn.init.prototype = jQuerySub.fn; |
865 |
var rootjQuerySub = jQuerySub(document); |
|
866 |
return jQuerySub; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
867 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
868 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
869 |
browser: {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
870 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
871 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
872 |
// Populate the class2type map |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
873 |
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
874 |
class2type[ "[object " + name + "]" ] = name.toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
875 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
876 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
877 |
browserMatch = jQuery.uaMatch( userAgent ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
878 |
if ( browserMatch.browser ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
879 |
jQuery.browser[ browserMatch.browser ] = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
880 |
jQuery.browser.version = browserMatch.version; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
881 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
882 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
883 |
// Deprecated, use jQuery.browser.webkit instead |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
884 |
if ( jQuery.browser.webkit ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
885 |
jQuery.browser.safari = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
886 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
887 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
888 |
// IE doesn't match non-breaking spaces with \s |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
889 |
if ( rnotwhite.test( "\xA0" ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
890 |
trimLeft = /^[\s\xA0]+/; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
891 |
trimRight = /[\s\xA0]+$/; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
892 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
893 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
894 |
// All jQuery objects should point back to these |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
895 |
rootjQuery = jQuery(document); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
896 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
897 |
// Cleanup functions for the document ready method |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
898 |
if ( document.addEventListener ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
899 |
DOMContentLoaded = function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
900 |
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
901 |
jQuery.ready(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
902 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
903 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
904 |
} else if ( document.attachEvent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
905 |
DOMContentLoaded = function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
906 |
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
907 |
if ( document.readyState === "complete" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
908 |
document.detachEvent( "onreadystatechange", DOMContentLoaded ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
909 |
jQuery.ready(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
910 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
911 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
912 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
913 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
914 |
// The DOM ready check for Internet Explorer |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
915 |
function doScrollCheck() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
916 |
if ( jQuery.isReady ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
917 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
918 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
919 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
920 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
921 |
// If IE is used, use the trick by Diego Perini |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
922 |
// http://javascript.nwbox.com/IEContentLoaded/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
923 |
document.documentElement.doScroll("left");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
924 |
} catch(e) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
925 |
setTimeout( doScrollCheck, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
926 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
927 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
928 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
929 |
// and execute any waiting functions |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
930 |
jQuery.ready(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
931 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
932 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
933 |
// Expose jQuery to the global object |
| 101 | 934 |
return jQuery; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
935 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
936 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
937 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
938 |
|
| 101 | 939 |
var // Promise methods |
940 |
promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ), |
|
941 |
// Static reference to slice |
|
942 |
sliceDeferred = [].slice; |
|
943 |
||
944 |
jQuery.extend({
|
|
945 |
// Create a simple deferred (one callbacks list) |
|
946 |
_Deferred: function() {
|
|
947 |
var // callbacks list |
|
948 |
callbacks = [], |
|
949 |
// stored [ context , args ] |
|
950 |
fired, |
|
951 |
// to avoid firing when already doing so |
|
952 |
firing, |
|
953 |
// flag to know if the deferred has been cancelled |
|
954 |
cancelled, |
|
955 |
// the deferred itself |
|
956 |
deferred = {
|
|
957 |
||
958 |
// done( f1, f2, ...) |
|
959 |
done: function() {
|
|
960 |
if ( !cancelled ) {
|
|
961 |
var args = arguments, |
|
962 |
i, |
|
963 |
length, |
|
964 |
elem, |
|
965 |
type, |
|
966 |
_fired; |
|
967 |
if ( fired ) {
|
|
968 |
_fired = fired; |
|
969 |
fired = 0; |
|
970 |
} |
|
971 |
for ( i = 0, length = args.length; i < length; i++ ) {
|
|
972 |
elem = args[ i ]; |
|
973 |
type = jQuery.type( elem ); |
|
974 |
if ( type === "array" ) {
|
|
975 |
deferred.done.apply( deferred, elem ); |
|
976 |
} else if ( type === "function" ) {
|
|
977 |
callbacks.push( elem ); |
|
978 |
} |
|
979 |
} |
|
980 |
if ( _fired ) {
|
|
981 |
deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); |
|
982 |
} |
|
983 |
} |
|
984 |
return this; |
|
985 |
}, |
|
986 |
||
987 |
// resolve with given context and args |
|
988 |
resolveWith: function( context, args ) {
|
|
989 |
if ( !cancelled && !fired && !firing ) {
|
|
990 |
// make sure args are available (#8421) |
|
991 |
args = args || []; |
|
992 |
firing = 1; |
|
993 |
try {
|
|
994 |
while( callbacks[ 0 ] ) {
|
|
995 |
callbacks.shift().apply( context, args ); |
|
996 |
} |
|
997 |
} |
|
998 |
finally {
|
|
999 |
fired = [ context, args ]; |
|
1000 |
firing = 0; |
|
1001 |
} |
|
1002 |
} |
|
1003 |
return this; |
|
1004 |
}, |
|
1005 |
||
1006 |
// resolve with this as context and given arguments |
|
1007 |
resolve: function() {
|
|
1008 |
deferred.resolveWith( this, arguments ); |
|
1009 |
return this; |
|
1010 |
}, |
|
1011 |
||
1012 |
// Has this deferred been resolved? |
|
1013 |
isResolved: function() {
|
|
1014 |
return !!( firing || fired ); |
|
1015 |
}, |
|
1016 |
||
1017 |
// Cancel |
|
1018 |
cancel: function() {
|
|
1019 |
cancelled = 1; |
|
1020 |
callbacks = []; |
|
1021 |
return this; |
|
1022 |
} |
|
1023 |
}; |
|
1024 |
||
1025 |
return deferred; |
|
1026 |
}, |
|
1027 |
||
1028 |
// Full fledged deferred (two callbacks list) |
|
1029 |
Deferred: function( func ) {
|
|
1030 |
var deferred = jQuery._Deferred(), |
|
1031 |
failDeferred = jQuery._Deferred(), |
|
1032 |
promise; |
|
1033 |
// Add errorDeferred methods, then and promise |
|
1034 |
jQuery.extend( deferred, {
|
|
1035 |
then: function( doneCallbacks, failCallbacks ) {
|
|
1036 |
deferred.done( doneCallbacks ).fail( failCallbacks ); |
|
1037 |
return this; |
|
1038 |
}, |
|
1039 |
always: function() {
|
|
1040 |
return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments ); |
|
1041 |
}, |
|
1042 |
fail: failDeferred.done, |
|
1043 |
rejectWith: failDeferred.resolveWith, |
|
1044 |
reject: failDeferred.resolve, |
|
1045 |
isRejected: failDeferred.isResolved, |
|
1046 |
pipe: function( fnDone, fnFail ) {
|
|
1047 |
return jQuery.Deferred(function( newDefer ) {
|
|
1048 |
jQuery.each( {
|
|
1049 |
done: [ fnDone, "resolve" ], |
|
1050 |
fail: [ fnFail, "reject" ] |
|
1051 |
}, function( handler, data ) {
|
|
1052 |
var fn = data[ 0 ], |
|
1053 |
action = data[ 1 ], |
|
1054 |
returned; |
|
1055 |
if ( jQuery.isFunction( fn ) ) {
|
|
1056 |
deferred[ handler ](function() {
|
|
1057 |
returned = fn.apply( this, arguments ); |
|
1058 |
if ( jQuery.isFunction( returned.promise ) ) {
|
|
1059 |
returned.promise().then( newDefer.resolve, newDefer.reject ); |
|
1060 |
} else {
|
|
1061 |
newDefer[ action ]( returned ); |
|
1062 |
} |
|
1063 |
}); |
|
1064 |
} else {
|
|
1065 |
deferred[ handler ]( newDefer[ action ] ); |
|
1066 |
} |
|
1067 |
}); |
|
1068 |
}).promise(); |
|
1069 |
}, |
|
1070 |
// Get a promise for this deferred |
|
1071 |
// If obj is provided, the promise aspect is added to the object |
|
1072 |
promise: function( obj ) {
|
|
1073 |
if ( obj == null ) {
|
|
1074 |
if ( promise ) {
|
|
1075 |
return promise; |
|
1076 |
} |
|
1077 |
promise = obj = {};
|
|
1078 |
} |
|
1079 |
var i = promiseMethods.length; |
|
1080 |
while( i-- ) {
|
|
1081 |
obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; |
|
1082 |
} |
|
1083 |
return obj; |
|
1084 |
} |
|
1085 |
}); |
|
1086 |
// Make sure only one callback list will be used |
|
1087 |
deferred.done( failDeferred.cancel ).fail( deferred.cancel ); |
|
1088 |
// Unexpose cancel |
|
1089 |
delete deferred.cancel; |
|
1090 |
// Call given func if any |
|
1091 |
if ( func ) {
|
|
1092 |
func.call( deferred, deferred ); |
|
1093 |
} |
|
1094 |
return deferred; |
|
1095 |
}, |
|
1096 |
||
1097 |
// Deferred helper |
|
1098 |
when: function( firstParam ) {
|
|
1099 |
var args = arguments, |
|
1100 |
i = 0, |
|
1101 |
length = args.length, |
|
1102 |
count = length, |
|
1103 |
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? |
|
1104 |
firstParam : |
|
1105 |
jQuery.Deferred(); |
|
1106 |
function resolveFunc( i ) {
|
|
1107 |
return function( value ) {
|
|
1108 |
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; |
|
1109 |
if ( !( --count ) ) {
|
|
1110 |
// Strange bug in FF4: |
|
1111 |
// Values changed onto the arguments object sometimes end up as undefined values |
|
1112 |
// outside the $.when method. Cloning the object into a fresh array solves the issue |
|
1113 |
deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) ); |
|
1114 |
} |
|
1115 |
}; |
|
1116 |
} |
|
1117 |
if ( length > 1 ) {
|
|
1118 |
for( ; i < length; i++ ) {
|
|
1119 |
if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
|
|
1120 |
args[ i ].promise().then( resolveFunc(i), deferred.reject ); |
|
1121 |
} else {
|
|
1122 |
--count; |
|
1123 |
} |
|
1124 |
} |
|
1125 |
if ( !count ) {
|
|
1126 |
deferred.resolveWith( deferred, args ); |
|
1127 |
} |
|
1128 |
} else if ( deferred !== firstParam ) {
|
|
1129 |
deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); |
|
1130 |
} |
|
1131 |
return deferred.promise(); |
|
1132 |
} |
|
1133 |
}); |
|
1134 |
||
1135 |
||
1136 |
||
1137 |
jQuery.support = (function() {
|
|
1138 |
||
1139 |
var div = document.createElement( "div" ), |
|
1140 |
all, |
|
1141 |
a, |
|
1142 |
select, |
|
1143 |
opt, |
|
1144 |
input, |
|
1145 |
marginDiv, |
|
1146 |
support, |
|
1147 |
fragment, |
|
1148 |
body, |
|
1149 |
bodyStyle, |
|
1150 |
tds, |
|
1151 |
events, |
|
1152 |
eventName, |
|
1153 |
i, |
|
1154 |
isSupported; |
|
1155 |
||
1156 |
// Preliminary tests |
|
1157 |
div.setAttribute("className", "t");
|
|
1158 |
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; |
|
1159 |
||
1160 |
all = div.getElementsByTagName( "*" ); |
|
1161 |
a = div.getElementsByTagName( "a" )[ 0 ]; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1162 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1163 |
// Can't get basic test support |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1164 |
if ( !all || !all.length || !a ) {
|
| 101 | 1165 |
return {};
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1166 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1167 |
|
| 101 | 1168 |
// First batch of supports tests |
1169 |
select = document.createElement( "select" ); |
|
1170 |
opt = select.appendChild( document.createElement("option") );
|
|
1171 |
input = div.getElementsByTagName( "input" )[ 0 ]; |
|
1172 |
||
1173 |
support = {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1174 |
// IE strips leading whitespace when .innerHTML is used |
| 101 | 1175 |
leadingWhitespace: ( div.firstChild.nodeType === 3 ), |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1176 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1177 |
// Make sure that tbody elements aren't automatically inserted |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1178 |
// IE will insert them into empty tables |
| 101 | 1179 |
tbody: !div.getElementsByTagName( "tbody" ).length, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1180 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1181 |
// Make sure that link elements get serialized correctly by innerHTML |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1182 |
// This requires a wrapper element in IE |
| 101 | 1183 |
htmlSerialize: !!div.getElementsByTagName( "link" ).length, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1184 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1185 |
// Get the style information from getAttribute |
| 101 | 1186 |
// (IE uses .cssText instead) |
1187 |
style: /top/.test( a.getAttribute("style") ),
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1188 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1189 |
// Make sure that URLs aren't manipulated |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1190 |
// (IE normalizes it by default) |
| 101 | 1191 |
hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1192 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1193 |
// Make sure that element opacity exists |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1194 |
// (IE uses filter instead) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1195 |
// Use a regex to work around a WebKit issue. See #5145 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1196 |
opacity: /^0.55$/.test( a.style.opacity ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1197 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1198 |
// Verify style float existence |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1199 |
// (IE uses styleFloat instead of cssFloat) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1200 |
cssFloat: !!a.style.cssFloat, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1201 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1202 |
// Make sure that if no value is specified for a checkbox |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1203 |
// that it defaults to "on". |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1204 |
// (WebKit defaults to "" instead) |
| 101 | 1205 |
checkOn: ( input.value === "on" ), |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1206 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1207 |
// Make sure that a selected-by-default option has a working selected property. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1208 |
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1209 |
optSelected: opt.selected, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1210 |
|
| 101 | 1211 |
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) |
1212 |
getSetAttribute: div.className !== "t", |
|
1213 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1214 |
// Will be defined later |
| 101 | 1215 |
submitBubbles: true, |
1216 |
changeBubbles: true, |
|
1217 |
focusinBubbles: false, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1218 |
deleteExpando: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1219 |
noCloneEvent: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1220 |
inlineBlockNeedsLayout: false, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1221 |
shrinkWrapBlocks: false, |
| 101 | 1222 |
reliableMarginRight: true |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1223 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1224 |
|
| 101 | 1225 |
// Make sure checked status is properly cloned |
1226 |
input.checked = true; |
|
1227 |
support.noCloneChecked = input.cloneNode( true ).checked; |
|
1228 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1229 |
// Make sure that the options inside disabled selects aren't marked as disabled |
| 101 | 1230 |
// (WebKit marks them as disabled) |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1231 |
select.disabled = true; |
| 101 | 1232 |
support.optDisabled = !opt.disabled; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1233 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1234 |
// Test to see if it's possible to delete an expando from an element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1235 |
// Fails in Internet Explorer |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1236 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1237 |
delete div.test; |
| 101 | 1238 |
} catch( e ) {
|
1239 |
support.deleteExpando = false; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1240 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1241 |
|
| 101 | 1242 |
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
|
1243 |
div.attachEvent( "onclick", function click() {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1244 |
// Cloning a node shouldn't copy over any |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1245 |
// bound event handlers (IE does this) |
| 101 | 1246 |
support.noCloneEvent = false; |
1247 |
div.detachEvent( "onclick", click ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1248 |
}); |
| 101 | 1249 |
div.cloneNode( true ).fireEvent( "onclick" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1250 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1251 |
|
| 101 | 1252 |
// Check if a radio maintains it's value |
1253 |
// after being appended to the DOM |
|
1254 |
input = document.createElement("input");
|
|
1255 |
input.value = "t"; |
|
1256 |
input.setAttribute("type", "radio");
|
|
1257 |
support.radioValue = input.value === "t"; |
|
1258 |
||
1259 |
input.setAttribute("checked", "checked");
|
|
1260 |
div.appendChild( input ); |
|
1261 |
fragment = document.createDocumentFragment(); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1262 |
fragment.appendChild( div.firstChild ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1263 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1264 |
// WebKit doesn't clone checked state correctly in fragments |
| 101 | 1265 |
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; |
1266 |
||
1267 |
div.innerHTML = ""; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1268 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1269 |
// Figure out if the W3C box model works as expected |
| 101 | 1270 |
div.style.width = div.style.paddingLeft = "1px"; |
1271 |
||
1272 |
// We use our own, invisible, body |
|
1273 |
body = document.createElement( "body" ); |
|
1274 |
bodyStyle = {
|
|
1275 |
visibility: "hidden", |
|
1276 |
width: 0, |
|
1277 |
height: 0, |
|
1278 |
border: 0, |
|
1279 |
margin: 0, |
|
1280 |
// Set background to avoid IE crashes when removing (#9028) |
|
1281 |
background: "none" |
|
1282 |
}; |
|
1283 |
for ( i in bodyStyle ) {
|
|
1284 |
body.style[ i ] = bodyStyle[ i ]; |
|
1285 |
} |
|
1286 |
body.appendChild( div ); |
|
1287 |
document.documentElement.appendChild( body ); |
|
1288 |
||
1289 |
// Check if a disconnected checkbox will retain its checked |
|
1290 |
// value of true after appended to the DOM (IE6/7) |
|
1291 |
support.appendChecked = input.checked; |
|
1292 |
||
1293 |
support.boxModel = div.offsetWidth === 2; |
|
1294 |
||
1295 |
if ( "zoom" in div.style ) {
|
|
1296 |
// Check if natively block-level elements act like inline-block |
|
1297 |
// elements when setting their display to 'inline' and giving |
|
1298 |
// them layout |
|
1299 |
// (IE < 8 does this) |
|
1300 |
div.style.display = "inline"; |
|
1301 |
div.style.zoom = 1; |
|
1302 |
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); |
|
1303 |
||
1304 |
// Check if elements with layout shrink-wrap their children |
|
1305 |
// (IE 6 does this) |
|
1306 |
div.style.display = ""; |
|
1307 |
div.innerHTML = "<div style='width:4px;'></div>"; |
|
1308 |
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); |
|
1309 |
} |
|
1310 |
||
1311 |
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; |
|
1312 |
tds = div.getElementsByTagName( "td" ); |
|
1313 |
||
1314 |
// Check if table cells still have offsetWidth/Height when they are set |
|
1315 |
// to display:none and there are still other visible table cells in a |
|
1316 |
// table row; if so, offsetWidth/Height are not reliable for use when |
|
1317 |
// determining if an element has been hidden directly using |
|
1318 |
// display:none (it is still safe to use offsets if a parent element is |
|
1319 |
// hidden; don safety goggles and see bug #4512 for more information). |
|
1320 |
// (only IE 8 fails this test) |
|
1321 |
isSupported = ( tds[ 0 ].offsetHeight === 0 ); |
|
1322 |
||
1323 |
tds[ 0 ].style.display = ""; |
|
1324 |
tds[ 1 ].style.display = "none"; |
|
1325 |
||
1326 |
// Check if empty table cells still have offsetWidth/Height |
|
1327 |
// (IE < 8 fail this test) |
|
1328 |
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); |
|
1329 |
div.innerHTML = ""; |
|
1330 |
||
1331 |
// Check if div with explicit width and no margin-right incorrectly |
|
1332 |
// gets computed margin-right based on width of container. For more |
|
1333 |
// info see bug #3333 |
|
1334 |
// Fails in WebKit before Feb 2011 nightlies |
|
1335 |
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
|
1336 |
if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
|
1337 |
marginDiv = document.createElement( "div" ); |
|
1338 |
marginDiv.style.width = "0"; |
|
1339 |
marginDiv.style.marginRight = "0"; |
|
1340 |
div.appendChild( marginDiv ); |
|
1341 |
support.reliableMarginRight = |
|
1342 |
( parseInt( document.defaultView.getComputedStyle( marginDiv, null ).marginRight, 10 ) || 0 ) === 0; |
|
1343 |
} |
|
1344 |
||
1345 |
// Remove the body element we added |
|
1346 |
body.innerHTML = ""; |
|
1347 |
document.documentElement.removeChild( body ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1348 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1349 |
// Technique from Juriy Zaytsev |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1350 |
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ |
| 101 | 1351 |
// We only care about the case where non-standard event systems |
1352 |
// are used, namely in IE. Short-circuiting here helps us to |
|
1353 |
// avoid an eval call (in setAttribute) which can cause CSP |
|
1354 |
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP |
|
1355 |
if ( div.attachEvent ) {
|
|
1356 |
for( i in {
|
|
1357 |
submit: 1, |
|
1358 |
change: 1, |
|
1359 |
focusin: 1 |
|
1360 |
} ) {
|
|
1361 |
eventName = "on" + i; |
|
1362 |
isSupported = ( eventName in div ); |
|
1363 |
if ( !isSupported ) {
|
|
1364 |
div.setAttribute( eventName, "return;" ); |
|
1365 |
isSupported = ( typeof div[ eventName ] === "function" ); |
|
1366 |
} |
|
1367 |
support[ i + "Bubbles" ] = isSupported; |
|
1368 |
} |
|
1369 |
} |
|
1370 |
||
1371 |
return support; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1372 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1373 |
|
| 101 | 1374 |
// Keep track of boxModel |
1375 |
jQuery.boxModel = jQuery.support.boxModel; |
|
1376 |
||
1377 |
||
1378 |
||
1379 |
||
1380 |
var rbrace = /^(?:\{.*\}|\[.*\])$/,
|
|
1381 |
rmultiDash = /([a-z])([A-Z])/g; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1382 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1383 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1384 |
cache: {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1385 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1386 |
// Please use with caution |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1387 |
uuid: 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1388 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1389 |
// Unique for each copy of jQuery on the page |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1390 |
// Non-digits removed to match rinlinejQuery |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1391 |
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1392 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1393 |
// The following elements throw uncatchable exceptions if you |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1394 |
// attempt to add expando properties to them. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1395 |
noData: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1396 |
"embed": true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1397 |
// Ban all objects except for Flash (which handle expandos) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1398 |
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1399 |
"applet": true |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1400 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1401 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1402 |
hasData: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1403 |
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1404 |
|
| 101 | 1405 |
return !!elem && !isEmptyDataObject( elem ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1406 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1407 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1408 |
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1409 |
if ( !jQuery.acceptData( elem ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1410 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1411 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1412 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1413 |
var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1414 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1415 |
// We have to handle DOM nodes and JS objects differently because IE6-7 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1416 |
// can't GC object references properly across the DOM-JS boundary |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1417 |
isNode = elem.nodeType, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1418 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1419 |
// Only DOM nodes need the global jQuery cache; JS object data is |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1420 |
// attached directly to the object so GC can occur automatically |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1421 |
cache = isNode ? jQuery.cache : elem, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1422 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1423 |
// Only defining an ID for JS objects if its cache already exists allows |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1424 |
// the code to shortcut on the same path as a DOM node with no cache |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1425 |
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1426 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1427 |
// Avoid doing any more work than we need to when trying to get data on an |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1428 |
// object that has no data at all |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1429 |
if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1430 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1431 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1432 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1433 |
if ( !id ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1434 |
// Only DOM nodes need a new unique ID for each element since their data |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1435 |
// ends up in the global cache |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1436 |
if ( isNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1437 |
elem[ jQuery.expando ] = id = ++jQuery.uuid; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1438 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1439 |
id = jQuery.expando; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1440 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1441 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1442 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1443 |
if ( !cache[ id ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1444 |
cache[ id ] = {};
|
| 101 | 1445 |
|
1446 |
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery |
|
1447 |
// metadata on plain JS objects when the object is serialized using |
|
1448 |
// JSON.stringify |
|
1449 |
if ( !isNode ) {
|
|
1450 |
cache[ id ].toJSON = jQuery.noop; |
|
1451 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1452 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1453 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1454 |
// An object can be passed to jQuery.data instead of a key/value pair; this gets |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1455 |
// shallow copied over onto the existing cache |
| 101 | 1456 |
if ( typeof name === "object" || typeof name === "function" ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1457 |
if ( pvt ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1458 |
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1459 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1460 |
cache[ id ] = jQuery.extend(cache[ id ], name); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1461 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1462 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1463 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1464 |
thisCache = cache[ id ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1465 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1466 |
// Internal jQuery data is stored in a separate object inside the object's data |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1467 |
// cache in order to avoid key collisions between internal data and user-defined |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1468 |
// data |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1469 |
if ( pvt ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1470 |
if ( !thisCache[ internalKey ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1471 |
thisCache[ internalKey ] = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1472 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1473 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1474 |
thisCache = thisCache[ internalKey ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1475 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1476 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1477 |
if ( data !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1478 |
thisCache[ name ] = data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1479 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1480 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1481 |
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1482 |
// not attempt to inspect the internal events object using jQuery.data, as this |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1483 |
// internal data object is undocumented and subject to change. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1484 |
if ( name === "events" && !thisCache[name] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1485 |
return thisCache[ internalKey ] && thisCache[ internalKey ].events; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1486 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1487 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1488 |
return getByName ? thisCache[ name ] : thisCache; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1489 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1490 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1491 |
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1492 |
if ( !jQuery.acceptData( elem ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1493 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1494 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1495 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1496 |
var internalKey = jQuery.expando, isNode = elem.nodeType, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1497 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1498 |
// See jQuery.data for more information |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1499 |
cache = isNode ? jQuery.cache : elem, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1500 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1501 |
// See jQuery.data for more information |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1502 |
id = isNode ? elem[ jQuery.expando ] : jQuery.expando; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1503 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1504 |
// If there is already no cache entry for this object, there is no |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1505 |
// purpose in continuing |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1506 |
if ( !cache[ id ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1507 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1508 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1509 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1510 |
if ( name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1511 |
var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1512 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1513 |
if ( thisCache ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1514 |
delete thisCache[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1515 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1516 |
// If there is no data left in the cache, we want to continue |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1517 |
// and let the cache object itself get destroyed |
| 101 | 1518 |
if ( !isEmptyDataObject(thisCache) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1519 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1520 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1521 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1522 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1523 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1524 |
// See jQuery.data for more information |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1525 |
if ( pvt ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1526 |
delete cache[ id ][ internalKey ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1527 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1528 |
// Don't destroy the parent cache unless the internal data object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1529 |
// had been the only thing left in it |
| 101 | 1530 |
if ( !isEmptyDataObject(cache[ id ]) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1531 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1532 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1533 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1534 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1535 |
var internalCache = cache[ id ][ internalKey ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1536 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1537 |
// Browsers that fail expando deletion also refuse to delete expandos on |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1538 |
// the window, but it will allow it on all other JS objects; other browsers |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1539 |
// don't care |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1540 |
if ( jQuery.support.deleteExpando || cache != window ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1541 |
delete cache[ id ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1542 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1543 |
cache[ id ] = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1544 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1545 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1546 |
// We destroyed the entire user cache at once because it's faster than |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1547 |
// iterating through each key, but we need to continue to persist internal |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1548 |
// data if it existed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1549 |
if ( internalCache ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1550 |
cache[ id ] = {};
|
| 101 | 1551 |
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery |
1552 |
// metadata on plain JS objects when the object is serialized using |
|
1553 |
// JSON.stringify |
|
1554 |
if ( !isNode ) {
|
|
1555 |
cache[ id ].toJSON = jQuery.noop; |
|
1556 |
} |
|
1557 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1558 |
cache[ id ][ internalKey ] = internalCache; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1559 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1560 |
// Otherwise, we need to eliminate the expando on the node to avoid |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1561 |
// false lookups in the cache for entries that no longer exist |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1562 |
} else if ( isNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1563 |
// IE does not allow us to delete expando properties from nodes, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1564 |
// nor does it have a removeAttribute function on Document nodes; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1565 |
// we must handle all of these cases |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1566 |
if ( jQuery.support.deleteExpando ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1567 |
delete elem[ jQuery.expando ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1568 |
} else if ( elem.removeAttribute ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1569 |
elem.removeAttribute( jQuery.expando ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1570 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1571 |
elem[ jQuery.expando ] = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1572 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1573 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1574 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1575 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1576 |
// For internal use only. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1577 |
_data: function( elem, name, data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1578 |
return jQuery.data( elem, name, data, true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1579 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1580 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1581 |
// A method for determining if a DOM node can handle the data expando |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1582 |
acceptData: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1583 |
if ( elem.nodeName ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1584 |
var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1585 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1586 |
if ( match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1587 |
return !(match === true || elem.getAttribute("classid") !== match);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1588 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1589 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1590 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1591 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1592 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1593 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1594 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1595 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1596 |
data: function( key, value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1597 |
var data = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1598 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1599 |
if ( typeof key === "undefined" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1600 |
if ( this.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1601 |
data = jQuery.data( this[0] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1602 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1603 |
if ( this[0].nodeType === 1 ) {
|
| 101 | 1604 |
var attr = this[0].attributes, name; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1605 |
for ( var i = 0, l = attr.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1606 |
name = attr[i].name; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1607 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1608 |
if ( name.indexOf( "data-" ) === 0 ) {
|
| 101 | 1609 |
name = jQuery.camelCase( name.substring(5) ); |
1610 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1611 |
dataAttr( this[0], name, data[ name ] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1612 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1613 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1614 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1615 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1616 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1617 |
return data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1618 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1619 |
} else if ( typeof key === "object" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1620 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1621 |
jQuery.data( this, key ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1622 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1623 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1624 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1625 |
var parts = key.split(".");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1626 |
parts[1] = parts[1] ? "." + parts[1] : ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1627 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1628 |
if ( value === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1629 |
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1630 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1631 |
// Try to fetch any internally stored data first |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1632 |
if ( data === undefined && this.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1633 |
data = jQuery.data( this[0], key ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1634 |
data = dataAttr( this[0], key, data ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1635 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1636 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1637 |
return data === undefined && parts[1] ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1638 |
this.data( parts[0] ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1639 |
data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1640 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1641 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1642 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1643 |
var $this = jQuery( this ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1644 |
args = [ parts[0], value ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1645 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1646 |
$this.triggerHandler( "setData" + parts[1] + "!", args ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1647 |
jQuery.data( this, key, value ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1648 |
$this.triggerHandler( "changeData" + parts[1] + "!", args ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1649 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1650 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1651 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1652 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1653 |
removeData: function( key ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1654 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1655 |
jQuery.removeData( this, key ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1656 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1657 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1658 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1659 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1660 |
function dataAttr( elem, key, data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1661 |
// If nothing was found internally, try to fetch any |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1662 |
// data from the HTML5 data-* attribute |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1663 |
if ( data === undefined && elem.nodeType === 1 ) {
|
| 101 | 1664 |
name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase(); |
1665 |
||
1666 |
data = elem.getAttribute( name ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1667 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1668 |
if ( typeof data === "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1669 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1670 |
data = data === "true" ? true : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1671 |
data === "false" ? false : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1672 |
data === "null" ? null : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1673 |
!jQuery.isNaN( data ) ? parseFloat( data ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1674 |
rbrace.test( data ) ? jQuery.parseJSON( data ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1675 |
data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1676 |
} catch( e ) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1677 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1678 |
// Make sure we set the data so it isn't changed later |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1679 |
jQuery.data( elem, key, data ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1680 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1681 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1682 |
data = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1683 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1684 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1685 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1686 |
return data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1687 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1688 |
|
| 101 | 1689 |
// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON |
1690 |
// property to be considered empty objects; this property always exists in |
|
1691 |
// order to make sure JSON.stringify does not expose internal metadata |
|
1692 |
function isEmptyDataObject( obj ) {
|
|
1693 |
for ( var name in obj ) {
|
|
1694 |
if ( name !== "toJSON" ) {
|
|
1695 |
return false; |
|
1696 |
} |
|
1697 |
} |
|
1698 |
||
1699 |
return true; |
|
1700 |
} |
|
1701 |
||
1702 |
||
1703 |
||
1704 |
||
1705 |
function handleQueueMarkDefer( elem, type, src ) {
|
|
1706 |
var deferDataKey = type + "defer", |
|
1707 |
queueDataKey = type + "queue", |
|
1708 |
markDataKey = type + "mark", |
|
1709 |
defer = jQuery.data( elem, deferDataKey, undefined, true ); |
|
1710 |
if ( defer && |
|
1711 |
( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) && |
|
1712 |
( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
|
|
1713 |
// Give room for hard-coded callbacks to fire first |
|
1714 |
// and eventually mark/queue something else on the element |
|
1715 |
setTimeout( function() {
|
|
1716 |
if ( !jQuery.data( elem, queueDataKey, undefined, true ) && |
|
1717 |
!jQuery.data( elem, markDataKey, undefined, true ) ) {
|
|
1718 |
jQuery.removeData( elem, deferDataKey, true ); |
|
1719 |
defer.resolve(); |
|
1720 |
} |
|
1721 |
}, 0 ); |
|
1722 |
} |
|
1723 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1724 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1725 |
jQuery.extend({
|
| 101 | 1726 |
|
1727 |
_mark: function( elem, type ) {
|
|
1728 |
if ( elem ) {
|
|
1729 |
type = (type || "fx") + "mark"; |
|
1730 |
jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true ); |
|
1731 |
} |
|
1732 |
}, |
|
1733 |
||
1734 |
_unmark: function( force, elem, type ) {
|
|
1735 |
if ( force !== true ) {
|
|
1736 |
type = elem; |
|
1737 |
elem = force; |
|
1738 |
force = false; |
|
1739 |
} |
|
1740 |
if ( elem ) {
|
|
1741 |
type = type || "fx"; |
|
1742 |
var key = type + "mark", |
|
1743 |
count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 ); |
|
1744 |
if ( count ) {
|
|
1745 |
jQuery.data( elem, key, count, true ); |
|
1746 |
} else {
|
|
1747 |
jQuery.removeData( elem, key, true ); |
|
1748 |
handleQueueMarkDefer( elem, type, "mark" ); |
|
1749 |
} |
|
1750 |
} |
|
1751 |
}, |
|
1752 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1753 |
queue: function( elem, type, data ) {
|
| 101 | 1754 |
if ( elem ) {
|
1755 |
type = (type || "fx") + "queue"; |
|
1756 |
var q = jQuery.data( elem, type, undefined, true ); |
|
1757 |
// Speed up dequeue by getting out quickly if this is just a lookup |
|
1758 |
if ( data ) {
|
|
1759 |
if ( !q || jQuery.isArray(data) ) {
|
|
1760 |
q = jQuery.data( elem, type, jQuery.makeArray(data), true ); |
|
1761 |
} else {
|
|
1762 |
q.push( data ); |
|
1763 |
} |
|
1764 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1765 |
return q || []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1766 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1767 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1768 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1769 |
dequeue: function( elem, type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1770 |
type = type || "fx"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1771 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1772 |
var queue = jQuery.queue( elem, type ), |
| 101 | 1773 |
fn = queue.shift(), |
1774 |
defer; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1775 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1776 |
// If the fx queue is dequeued, always remove the progress sentinel |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1777 |
if ( fn === "inprogress" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1778 |
fn = queue.shift(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1779 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1780 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1781 |
if ( fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1782 |
// Add a progress sentinel to prevent the fx queue from being |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1783 |
// automatically dequeued |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1784 |
if ( type === "fx" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1785 |
queue.unshift("inprogress");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1786 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1787 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1788 |
fn.call(elem, function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1789 |
jQuery.dequeue(elem, type); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1790 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1791 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1792 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1793 |
if ( !queue.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1794 |
jQuery.removeData( elem, type + "queue", true ); |
| 101 | 1795 |
handleQueueMarkDefer( elem, type, "queue" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1796 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1797 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1798 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1799 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1800 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1801 |
queue: function( type, data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1802 |
if ( typeof type !== "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1803 |
data = type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1804 |
type = "fx"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1805 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1806 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1807 |
if ( data === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1808 |
return jQuery.queue( this[0], type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1809 |
} |
| 101 | 1810 |
return this.each(function() {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1811 |
var queue = jQuery.queue( this, type, data ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1812 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1813 |
if ( type === "fx" && queue[0] !== "inprogress" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1814 |
jQuery.dequeue( this, type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1815 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1816 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1817 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1818 |
dequeue: function( type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1819 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1820 |
jQuery.dequeue( this, type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1821 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1822 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1823 |
// Based off of the plugin by Clint Helfers, with permission. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1824 |
// http://blindsignals.com/index.php/2009/07/jquery-delay/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1825 |
delay: function( time, type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1826 |
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1827 |
type = type || "fx"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1828 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1829 |
return this.queue( type, function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1830 |
var elem = this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1831 |
setTimeout(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1832 |
jQuery.dequeue( elem, type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1833 |
}, time ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1834 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1835 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1836 |
clearQueue: function( type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1837 |
return this.queue( type || "fx", [] ); |
| 101 | 1838 |
}, |
1839 |
// Get a promise resolved when queues of a certain type |
|
1840 |
// are emptied (fx is the type by default) |
|
1841 |
promise: function( type, object ) {
|
|
1842 |
if ( typeof type !== "string" ) {
|
|
1843 |
object = type; |
|
1844 |
type = undefined; |
|
1845 |
} |
|
1846 |
type = type || "fx"; |
|
1847 |
var defer = jQuery.Deferred(), |
|
1848 |
elements = this, |
|
1849 |
i = elements.length, |
|
1850 |
count = 1, |
|
1851 |
deferDataKey = type + "defer", |
|
1852 |
queueDataKey = type + "queue", |
|
1853 |
markDataKey = type + "mark"; |
|
1854 |
function resolve() {
|
|
1855 |
if ( !( --count ) ) {
|
|
1856 |
defer.resolveWith( elements, [ elements ] ); |
|
1857 |
} |
|
1858 |
} |
|
1859 |
while( i-- ) {
|
|
1860 |
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || |
|
1861 |
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || |
|
1862 |
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && |
|
1863 |
jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
|
|
1864 |
count++; |
|
1865 |
tmp.done( resolve ); |
|
1866 |
} |
|
1867 |
} |
|
1868 |
resolve(); |
|
1869 |
return defer.promise(); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1870 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1871 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1872 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1873 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1874 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1875 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1876 |
var rclass = /[\n\t\r]/g, |
| 101 | 1877 |
rspace = /\s+/, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1878 |
rreturn = /\r/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1879 |
rtype = /^(?:button|input)$/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1880 |
rfocusable = /^(?:button|input|object|select|textarea)$/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1881 |
rclickable = /^a(?:rea)?$/i, |
| 101 | 1882 |
rspecial = /^(?:data-|aria-)/, |
1883 |
rinvalidChar = /\:/, |
|
1884 |
formHook; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1885 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1886 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1887 |
attr: function( name, value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1888 |
return jQuery.access( this, name, value, true, jQuery.attr ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1889 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1890 |
|
| 101 | 1891 |
removeAttr: function( name ) {
|
1892 |
return this.each(function() {
|
|
1893 |
jQuery.removeAttr( this, name ); |
|
1894 |
}); |
|
1895 |
}, |
|
1896 |
||
1897 |
prop: function( name, value ) {
|
|
1898 |
return jQuery.access( this, name, value, true, jQuery.prop ); |
|
1899 |
}, |
|
1900 |
||
1901 |
removeProp: function( name ) {
|
|
1902 |
return this.each(function() {
|
|
1903 |
// try/catch handles cases where IE balks (such as removing a property on window) |
|
1904 |
try {
|
|
1905 |
this[ name ] = undefined; |
|
1906 |
delete this[ name ]; |
|
1907 |
} catch( e ) {}
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1908 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1909 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1910 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1911 |
addClass: function( value ) {
|
| 101 | 1912 |
if ( jQuery.isFunction( value ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1913 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1914 |
var self = jQuery(this); |
| 101 | 1915 |
self.addClass( value.call(this, i, self.attr("class") || "") );
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1916 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1917 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1918 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1919 |
if ( value && typeof value === "string" ) {
|
| 101 | 1920 |
var classNames = (value || "").split( rspace ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1921 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1922 |
for ( var i = 0, l = this.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1923 |
var elem = this[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1924 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1925 |
if ( elem.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1926 |
if ( !elem.className ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1927 |
elem.className = value; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1928 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1929 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1930 |
var className = " " + elem.className + " ", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1931 |
setClass = elem.className; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1932 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1933 |
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1934 |
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1935 |
setClass += " " + classNames[c]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1936 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1937 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1938 |
elem.className = jQuery.trim( setClass ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1939 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1940 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1941 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1942 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1943 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1944 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1945 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1946 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1947 |
removeClass: function( value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1948 |
if ( jQuery.isFunction(value) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1949 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1950 |
var self = jQuery(this); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1951 |
self.removeClass( value.call(this, i, self.attr("class")) );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1952 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1953 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1954 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1955 |
if ( (value && typeof value === "string") || value === undefined ) {
|
| 101 | 1956 |
var classNames = (value || "").split( rspace ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1957 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1958 |
for ( var i = 0, l = this.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1959 |
var elem = this[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1960 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1961 |
if ( elem.nodeType === 1 && elem.className ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1962 |
if ( value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1963 |
var className = (" " + elem.className + " ").replace(rclass, " ");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1964 |
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1965 |
className = className.replace(" " + classNames[c] + " ", " ");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1966 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1967 |
elem.className = jQuery.trim( className ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1968 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1969 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1970 |
elem.className = ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1971 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1972 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1973 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1974 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1975 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1976 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1977 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1978 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1979 |
toggleClass: function( value, stateVal ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1980 |
var type = typeof value, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1981 |
isBool = typeof stateVal === "boolean"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1982 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1983 |
if ( jQuery.isFunction( value ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1984 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1985 |
var self = jQuery(this); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1986 |
self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1987 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1988 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1989 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1990 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1991 |
if ( type === "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1992 |
// toggle individual class names |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1993 |
var className, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1994 |
i = 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1995 |
self = jQuery( this ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1996 |
state = stateVal, |
| 101 | 1997 |
classNames = value.split( rspace ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1998 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1999 |
while ( (className = classNames[ i++ ]) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2000 |
// check each className given, space seperated list |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2001 |
state = isBool ? state : !self.hasClass( className ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2002 |
self[ state ? "addClass" : "removeClass" ]( className ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2003 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2004 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2005 |
} else if ( type === "undefined" || type === "boolean" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2006 |
if ( this.className ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2007 |
// store className if set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2008 |
jQuery._data( this, "__className__", this.className ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2009 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2010 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2011 |
// toggle whole className |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2012 |
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2013 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2014 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2015 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2016 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2017 |
hasClass: function( selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2018 |
var className = " " + selector + " "; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2019 |
for ( var i = 0, l = this.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2020 |
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2021 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2022 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2023 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2024 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2025 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2026 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2027 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2028 |
val: function( value ) {
|
| 101 | 2029 |
var hooks, ret, |
2030 |
elem = this[0]; |
|
2031 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2032 |
if ( !arguments.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2033 |
if ( elem ) {
|
| 101 | 2034 |
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; |
2035 |
||
2036 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
|
2037 |
return ret; |
|
2038 |
} |
|
2039 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2040 |
return (elem.value || "").replace(rreturn, ""); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2041 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2042 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2043 |
return undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2044 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2045 |
|
| 101 | 2046 |
var isFunction = jQuery.isFunction( value ); |
2047 |
||
2048 |
return this.each(function( i ) {
|
|
2049 |
var self = jQuery(this), val; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2050 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2051 |
if ( this.nodeType !== 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2052 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2053 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2054 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2055 |
if ( isFunction ) {
|
| 101 | 2056 |
val = value.call( this, i, self.val() ); |
2057 |
} else {
|
|
2058 |
val = value; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2059 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2060 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2061 |
// Treat null/undefined as ""; convert numbers to string |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2062 |
if ( val == null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2063 |
val = ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2064 |
} else if ( typeof val === "number" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2065 |
val += ""; |
| 101 | 2066 |
} else if ( jQuery.isArray( val ) ) {
|
2067 |
val = jQuery.map(val, function ( value ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2068 |
return value == null ? "" : value + ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2069 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2070 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2071 |
|
| 101 | 2072 |
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; |
2073 |
||
2074 |
// If set returns undefined, fall back to normal setting |
|
2075 |
if ( !hooks || ("set" in hooks && hooks.set( this, val, "value" ) === undefined) ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2076 |
this.value = val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2077 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2078 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2079 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2080 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2081 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2082 |
jQuery.extend({
|
| 101 | 2083 |
valHooks: {
|
2084 |
option: {
|
|
2085 |
get: function( elem ) {
|
|
2086 |
// attributes.value is undefined in Blackberry 4.7 but |
|
2087 |
// uses .value. See #6932 |
|
2088 |
var val = elem.attributes.value; |
|
2089 |
return !val || val.specified ? elem.value : elem.text; |
|
2090 |
} |
|
2091 |
}, |
|
2092 |
select: {
|
|
2093 |
get: function( elem ) {
|
|
2094 |
var index = elem.selectedIndex, |
|
2095 |
values = [], |
|
2096 |
options = elem.options, |
|
2097 |
one = elem.type === "select-one"; |
|
2098 |
||
2099 |
// Nothing was selected |
|
2100 |
if ( index < 0 ) {
|
|
2101 |
return null; |
|
2102 |
} |
|
2103 |
||
2104 |
// Loop through all the selected options |
|
2105 |
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
|
|
2106 |
var option = options[ i ]; |
|
2107 |
||
2108 |
// Don't return options that are disabled or in a disabled optgroup |
|
2109 |
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
|
|
2110 |
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
|
|
2111 |
||
2112 |
// Get the specific value for the option |
|
2113 |
value = jQuery( option ).val(); |
|
2114 |
||
2115 |
// We don't need an array for one selects |
|
2116 |
if ( one ) {
|
|
2117 |
return value; |
|
2118 |
} |
|
2119 |
||
2120 |
// Multi-Selects return an array |
|
2121 |
values.push( value ); |
|
2122 |
} |
|
2123 |
} |
|
2124 |
||
2125 |
// Fixes Bug #2551 -- select.val() broken in IE after form.reset() |
|
2126 |
if ( one && !values.length && options.length ) {
|
|
2127 |
return jQuery( options[ index ] ).val(); |
|
2128 |
} |
|
2129 |
||
2130 |
return values; |
|
2131 |
}, |
|
2132 |
||
2133 |
set: function( elem, value ) {
|
|
2134 |
var values = jQuery.makeArray( value ); |
|
2135 |
||
2136 |
jQuery(elem).find("option").each(function() {
|
|
2137 |
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; |
|
2138 |
}); |
|
2139 |
||
2140 |
if ( !values.length ) {
|
|
2141 |
elem.selectedIndex = -1; |
|
2142 |
} |
|
2143 |
return values; |
|
2144 |
} |
|
2145 |
} |
|
2146 |
}, |
|
2147 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2148 |
attrFn: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2149 |
val: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2150 |
css: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2151 |
html: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2152 |
text: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2153 |
data: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2154 |
width: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2155 |
height: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2156 |
offset: true |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2157 |
}, |
| 101 | 2158 |
|
2159 |
attrFix: {
|
|
2160 |
// Always normalize to ensure hook usage |
|
2161 |
tabindex: "tabIndex", |
|
2162 |
readonly: "readOnly" |
|
2163 |
}, |
|
2164 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2165 |
attr: function( elem, name, value, pass ) {
|
| 101 | 2166 |
var nType = elem.nodeType; |
2167 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2168 |
// don't get/set attributes on text, comment and attribute nodes |
| 101 | 2169 |
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2170 |
return undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2171 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2172 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2173 |
if ( pass && name in jQuery.attrFn ) {
|
| 101 | 2174 |
return jQuery( elem )[ name ]( value ); |
2175 |
} |
|
2176 |
||
2177 |
var ret, hooks, |
|
2178 |
notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
|
2179 |
||
2180 |
// Normalize the name if needed |
|
2181 |
name = notxml && jQuery.attrFix[ name ] || name; |
|
2182 |
||
2183 |
// Get the appropriate hook, or the formHook |
|
2184 |
// if getSetAttribute is not supported and we have form objects in IE6/7 |
|
2185 |
hooks = jQuery.attrHooks[ name ] || |
|
2186 |
( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ? |
|
2187 |
formHook : |
|
2188 |
undefined ); |
|
2189 |
||
2190 |
if ( value !== undefined ) {
|
|
2191 |
||
2192 |
if ( value === null || (value === false && !rspecial.test( name )) ) {
|
|
2193 |
jQuery.removeAttr( elem, name ); |
|
2194 |
return undefined; |
|
2195 |
||
2196 |
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
|
2197 |
return ret; |
|
2198 |
||
2199 |
} else {
|
|
2200 |
||
2201 |
// Set boolean attributes to the same name |
|
2202 |
if ( value === true && !rspecial.test( name ) ) {
|
|
2203 |
value = name; |
|
2204 |
} |
|
2205 |
||
2206 |
elem.setAttribute( name, "" + value ); |
|
2207 |
return value; |
|
2208 |
} |
|
2209 |
||
2210 |
} else {
|
|
2211 |
||
2212 |
if ( hooks && "get" in hooks && notxml ) {
|
|
2213 |
return hooks.get( elem, name ); |
|
2214 |
||
2215 |
} else {
|
|
2216 |
||
2217 |
ret = elem.getAttribute( name ); |
|
2218 |
||
2219 |
// Non-existent attributes return null, we normalize to undefined |
|
2220 |
return ret === null ? |
|
2221 |
undefined : |
|
2222 |
ret; |
|
2223 |
} |
|
2224 |
} |
|
2225 |
}, |
|
2226 |
||
2227 |
removeAttr: function( elem, name ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2228 |
if ( elem.nodeType === 1 ) {
|
| 101 | 2229 |
name = jQuery.attrFix[ name ] || name; |
2230 |
||
2231 |
if ( jQuery.support.getSetAttribute ) {
|
|
2232 |
// Use removeAttribute in browsers that support it |
|
2233 |
elem.removeAttribute( name ); |
|
2234 |
} else {
|
|
2235 |
jQuery.attr( elem, name, "" ); |
|
2236 |
elem.removeAttributeNode( elem.getAttributeNode( name ) ); |
|
2237 |
} |
|
2238 |
} |
|
2239 |
}, |
|
2240 |
||
2241 |
attrHooks: {
|
|
2242 |
type: {
|
|
2243 |
set: function( elem, value ) {
|
|
2244 |
// We can't allow the type property to be changed (since it causes problems in IE) |
|
2245 |
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
|
|
2246 |
jQuery.error( "type property can't be changed" ); |
|
2247 |
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
|
2248 |
// Setting the type on a radio button after the value resets the value in IE6-9 |
|
2249 |
// Reset value to it's default in case type is set after value |
|
2250 |
// This is for element creation |
|
2251 |
var val = elem.getAttribute("value");
|
|
2252 |
elem.setAttribute( "type", value ); |
|
2253 |
if ( val ) {
|
|
2254 |
elem.value = val; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2255 |
} |
| 101 | 2256 |
return value; |
2257 |
} |
|
2258 |
} |
|
2259 |
}, |
|
2260 |
tabIndex: {
|
|
2261 |
get: function( elem ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2262 |
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2263 |
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ |
| 101 | 2264 |
var attributeNode = elem.getAttributeNode("tabIndex");
|
2265 |
||
2266 |
return attributeNode && attributeNode.specified ? |
|
2267 |
parseInt( attributeNode.value, 10 ) : |
|
2268 |
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? |
|
2269 |
0 : |
|
2270 |
undefined; |
|
2271 |
} |
|
2272 |
} |
|
2273 |
}, |
|
2274 |
||
2275 |
propFix: {},
|
|
2276 |
||
2277 |
prop: function( elem, name, value ) {
|
|
2278 |
var nType = elem.nodeType; |
|
2279 |
||
2280 |
// don't get/set properties on text, comment and attribute nodes |
|
2281 |
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
|
2282 |
return undefined; |
|
2283 |
} |
|
2284 |
||
2285 |
var ret, hooks, |
|
2286 |
notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
|
2287 |
||
2288 |
// Try to normalize/fix the name |
|
2289 |
name = notxml && jQuery.propFix[ name ] || name; |
|
2290 |
||
2291 |
hooks = jQuery.propHooks[ name ]; |
|
2292 |
||
2293 |
if ( value !== undefined ) {
|
|
2294 |
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
|
2295 |
return ret; |
|
2296 |
||
2297 |
} else {
|
|
2298 |
return (elem[ name ] = value); |
|
2299 |
} |
|
2300 |
||
2301 |
} else {
|
|
2302 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
|
|
2303 |
return ret; |
|
2304 |
||
2305 |
} else {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2306 |
return elem[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2307 |
} |
| 101 | 2308 |
} |
2309 |
}, |
|
2310 |
||
2311 |
propHooks: {}
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2312 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2313 |
|
| 101 | 2314 |
// IE6/7 do not support getting/setting some attributes with get/setAttribute |
2315 |
if ( !jQuery.support.getSetAttribute ) {
|
|
2316 |
jQuery.attrFix = jQuery.extend( jQuery.attrFix, {
|
|
2317 |
"for": "htmlFor", |
|
2318 |
"class": "className", |
|
2319 |
maxlength: "maxLength", |
|
2320 |
cellspacing: "cellSpacing", |
|
2321 |
cellpadding: "cellPadding", |
|
2322 |
rowspan: "rowSpan", |
|
2323 |
colspan: "colSpan", |
|
2324 |
usemap: "useMap", |
|
2325 |
frameborder: "frameBorder" |
|
2326 |
}); |
|
2327 |
||
2328 |
// Use this for any attribute on a form in IE6/7 |
|
2329 |
formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = {
|
|
2330 |
get: function( elem, name ) {
|
|
2331 |
var ret; |
|
2332 |
if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {
|
|
2333 |
return elem.getAttribute( name ); |
|
2334 |
} |
|
2335 |
ret = elem.getAttributeNode( name ); |
|
2336 |
// Return undefined if not specified instead of empty string |
|
2337 |
return ret && ret.specified ? |
|
2338 |
ret.nodeValue : |
|
2339 |
undefined; |
|
2340 |
}, |
|
2341 |
set: function( elem, value, name ) {
|
|
2342 |
// Check form objects in IE (multiple bugs related) |
|
2343 |
// Only use nodeValue if the attribute node exists on the form |
|
2344 |
var ret = elem.getAttributeNode( name ); |
|
2345 |
if ( ret ) {
|
|
2346 |
ret.nodeValue = value; |
|
2347 |
return value; |
|
2348 |
} |
|
2349 |
} |
|
2350 |
}; |
|
2351 |
||
2352 |
// Set width and height to auto instead of 0 on empty string( Bug #8150 ) |
|
2353 |
// This is for removals |
|
2354 |
jQuery.each([ "width", "height" ], function( i, name ) {
|
|
2355 |
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
|
2356 |
set: function( elem, value ) {
|
|
2357 |
if ( value === "" ) {
|
|
2358 |
elem.setAttribute( name, "auto" ); |
|
2359 |
return value; |
|
2360 |
} |
|
2361 |
} |
|
2362 |
}); |
|
2363 |
}); |
|
2364 |
} |
|
2365 |
||
2366 |
||
2367 |
// Some attributes require a special call on IE |
|
2368 |
if ( !jQuery.support.hrefNormalized ) {
|
|
2369 |
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
|
|
2370 |
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
|
2371 |
get: function( elem ) {
|
|
2372 |
var ret = elem.getAttribute( name, 2 ); |
|
2373 |
return ret === null ? undefined : ret; |
|
2374 |
} |
|
2375 |
}); |
|
2376 |
}); |
|
2377 |
} |
|
2378 |
||
2379 |
if ( !jQuery.support.style ) {
|
|
2380 |
jQuery.attrHooks.style = {
|
|
2381 |
get: function( elem ) {
|
|
2382 |
// Return undefined in the case of empty string |
|
2383 |
// Normalize to lowercase since IE uppercases css property names |
|
2384 |
return elem.style.cssText.toLowerCase() || undefined; |
|
2385 |
}, |
|
2386 |
set: function( elem, value ) {
|
|
2387 |
return (elem.style.cssText = "" + value); |
|
2388 |
} |
|
2389 |
}; |
|
2390 |
} |
|
2391 |
||
2392 |
// Safari mis-reports the default selected property of an option |
|
2393 |
// Accessing the parent's selectedIndex property fixes it |
|
2394 |
if ( !jQuery.support.optSelected ) {
|
|
2395 |
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
|
|
2396 |
get: function( elem ) {
|
|
2397 |
var parent = elem.parentNode; |
|
2398 |
||
2399 |
if ( parent ) {
|
|
2400 |
parent.selectedIndex; |
|
2401 |
||
2402 |
// Make sure that it also works with optgroups, see #5701 |
|
2403 |
if ( parent.parentNode ) {
|
|
2404 |
parent.parentNode.selectedIndex; |
|
2405 |
} |
|
2406 |
} |
|
2407 |
} |
|
2408 |
}); |
|
2409 |
} |
|
2410 |
||
2411 |
// Radios and checkboxes getter/setter |
|
2412 |
if ( !jQuery.support.checkOn ) {
|
|
2413 |
jQuery.each([ "radio", "checkbox" ], function() {
|
|
2414 |
jQuery.valHooks[ this ] = {
|
|
2415 |
get: function( elem ) {
|
|
2416 |
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified |
|
2417 |
return elem.getAttribute("value") === null ? "on" : elem.value;
|
|
2418 |
} |
|
2419 |
}; |
|
2420 |
}); |
|
2421 |
} |
|
2422 |
jQuery.each([ "radio", "checkbox" ], function() {
|
|
2423 |
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
|
|
2424 |
set: function( elem, value ) {
|
|
2425 |
if ( jQuery.isArray( value ) ) {
|
|
2426 |
return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); |
|
2427 |
} |
|
2428 |
} |
|
2429 |
}); |
|
2430 |
}); |
|
2431 |
||
2432 |
||
2433 |
||
2434 |
||
2435 |
var hasOwn = Object.prototype.hasOwnProperty, |
|
2436 |
rnamespaces = /\.(.*)$/, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2437 |
rformElems = /^(?:textarea|input|select)$/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2438 |
rperiod = /\./g, |
| 101 | 2439 |
rspaces = / /g, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2440 |
rescape = /[^\w\s.|`]/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2441 |
fcleanup = function( nm ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2442 |
return nm.replace(rescape, "\\$&"); |
| 101 | 2443 |
}; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2444 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2445 |
/* |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2446 |
* A number of helper functions used for managing events. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2447 |
* Many of the ideas behind this code originated from |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2448 |
* Dean Edwards' addEvent library. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2449 |
*/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2450 |
jQuery.event = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2451 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2452 |
// Bind an event to an element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2453 |
// Original by Dean Edwards |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2454 |
add: function( elem, types, handler, data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2455 |
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2456 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2457 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2458 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2459 |
if ( handler === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2460 |
handler = returnFalse; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2461 |
} else if ( !handler ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2462 |
// Fixes bug #7229. Fix recommended by jdalton |
| 101 | 2463 |
return; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2464 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2465 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2466 |
var handleObjIn, handleObj; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2467 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2468 |
if ( handler.handler ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2469 |
handleObjIn = handler; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2470 |
handler = handleObjIn.handler; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2471 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2472 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2473 |
// Make sure that the function being executed has a unique ID |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2474 |
if ( !handler.guid ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2475 |
handler.guid = jQuery.guid++; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2476 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2477 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2478 |
// Init the element's event structure |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2479 |
var elemData = jQuery._data( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2480 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2481 |
// If no elemData is found then we must be trying to bind to one of the |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2482 |
// banned noData elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2483 |
if ( !elemData ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2484 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2485 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2486 |
|
| 101 | 2487 |
var events = elemData.events, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2488 |
eventHandle = elemData.handle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2489 |
|
| 101 | 2490 |
if ( !events ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2491 |
elemData.events = events = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2492 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2493 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2494 |
if ( !eventHandle ) {
|
| 101 | 2495 |
elemData.handle = eventHandle = function( e ) {
|
2496 |
// Discard the second event of a jQuery.event.trigger() and |
|
2497 |
// when an event is called after a page has unloaded |
|
2498 |
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2499 |
jQuery.event.handle.apply( eventHandle.elem, arguments ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2500 |
undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2501 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2502 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2503 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2504 |
// Add elem as a property of the handle function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2505 |
// This is to prevent a memory leak with non-native events in IE. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2506 |
eventHandle.elem = elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2507 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2508 |
// Handle multiple events separated by a space |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2509 |
// jQuery(...).bind("mouseover mouseout", fn);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2510 |
types = types.split(" ");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2511 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2512 |
var type, i = 0, namespaces; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2513 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2514 |
while ( (type = types[ i++ ]) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2515 |
handleObj = handleObjIn ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2516 |
jQuery.extend({}, handleObjIn) :
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2517 |
{ handler: handler, data: data };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2518 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2519 |
// Namespaced event handlers |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2520 |
if ( type.indexOf(".") > -1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2521 |
namespaces = type.split(".");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2522 |
type = namespaces.shift(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2523 |
handleObj.namespace = namespaces.slice(0).sort().join(".");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2524 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2525 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2526 |
namespaces = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2527 |
handleObj.namespace = ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2528 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2529 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2530 |
handleObj.type = type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2531 |
if ( !handleObj.guid ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2532 |
handleObj.guid = handler.guid; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2533 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2534 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2535 |
// Get the current list of functions bound to this event |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2536 |
var handlers = events[ type ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2537 |
special = jQuery.event.special[ type ] || {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2538 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2539 |
// Init the event handler queue |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2540 |
if ( !handlers ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2541 |
handlers = events[ type ] = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2542 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2543 |
// Check for a special event handler |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2544 |
// Only use addEventListener/attachEvent if the special |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2545 |
// events handler returns false |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2546 |
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2547 |
// Bind the global event handler to the element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2548 |
if ( elem.addEventListener ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2549 |
elem.addEventListener( type, eventHandle, false ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2550 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2551 |
} else if ( elem.attachEvent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2552 |
elem.attachEvent( "on" + type, eventHandle ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2553 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2554 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2555 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2556 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2557 |
if ( special.add ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2558 |
special.add.call( elem, handleObj ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2559 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2560 |
if ( !handleObj.handler.guid ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2561 |
handleObj.handler.guid = handler.guid; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2562 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2563 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2564 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2565 |
// Add the function to the element's handler list |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2566 |
handlers.push( handleObj ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2567 |
|
| 101 | 2568 |
// Keep track of which events have been used, for event optimization |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2569 |
jQuery.event.global[ type ] = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2570 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2571 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2572 |
// Nullify elem to prevent memory leaks in IE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2573 |
elem = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2574 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2575 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2576 |
global: {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2577 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2578 |
// Detach an event or set of events from an element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2579 |
remove: function( elem, types, handler, pos ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2580 |
// don't do events on text and comment nodes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2581 |
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2582 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2583 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2584 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2585 |
if ( handler === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2586 |
handler = returnFalse; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2587 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2588 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2589 |
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2590 |
elemData = jQuery.hasData( elem ) && jQuery._data( elem ), |
| 101 | 2591 |
events = elemData && elemData.events; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2592 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2593 |
if ( !elemData || !events ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2594 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2595 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2596 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2597 |
// types is actually an event object here |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2598 |
if ( types && types.type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2599 |
handler = types.handler; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2600 |
types = types.type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2601 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2602 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2603 |
// Unbind all events for the element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2604 |
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2605 |
types = types || ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2606 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2607 |
for ( type in events ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2608 |
jQuery.event.remove( elem, type + types ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2609 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2610 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2611 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2612 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2613 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2614 |
// Handle multiple events separated by a space |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2615 |
// jQuery(...).unbind("mouseover mouseout", fn);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2616 |
types = types.split(" ");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2617 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2618 |
while ( (type = types[ i++ ]) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2619 |
origType = type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2620 |
handleObj = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2621 |
all = type.indexOf(".") < 0;
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2622 |
namespaces = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2623 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2624 |
if ( !all ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2625 |
// Namespaced event handlers |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2626 |
namespaces = type.split(".");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2627 |
type = namespaces.shift(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2628 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2629 |
namespace = new RegExp("(^|\\.)" +
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2630 |
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2631 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2632 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2633 |
eventType = events[ type ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2634 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2635 |
if ( !eventType ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2636 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2637 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2638 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2639 |
if ( !handler ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2640 |
for ( j = 0; j < eventType.length; j++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2641 |
handleObj = eventType[ j ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2642 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2643 |
if ( all || namespace.test( handleObj.namespace ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2644 |
jQuery.event.remove( elem, origType, handleObj.handler, j ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2645 |
eventType.splice( j--, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2646 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2647 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2648 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2649 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2650 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2651 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2652 |
special = jQuery.event.special[ type ] || {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2653 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2654 |
for ( j = pos || 0; j < eventType.length; j++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2655 |
handleObj = eventType[ j ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2656 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2657 |
if ( handler.guid === handleObj.guid ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2658 |
// remove the given handler for the given type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2659 |
if ( all || namespace.test( handleObj.namespace ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2660 |
if ( pos == null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2661 |
eventType.splice( j--, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2662 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2663 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2664 |
if ( special.remove ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2665 |
special.remove.call( elem, handleObj ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2666 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2667 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2668 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2669 |
if ( pos != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2670 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2671 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2672 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2673 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2674 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2675 |
// remove generic event handler if no more handlers exist |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2676 |
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2677 |
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2678 |
jQuery.removeEvent( elem, type, elemData.handle ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2679 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2680 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2681 |
ret = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2682 |
delete events[ type ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2683 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2684 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2685 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2686 |
// Remove the expando if it's no longer used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2687 |
if ( jQuery.isEmptyObject( events ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2688 |
var handle = elemData.handle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2689 |
if ( handle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2690 |
handle.elem = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2691 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2692 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2693 |
delete elemData.events; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2694 |
delete elemData.handle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2695 |
|
| 101 | 2696 |
if ( jQuery.isEmptyObject( elemData ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2697 |
jQuery.removeData( elem, undefined, true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2698 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2699 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2700 |
}, |
| 101 | 2701 |
|
2702 |
// Events that are safe to short-circuit if no handlers are attached. |
|
2703 |
// Native DOM events should not be added, they may have inline handlers. |
|
2704 |
customEvent: {
|
|
2705 |
"getData": true, |
|
2706 |
"setData": true, |
|
2707 |
"changeData": true |
|
2708 |
}, |
|
2709 |
||
2710 |
trigger: function( event, data, elem, onlyHandlers ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2711 |
// Event object or event type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2712 |
var type = event.type || event, |
| 101 | 2713 |
namespaces = [], |
2714 |
exclusive; |
|
2715 |
||
2716 |
if ( type.indexOf("!") >= 0 ) {
|
|
2717 |
// Exclusive events trigger only for the exact event (no namespaces) |
|
2718 |
type = type.slice(0, -1); |
|
2719 |
exclusive = true; |
|
2720 |
} |
|
2721 |
||
2722 |
if ( type.indexOf(".") >= 0 ) {
|
|
2723 |
// Namespaced trigger; create a regexp to match event type in handle() |
|
2724 |
namespaces = type.split(".");
|
|
2725 |
type = namespaces.shift(); |
|
2726 |
namespaces.sort(); |
|
2727 |
} |
|
2728 |
||
2729 |
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
|
|
2730 |
// No jQuery handlers for this event type, and it can't have inline handlers |
|
2731 |
return; |
|
2732 |
} |
|
2733 |
||
2734 |
// Caller can pass in an Event, Object, or just an event type string |
|
2735 |
event = typeof event === "object" ? |
|
2736 |
// jQuery.Event object |
|
2737 |
event[ jQuery.expando ] ? event : |
|
2738 |
// Object literal |
|
2739 |
new jQuery.Event( type, event ) : |
|
2740 |
// Just the event type (string) |
|
2741 |
new jQuery.Event( type ); |
|
2742 |
||
2743 |
event.type = type; |
|
2744 |
event.exclusive = exclusive; |
|
2745 |
event.namespace = namespaces.join(".");
|
|
2746 |
event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
|
|
2747 |
||
2748 |
// triggerHandler() and global events don't bubble or run the default action |
|
2749 |
if ( onlyHandlers || !elem ) {
|
|
2750 |
event.preventDefault(); |
|
2751 |
event.stopPropagation(); |
|
2752 |
} |
|
2753 |
||
2754 |
// Handle a global trigger |
|
2755 |
if ( !elem ) {
|
|
2756 |
// TODO: Stop taunting the data cache; remove global events and always attach to document |
|
2757 |
jQuery.each( jQuery.cache, function() {
|
|
2758 |
// internalKey variable is just used to make it easier to find |
|
2759 |
// and potentially change this stuff later; currently it just |
|
2760 |
// points to jQuery.expando |
|
2761 |
var internalKey = jQuery.expando, |
|
2762 |
internalCache = this[ internalKey ]; |
|
2763 |
if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
|
|
2764 |
jQuery.event.trigger( event, data, internalCache.handle.elem ); |
|
2765 |
} |
|
2766 |
}); |
|
2767 |
return; |
|
2768 |
} |
|
2769 |
||
2770 |
// Don't do events on text and comment nodes |
|
2771 |
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
|
2772 |
return; |
|
2773 |
} |
|
2774 |
||
2775 |
// Clean up the event in case it is being reused |
|
2776 |
event.result = undefined; |
|
2777 |
event.target = elem; |
|
2778 |
||
2779 |
// Clone any incoming data and prepend the event, creating the handler arg list |
|
2780 |
data = data ? jQuery.makeArray( data ) : []; |
|
2781 |
data.unshift( event ); |
|
2782 |
||
2783 |
var cur = elem, |
|
2784 |
// IE doesn't like method names with a colon (#3533, #8272) |
|
2785 |
ontype = type.indexOf(":") < 0 ? "on" + type : "";
|
|
2786 |
||
2787 |
// Fire event on the current element, then bubble up the DOM tree |
|
2788 |
do {
|
|
2789 |
var handle = jQuery._data( cur, "handle" ); |
|
2790 |
||
2791 |
event.currentTarget = cur; |
|
2792 |
if ( handle ) {
|
|
2793 |
handle.apply( cur, data ); |
|
2794 |
} |
|
2795 |
||
2796 |
// Trigger an inline bound script |
|
2797 |
if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
|
|
2798 |
event.result = false; |
|
2799 |
event.preventDefault(); |
|
2800 |
} |
|
2801 |
||
2802 |
// Bubble up to document, then to window |
|
2803 |
cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window; |
|
2804 |
} while ( cur && !event.isPropagationStopped() ); |
|
2805 |
||
2806 |
// If nobody prevented the default action, do it now |
|
2807 |
if ( !event.isDefaultPrevented() ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2808 |
var old, |
| 101 | 2809 |
special = jQuery.event.special[ type ] || {};
|
2810 |
||
2811 |
if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && |
|
2812 |
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
|
|
2813 |
||
2814 |
// Call a native DOM method on the target with the same name name as the event. |
|
2815 |
// Can't use an .isFunction)() check here because IE6/7 fails that test. |
|
2816 |
// IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch. |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2817 |
try {
|
| 101 | 2818 |
if ( ontype && elem[ type ] ) {
|
2819 |
// Don't re-trigger an onFOO event when we call its FOO() method |
|
2820 |
old = elem[ ontype ]; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2821 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2822 |
if ( old ) {
|
| 101 | 2823 |
elem[ ontype ] = null; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2824 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2825 |
|
| 101 | 2826 |
jQuery.event.triggered = type; |
2827 |
elem[ type ](); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2828 |
} |
| 101 | 2829 |
} catch ( ieError ) {}
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2830 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2831 |
if ( old ) {
|
| 101 | 2832 |
elem[ ontype ] = old; |
2833 |
} |
|
2834 |
||
2835 |
jQuery.event.triggered = undefined; |
|
2836 |
} |
|
2837 |
} |
|
2838 |
||
2839 |
return event.result; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2840 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2841 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2842 |
handle: function( event ) {
|
| 101 | 2843 |
event = jQuery.event.fix( event || window.event ); |
2844 |
// Snapshot the handlers list since a called handler may add/remove events. |
|
2845 |
var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
|
|
2846 |
run_all = !event.exclusive && !event.namespace, |
|
2847 |
args = Array.prototype.slice.call( arguments, 0 ); |
|
2848 |
||
2849 |
// Use the fix-ed Event rather than the (read-only) native event |
|
2850 |
args[0] = event; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2851 |
event.currentTarget = this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2852 |
|
| 101 | 2853 |
for ( var j = 0, l = handlers.length; j < l; j++ ) {
|
2854 |
var handleObj = handlers[ j ]; |
|
2855 |
||
2856 |
// Triggered event must 1) be non-exclusive and have no namespace, or |
|
2857 |
// 2) have namespace(s) a subset or equal to those in the bound event. |
|
2858 |
if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
|
|
2859 |
// Pass in a reference to the handler function itself |
|
2860 |
// So that we can later remove it |
|
2861 |
event.handler = handleObj.handler; |
|
2862 |
event.data = handleObj.data; |
|
2863 |
event.handleObj = handleObj; |
|
2864 |
||
2865 |
var ret = handleObj.handler.apply( this, args ); |
|
2866 |
||
2867 |
if ( ret !== undefined ) {
|
|
2868 |
event.result = ret; |
|
2869 |
if ( ret === false ) {
|
|
2870 |
event.preventDefault(); |
|
2871 |
event.stopPropagation(); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2872 |
} |
| 101 | 2873 |
} |
2874 |
||
2875 |
if ( event.isImmediatePropagationStopped() ) {
|
|
2876 |
break; |
|
2877 |
} |
|
2878 |
} |
|
2879 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2880 |
return event.result; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2881 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2882 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2883 |
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(" "),
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2884 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2885 |
fix: function( event ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2886 |
if ( event[ jQuery.expando ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2887 |
return event; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2888 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2889 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2890 |
// store a copy of the original event object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2891 |
// and "clone" to set read-only properties |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2892 |
var originalEvent = event; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2893 |
event = jQuery.Event( originalEvent ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2894 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2895 |
for ( var i = this.props.length, prop; i; ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2896 |
prop = this.props[ --i ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2897 |
event[ prop ] = originalEvent[ prop ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2898 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2899 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2900 |
// Fix target property, if necessary |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2901 |
if ( !event.target ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2902 |
// Fixes #1925 where srcElement might not be defined either |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2903 |
event.target = event.srcElement || document; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2904 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2905 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2906 |
// check if target is a textnode (safari) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2907 |
if ( event.target.nodeType === 3 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2908 |
event.target = event.target.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2909 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2910 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2911 |
// Add relatedTarget, if necessary |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2912 |
if ( !event.relatedTarget && event.fromElement ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2913 |
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2914 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2915 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2916 |
// Calculate pageX/Y if missing and clientX/Y available |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2917 |
if ( event.pageX == null && event.clientX != null ) {
|
| 101 | 2918 |
var eventDocument = event.target.ownerDocument || document, |
2919 |
doc = eventDocument.documentElement, |
|
2920 |
body = eventDocument.body; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2921 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2922 |
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2923 |
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2924 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2925 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2926 |
// Add which for key events |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2927 |
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2928 |
event.which = event.charCode != null ? event.charCode : event.keyCode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2929 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2930 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2931 |
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2932 |
if ( !event.metaKey && event.ctrlKey ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2933 |
event.metaKey = event.ctrlKey; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2934 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2935 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2936 |
// Add which for click: 1 === left; 2 === middle; 3 === right |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2937 |
// Note: button is not normalized, so don't use it |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2938 |
if ( !event.which && event.button !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2939 |
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2940 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2941 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2942 |
return event; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2943 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2944 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2945 |
// Deprecated, use jQuery.guid instead |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2946 |
guid: 1E8, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2947 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2948 |
// Deprecated, use jQuery.proxy instead |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2949 |
proxy: jQuery.proxy, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2950 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2951 |
special: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2952 |
ready: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2953 |
// Make sure the ready event is setup |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2954 |
setup: jQuery.bindReady, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2955 |
teardown: jQuery.noop |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2956 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2957 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2958 |
live: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2959 |
add: function( handleObj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2960 |
jQuery.event.add( this, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2961 |
liveConvert( handleObj.origType, handleObj.selector ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2962 |
jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2963 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2964 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2965 |
remove: function( handleObj ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2966 |
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2967 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2968 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2969 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2970 |
beforeunload: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2971 |
setup: function( data, namespaces, eventHandle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2972 |
// We only want to do this special case on windows |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2973 |
if ( jQuery.isWindow( this ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2974 |
this.onbeforeunload = eventHandle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2975 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2976 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2977 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2978 |
teardown: function( namespaces, eventHandle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2979 |
if ( this.onbeforeunload === eventHandle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2980 |
this.onbeforeunload = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2981 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2982 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2983 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2984 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2985 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2986 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2987 |
jQuery.removeEvent = document.removeEventListener ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2988 |
function( elem, type, handle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2989 |
if ( elem.removeEventListener ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2990 |
elem.removeEventListener( type, handle, false ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2991 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2992 |
} : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2993 |
function( elem, type, handle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2994 |
if ( elem.detachEvent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2995 |
elem.detachEvent( "on" + type, handle ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2996 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2997 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2998 |
|
| 101 | 2999 |
jQuery.Event = function( src, props ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3000 |
// Allow instantiation without the 'new' keyword |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3001 |
if ( !this.preventDefault ) {
|
| 101 | 3002 |
return new jQuery.Event( src, props ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3003 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3004 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3005 |
// Event object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3006 |
if ( src && src.type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3007 |
this.originalEvent = src; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3008 |
this.type = src.type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3009 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3010 |
// Events bubbling up the document may have been marked as prevented |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3011 |
// by a handler lower down the tree; reflect the correct value. |
| 101 | 3012 |
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3013 |
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3014 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3015 |
// Event type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3016 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3017 |
this.type = src; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3018 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3019 |
|
| 101 | 3020 |
// Put explicitly provided properties onto the event object |
3021 |
if ( props ) {
|
|
3022 |
jQuery.extend( this, props ); |
|
3023 |
} |
|
3024 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3025 |
// timeStamp is buggy for some events on Firefox(#3843) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3026 |
// So we won't rely on the native value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3027 |
this.timeStamp = jQuery.now(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3028 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3029 |
// Mark it as fixed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3030 |
this[ jQuery.expando ] = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3031 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3032 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3033 |
function returnFalse() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3034 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3035 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3036 |
function returnTrue() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3037 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3038 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3039 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3040 |
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3041 |
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3042 |
jQuery.Event.prototype = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3043 |
preventDefault: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3044 |
this.isDefaultPrevented = returnTrue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3045 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3046 |
var e = this.originalEvent; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3047 |
if ( !e ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3048 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3049 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3050 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3051 |
// if preventDefault exists run it on the original event |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3052 |
if ( e.preventDefault ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3053 |
e.preventDefault(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3054 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3055 |
// otherwise set the returnValue property of the original event to false (IE) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3056 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3057 |
e.returnValue = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3058 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3059 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3060 |
stopPropagation: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3061 |
this.isPropagationStopped = returnTrue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3062 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3063 |
var e = this.originalEvent; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3064 |
if ( !e ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3065 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3066 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3067 |
// if stopPropagation exists run it on the original event |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3068 |
if ( e.stopPropagation ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3069 |
e.stopPropagation(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3070 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3071 |
// otherwise set the cancelBubble property of the original event to true (IE) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3072 |
e.cancelBubble = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3073 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3074 |
stopImmediatePropagation: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3075 |
this.isImmediatePropagationStopped = returnTrue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3076 |
this.stopPropagation(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3077 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3078 |
isDefaultPrevented: returnFalse, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3079 |
isPropagationStopped: returnFalse, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3080 |
isImmediatePropagationStopped: returnFalse |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3081 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3082 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3083 |
// Checks if an event happened on an element within another element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3084 |
// Used in jQuery.event.special.mouseenter and mouseleave handlers |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3085 |
var withinElement = function( event ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3086 |
// Check if mouse(over|out) are still within the same parent element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3087 |
var parent = event.relatedTarget; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3088 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3089 |
// Firefox sometimes assigns relatedTarget a XUL element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3090 |
// which we cannot access the parentNode property of |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3091 |
try {
|
| 101 | 3092 |
|
3093 |
// Chrome does something similar, the parentNode property |
|
3094 |
// can be accessed but is null. |
|
3095 |
if ( parent && parent !== document && !parent.parentNode ) {
|
|
3096 |
return; |
|
3097 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3098 |
// Traverse up the tree |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3099 |
while ( parent && parent !== this ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3100 |
parent = parent.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3101 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3102 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3103 |
if ( parent !== this ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3104 |
// set the correct event type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3105 |
event.type = event.data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3106 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3107 |
// handle event if we actually just moused on to a non sub-element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3108 |
jQuery.event.handle.apply( this, arguments ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3109 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3110 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3111 |
// assuming we've left the element since we most likely mousedover a xul element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3112 |
} catch(e) { }
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3113 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3114 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3115 |
// In case of event delegation, we only need to rename the event.type, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3116 |
// liveHandler will take care of the rest. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3117 |
delegate = function( event ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3118 |
event.type = event.data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3119 |
jQuery.event.handle.apply( this, arguments ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3120 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3121 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3122 |
// Create mouseenter and mouseleave events |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3123 |
jQuery.each({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3124 |
mouseenter: "mouseover", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3125 |
mouseleave: "mouseout" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3126 |
}, function( orig, fix ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3127 |
jQuery.event.special[ orig ] = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3128 |
setup: function( data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3129 |
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3130 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3131 |
teardown: function( data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3132 |
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3133 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3134 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3135 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3136 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3137 |
// submit delegation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3138 |
if ( !jQuery.support.submitBubbles ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3139 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3140 |
jQuery.event.special.submit = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3141 |
setup: function( data, namespaces ) {
|
| 101 | 3142 |
if ( !jQuery.nodeName( this, "form" ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3143 |
jQuery.event.add(this, "click.specialSubmit", function( e ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3144 |
var elem = e.target, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3145 |
type = elem.type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3146 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3147 |
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
|
| 101 | 3148 |
trigger( "submit", this, arguments ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3149 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3150 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3151 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3152 |
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3153 |
var elem = e.target, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3154 |
type = elem.type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3155 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3156 |
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
|
| 101 | 3157 |
trigger( "submit", this, arguments ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3158 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3159 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3160 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3161 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3162 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3163 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3164 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3165 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3166 |
teardown: function( namespaces ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3167 |
jQuery.event.remove( this, ".specialSubmit" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3168 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3169 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3170 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3171 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3172 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3173 |
// change delegation, happens here so we have bind. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3174 |
if ( !jQuery.support.changeBubbles ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3175 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3176 |
var changeFilters, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3177 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3178 |
getVal = function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3179 |
var type = elem.type, val = elem.value; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3180 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3181 |
if ( type === "radio" || type === "checkbox" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3182 |
val = elem.checked; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3183 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3184 |
} else if ( type === "select-multiple" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3185 |
val = elem.selectedIndex > -1 ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3186 |
jQuery.map( elem.options, function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3187 |
return elem.selected; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3188 |
}).join("-") :
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3189 |
""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3190 |
|
| 101 | 3191 |
} else if ( jQuery.nodeName( elem, "select" ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3192 |
val = elem.selectedIndex; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3193 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3194 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3195 |
return val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3196 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3197 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3198 |
testChange = function testChange( e ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3199 |
var elem = e.target, data, val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3200 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3201 |
if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3202 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3203 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3204 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3205 |
data = jQuery._data( elem, "_change_data" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3206 |
val = getVal(elem); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3207 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3208 |
// the current data will be also retrieved by beforeactivate |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3209 |
if ( e.type !== "focusout" || elem.type !== "radio" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3210 |
jQuery._data( elem, "_change_data", val ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3211 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3212 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3213 |
if ( data === undefined || val === data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3214 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3215 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3216 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3217 |
if ( data != null || val ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3218 |
e.type = "change"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3219 |
e.liveFired = undefined; |
| 101 | 3220 |
jQuery.event.trigger( e, arguments[1], elem ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3221 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3222 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3223 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3224 |
jQuery.event.special.change = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3225 |
filters: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3226 |
focusout: testChange, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3227 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3228 |
beforedeactivate: testChange, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3229 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3230 |
click: function( e ) {
|
| 101 | 3231 |
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; |
3232 |
||
3233 |
if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
|
|
3234 |
testChange.call( this, e ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3235 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3236 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3237 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3238 |
// Change has to be called before submit |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3239 |
// Keydown will be called before keypress, which is used in submit-event delegation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3240 |
keydown: function( e ) {
|
| 101 | 3241 |
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; |
3242 |
||
3243 |
if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) || |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3244 |
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3245 |
type === "select-multiple" ) {
|
| 101 | 3246 |
testChange.call( this, e ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3247 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3248 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3249 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3250 |
// Beforeactivate happens also before the previous element is blurred |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3251 |
// with this event you can't trigger a change event, but you can store |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3252 |
// information |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3253 |
beforeactivate: function( e ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3254 |
var elem = e.target; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3255 |
jQuery._data( elem, "_change_data", getVal(elem) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3256 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3257 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3258 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3259 |
setup: function( data, namespaces ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3260 |
if ( this.type === "file" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3261 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3262 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3263 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3264 |
for ( var type in changeFilters ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3265 |
jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3266 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3267 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3268 |
return rformElems.test( this.nodeName ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3269 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3270 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3271 |
teardown: function( namespaces ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3272 |
jQuery.event.remove( this, ".specialChange" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3273 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3274 |
return rformElems.test( this.nodeName ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3275 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3276 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3277 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3278 |
changeFilters = jQuery.event.special.change.filters; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3279 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3280 |
// Handle when the input is .focus()'d |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3281 |
changeFilters.focus = changeFilters.beforeactivate; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3282 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3283 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3284 |
function trigger( type, elem, args ) {
|
| 101 | 3285 |
// Piggyback on a donor event to simulate a different one. |
3286 |
// Fake originalEvent to avoid donor's stopPropagation, but if the |
|
3287 |
// simulated event prevents default then we do the same on the donor. |
|
3288 |
// Don't pass args or remember liveFired; they apply to the donor event. |
|
3289 |
var event = jQuery.extend( {}, args[ 0 ] );
|
|
3290 |
event.type = type; |
|
3291 |
event.originalEvent = {};
|
|
3292 |
event.liveFired = undefined; |
|
3293 |
jQuery.event.handle.call( elem, event ); |
|
3294 |
if ( event.isDefaultPrevented() ) {
|
|
3295 |
args[ 0 ].preventDefault(); |
|
3296 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3297 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3298 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3299 |
// Create "bubbling" focus and blur events |
| 101 | 3300 |
if ( !jQuery.support.focusinBubbles ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3301 |
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
| 101 | 3302 |
|
3303 |
// Attach a single capturing handler while someone wants focusin/focusout |
|
3304 |
var attaches = 0; |
|
3305 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3306 |
jQuery.event.special[ fix ] = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3307 |
setup: function() {
|
| 101 | 3308 |
if ( attaches++ === 0 ) {
|
3309 |
document.addEventListener( orig, handler, true ); |
|
3310 |
} |
|
3311 |
}, |
|
3312 |
teardown: function() {
|
|
3313 |
if ( --attaches === 0 ) {
|
|
3314 |
document.removeEventListener( orig, handler, true ); |
|
3315 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3316 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3317 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3318 |
|
| 101 | 3319 |
function handler( donor ) {
|
3320 |
// Donor event is always a native one; fix it and switch its type. |
|
3321 |
// Let focusin/out handler cancel the donor focus/blur event. |
|
3322 |
var e = jQuery.event.fix( donor ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3323 |
e.type = fix; |
| 101 | 3324 |
e.originalEvent = {};
|
3325 |
jQuery.event.trigger( e, null, e.target ); |
|
3326 |
if ( e.isDefaultPrevented() ) {
|
|
3327 |
donor.preventDefault(); |
|
3328 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3329 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3330 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3331 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3332 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3333 |
jQuery.each(["bind", "one"], function( i, name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3334 |
jQuery.fn[ name ] = function( type, data, fn ) {
|
| 101 | 3335 |
var handler; |
3336 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3337 |
// Handle object literals |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3338 |
if ( typeof type === "object" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3339 |
for ( var key in type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3340 |
this[ name ](key, data, type[key], fn); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3341 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3342 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3343 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3344 |
|
| 101 | 3345 |
if ( arguments.length === 2 || data === false ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3346 |
fn = data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3347 |
data = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3348 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3349 |
|
| 101 | 3350 |
if ( name === "one" ) {
|
3351 |
handler = function( event ) {
|
|
3352 |
jQuery( this ).unbind( event, handler ); |
|
3353 |
return fn.apply( this, arguments ); |
|
3354 |
}; |
|
3355 |
handler.guid = fn.guid || jQuery.guid++; |
|
3356 |
} else {
|
|
3357 |
handler = fn; |
|
3358 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3359 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3360 |
if ( type === "unload" && name !== "one" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3361 |
this.one( type, data, fn ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3362 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3363 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3364 |
for ( var i = 0, l = this.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3365 |
jQuery.event.add( this[i], type, handler, data ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3366 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3367 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3368 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3369 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3370 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3371 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3372 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3373 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3374 |
unbind: function( type, fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3375 |
// Handle object literals |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3376 |
if ( typeof type === "object" && !type.preventDefault ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3377 |
for ( var key in type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3378 |
this.unbind(key, type[key]); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3379 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3380 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3381 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3382 |
for ( var i = 0, l = this.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3383 |
jQuery.event.remove( this[i], type, fn ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3384 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3385 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3386 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3387 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3388 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3389 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3390 |
delegate: function( selector, types, data, fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3391 |
return this.live( types, data, fn, selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3392 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3393 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3394 |
undelegate: function( selector, types, fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3395 |
if ( arguments.length === 0 ) {
|
| 101 | 3396 |
return this.unbind( "live" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3397 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3398 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3399 |
return this.die( types, null, fn, selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3400 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3401 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3402 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3403 |
trigger: function( type, data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3404 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3405 |
jQuery.event.trigger( type, data, this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3406 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3407 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3408 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3409 |
triggerHandler: function( type, data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3410 |
if ( this[0] ) {
|
| 101 | 3411 |
return jQuery.event.trigger( type, data, this[0], true ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3412 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3413 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3414 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3415 |
toggle: function( fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3416 |
// Save reference to arguments for access in closure |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3417 |
var args = arguments, |
| 101 | 3418 |
guid = fn.guid || jQuery.guid++, |
3419 |
i = 0, |
|
3420 |
toggler = function( event ) {
|
|
3421 |
// Figure out which function to execute |
|
3422 |
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; |
|
3423 |
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); |
|
3424 |
||
3425 |
// Make sure that clicks stop |
|
3426 |
event.preventDefault(); |
|
3427 |
||
3428 |
// and execute the function |
|
3429 |
return args[ lastToggle ].apply( this, arguments ) || false; |
|
3430 |
}; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3431 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3432 |
// link all the functions, so any of them can unbind this click handler |
| 101 | 3433 |
toggler.guid = guid; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3434 |
while ( i < args.length ) {
|
| 101 | 3435 |
args[ i++ ].guid = guid; |
3436 |
} |
|
3437 |
||
3438 |
return this.click( toggler ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3439 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3440 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3441 |
hover: function( fnOver, fnOut ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3442 |
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3443 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3444 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3445 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3446 |
var liveMap = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3447 |
focus: "focusin", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3448 |
blur: "focusout", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3449 |
mouseenter: "mouseover", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3450 |
mouseleave: "mouseout" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3451 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3452 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3453 |
jQuery.each(["live", "die"], function( i, name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3454 |
jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3455 |
var type, i = 0, match, namespaces, preType, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3456 |
selector = origSelector || this.selector, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3457 |
context = origSelector ? this : jQuery( this.context ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3458 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3459 |
if ( typeof types === "object" && !types.preventDefault ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3460 |
for ( var key in types ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3461 |
context[ name ]( key, data, types[key], selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3462 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3463 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3464 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3465 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3466 |
|
| 101 | 3467 |
if ( name === "die" && !types && |
3468 |
origSelector && origSelector.charAt(0) === "." ) {
|
|
3469 |
||
3470 |
context.unbind( origSelector ); |
|
3471 |
||
3472 |
return this; |
|
3473 |
} |
|
3474 |
||
3475 |
if ( data === false || jQuery.isFunction( data ) ) {
|
|
3476 |
fn = data || returnFalse; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3477 |
data = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3478 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3479 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3480 |
types = (types || "").split(" ");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3481 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3482 |
while ( (type = types[ i++ ]) != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3483 |
match = rnamespaces.exec( type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3484 |
namespaces = ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3485 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3486 |
if ( match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3487 |
namespaces = match[0]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3488 |
type = type.replace( rnamespaces, "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3489 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3490 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3491 |
if ( type === "hover" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3492 |
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3493 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3494 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3495 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3496 |
preType = type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3497 |
|
| 101 | 3498 |
if ( liveMap[ type ] ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3499 |
types.push( liveMap[ type ] + namespaces ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3500 |
type = type + namespaces; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3501 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3502 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3503 |
type = (liveMap[ type ] || type) + namespaces; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3504 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3505 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3506 |
if ( name === "live" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3507 |
// bind live handler |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3508 |
for ( var j = 0, l = context.length; j < l; j++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3509 |
jQuery.event.add( context[j], "live." + liveConvert( type, selector ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3510 |
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3511 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3512 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3513 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3514 |
// unbind live handler |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3515 |
context.unbind( "live." + liveConvert( type, selector ), fn ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3516 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3517 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3518 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3519 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3520 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3521 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3522 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3523 |
function liveHandler( event ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3524 |
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3525 |
elems = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3526 |
selectors = [], |
| 101 | 3527 |
events = jQuery._data( this, "events" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3528 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3529 |
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3530 |
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3531 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3532 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3533 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3534 |
if ( event.namespace ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3535 |
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3536 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3537 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3538 |
event.liveFired = this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3539 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3540 |
var live = events.live.slice(0); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3541 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3542 |
for ( j = 0; j < live.length; j++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3543 |
handleObj = live[j]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3544 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3545 |
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3546 |
selectors.push( handleObj.selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3547 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3548 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3549 |
live.splice( j--, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3550 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3551 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3552 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3553 |
match = jQuery( event.target ).closest( selectors, event.currentTarget ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3554 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3555 |
for ( i = 0, l = match.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3556 |
close = match[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3557 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3558 |
for ( j = 0; j < live.length; j++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3559 |
handleObj = live[j]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3560 |
|
| 101 | 3561 |
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3562 |
elem = close.elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3563 |
related = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3564 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3565 |
// Those two events require additional checking |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3566 |
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3567 |
event.type = handleObj.preType; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3568 |
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; |
| 101 | 3569 |
|
3570 |
// Make sure not to accidentally match a child element with the same selector |
|
3571 |
if ( related && jQuery.contains( elem, related ) ) {
|
|
3572 |
related = elem; |
|
3573 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3574 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3575 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3576 |
if ( !related || related !== elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3577 |
elems.push({ elem: elem, handleObj: handleObj, level: close.level });
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3578 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3579 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3580 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3581 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3582 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3583 |
for ( i = 0, l = elems.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3584 |
match = elems[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3585 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3586 |
if ( maxLevel && match.level > maxLevel ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3587 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3588 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3589 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3590 |
event.currentTarget = match.elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3591 |
event.data = match.handleObj.data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3592 |
event.handleObj = match.handleObj; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3593 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3594 |
ret = match.handleObj.origHandler.apply( match.elem, arguments ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3595 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3596 |
if ( ret === false || event.isPropagationStopped() ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3597 |
maxLevel = match.level; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3598 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3599 |
if ( ret === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3600 |
stop = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3601 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3602 |
if ( event.isImmediatePropagationStopped() ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3603 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3604 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3605 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3606 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3607 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3608 |
return stop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3609 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3610 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3611 |
function liveConvert( type, selector ) {
|
| 101 | 3612 |
return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&"); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3613 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3614 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3615 |
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3616 |
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3617 |
"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3618 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3619 |
// Handle event binding |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3620 |
jQuery.fn[ name ] = function( data, fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3621 |
if ( fn == null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3622 |
fn = data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3623 |
data = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3624 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3625 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3626 |
return arguments.length > 0 ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3627 |
this.bind( name, data, fn ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3628 |
this.trigger( name ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3629 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3630 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3631 |
if ( jQuery.attrFn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3632 |
jQuery.attrFn[ name ] = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3633 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3634 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3635 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3636 |
|
| 101 | 3637 |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3638 |
/*! |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3639 |
* Sizzle CSS Selector Engine |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3640 |
* Copyright 2011, The Dojo Foundation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3641 |
* Released under the MIT, BSD, and GPL Licenses. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3642 |
* More information: http://sizzlejs.com/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3643 |
*/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3644 |
(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3645 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3646 |
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3647 |
done = 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3648 |
toString = Object.prototype.toString, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3649 |
hasDuplicate = false, |
| 101 | 3650 |
baseHasDuplicate = true, |
3651 |
rBackslash = /\\/g, |
|
3652 |
rNonWord = /\W/; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3653 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3654 |
// Here we check if the JavaScript engine is using some sort of |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3655 |
// optimization where it does not always call our comparision |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3656 |
// function. If that is the case, discard the hasDuplicate value. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3657 |
// Thus far that includes Google Chrome. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3658 |
[0, 0].sort(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3659 |
baseHasDuplicate = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3660 |
return 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3661 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3662 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3663 |
var Sizzle = function( selector, context, results, seed ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3664 |
results = results || []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3665 |
context = context || document; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3666 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3667 |
var origContext = context; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3668 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3669 |
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3670 |
return []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3671 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3672 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3673 |
if ( !selector || typeof selector !== "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3674 |
return results; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3675 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3676 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3677 |
var m, set, checkSet, extra, ret, cur, pop, i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3678 |
prune = true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3679 |
contextXML = Sizzle.isXML( context ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3680 |
parts = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3681 |
soFar = selector; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3682 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3683 |
// Reset the position of the chunker regexp (start from head) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3684 |
do {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3685 |
chunker.exec( "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3686 |
m = chunker.exec( soFar ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3687 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3688 |
if ( m ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3689 |
soFar = m[3]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3690 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3691 |
parts.push( m[1] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3692 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3693 |
if ( m[2] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3694 |
extra = m[3]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3695 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3696 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3697 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3698 |
} while ( m ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3699 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3700 |
if ( parts.length > 1 && origPOS.exec( selector ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3701 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3702 |
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3703 |
set = posProcess( parts[0] + parts[1], context ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3704 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3705 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3706 |
set = Expr.relative[ parts[0] ] ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3707 |
[ context ] : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3708 |
Sizzle( parts.shift(), context ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3709 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3710 |
while ( parts.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3711 |
selector = parts.shift(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3712 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3713 |
if ( Expr.relative[ selector ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3714 |
selector += parts.shift(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3715 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3716 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3717 |
set = posProcess( selector, set ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3718 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3719 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3720 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3721 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3722 |
// Take a shortcut and set the context if the root selector is an ID |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3723 |
// (but not if it'll be faster if the inner selector is an ID) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3724 |
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3725 |
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3726 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3727 |
ret = Sizzle.find( parts.shift(), context, contextXML ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3728 |
context = ret.expr ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3729 |
Sizzle.filter( ret.expr, ret.set )[0] : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3730 |
ret.set[0]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3731 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3732 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3733 |
if ( context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3734 |
ret = seed ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3735 |
{ expr: parts.pop(), set: makeArray(seed) } :
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3736 |
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3737 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3738 |
set = ret.expr ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3739 |
Sizzle.filter( ret.expr, ret.set ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3740 |
ret.set; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3741 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3742 |
if ( parts.length > 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3743 |
checkSet = makeArray( set ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3744 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3745 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3746 |
prune = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3747 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3748 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3749 |
while ( parts.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3750 |
cur = parts.pop(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3751 |
pop = cur; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3752 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3753 |
if ( !Expr.relative[ cur ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3754 |
cur = ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3755 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3756 |
pop = parts.pop(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3757 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3758 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3759 |
if ( pop == null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3760 |
pop = context; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3761 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3762 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3763 |
Expr.relative[ cur ]( checkSet, pop, contextXML ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3764 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3765 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3766 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3767 |
checkSet = parts = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3768 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3769 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3770 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3771 |
if ( !checkSet ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3772 |
checkSet = set; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3773 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3774 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3775 |
if ( !checkSet ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3776 |
Sizzle.error( cur || selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3777 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3778 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3779 |
if ( toString.call(checkSet) === "[object Array]" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3780 |
if ( !prune ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3781 |
results.push.apply( results, checkSet ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3782 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3783 |
} else if ( context && context.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3784 |
for ( i = 0; checkSet[i] != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3785 |
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3786 |
results.push( set[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3787 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3788 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3789 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3790 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3791 |
for ( i = 0; checkSet[i] != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3792 |
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3793 |
results.push( set[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3794 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3795 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3796 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3797 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3798 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3799 |
makeArray( checkSet, results ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3800 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3801 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3802 |
if ( extra ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3803 |
Sizzle( extra, origContext, results, seed ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3804 |
Sizzle.uniqueSort( results ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3805 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3806 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3807 |
return results; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3808 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3809 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3810 |
Sizzle.uniqueSort = function( results ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3811 |
if ( sortOrder ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3812 |
hasDuplicate = baseHasDuplicate; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3813 |
results.sort( sortOrder ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3814 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3815 |
if ( hasDuplicate ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3816 |
for ( var i = 1; i < results.length; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3817 |
if ( results[i] === results[ i - 1 ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3818 |
results.splice( i--, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3819 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3820 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3821 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3822 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3823 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3824 |
return results; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3825 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3826 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3827 |
Sizzle.matches = function( expr, set ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3828 |
return Sizzle( expr, null, null, set ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3829 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3830 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3831 |
Sizzle.matchesSelector = function( node, expr ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3832 |
return Sizzle( expr, null, null, [node] ).length > 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3833 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3834 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3835 |
Sizzle.find = function( expr, context, isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3836 |
var set; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3837 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3838 |
if ( !expr ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3839 |
return []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3840 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3841 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3842 |
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3843 |
var match, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3844 |
type = Expr.order[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3845 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3846 |
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3847 |
var left = match[1]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3848 |
match.splice( 1, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3849 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3850 |
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
| 101 | 3851 |
match[1] = (match[1] || "").replace( rBackslash, "" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3852 |
set = Expr.find[ type ]( match, context, isXML ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3853 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3854 |
if ( set != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3855 |
expr = expr.replace( Expr.match[ type ], "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3856 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3857 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3858 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3859 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3860 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3861 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3862 |
if ( !set ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3863 |
set = typeof context.getElementsByTagName !== "undefined" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3864 |
context.getElementsByTagName( "*" ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3865 |
[]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3866 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3867 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3868 |
return { set: set, expr: expr };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3869 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3870 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3871 |
Sizzle.filter = function( expr, set, inplace, not ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3872 |
var match, anyFound, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3873 |
old = expr, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3874 |
result = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3875 |
curLoop = set, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3876 |
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3877 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3878 |
while ( expr && set.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3879 |
for ( var type in Expr.filter ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3880 |
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3881 |
var found, item, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3882 |
filter = Expr.filter[ type ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3883 |
left = match[1]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3884 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3885 |
anyFound = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3886 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3887 |
match.splice(1,1); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3888 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3889 |
if ( left.substr( left.length - 1 ) === "\\" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3890 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3891 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3892 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3893 |
if ( curLoop === result ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3894 |
result = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3895 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3896 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3897 |
if ( Expr.preFilter[ type ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3898 |
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3899 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3900 |
if ( !match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3901 |
anyFound = found = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3902 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3903 |
} else if ( match === true ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3904 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3905 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3906 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3907 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3908 |
if ( match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3909 |
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3910 |
if ( item ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3911 |
found = filter( item, match, i, curLoop ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3912 |
var pass = not ^ !!found; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3913 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3914 |
if ( inplace && found != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3915 |
if ( pass ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3916 |
anyFound = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3917 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3918 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3919 |
curLoop[i] = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3920 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3921 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3922 |
} else if ( pass ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3923 |
result.push( item ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3924 |
anyFound = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3925 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3926 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3927 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3928 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3929 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3930 |
if ( found !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3931 |
if ( !inplace ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3932 |
curLoop = result; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3933 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3934 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3935 |
expr = expr.replace( Expr.match[ type ], "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3936 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3937 |
if ( !anyFound ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3938 |
return []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3939 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3940 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3941 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3942 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3943 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3944 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3945 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3946 |
// Improper expression |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3947 |
if ( expr === old ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3948 |
if ( anyFound == null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3949 |
Sizzle.error( expr ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3950 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3951 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3952 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3953 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3954 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3955 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3956 |
old = expr; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3957 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3958 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3959 |
return curLoop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3960 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3961 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3962 |
Sizzle.error = function( msg ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3963 |
throw "Syntax error, unrecognized expression: " + msg; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3964 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3965 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3966 |
var Expr = Sizzle.selectors = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3967 |
order: [ "ID", "NAME", "TAG" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3968 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3969 |
match: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3970 |
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3971 |
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3972 |
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3973 |
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3974 |
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3975 |
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3976 |
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3977 |
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3978 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3979 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3980 |
leftMatch: {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3981 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3982 |
attrMap: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3983 |
"class": "className", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3984 |
"for": "htmlFor" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3985 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3986 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3987 |
attrHandle: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3988 |
href: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3989 |
return elem.getAttribute( "href" ); |
| 101 | 3990 |
}, |
3991 |
type: function( elem ) {
|
|
3992 |
return elem.getAttribute( "type" ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3993 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3994 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3995 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3996 |
relative: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3997 |
"+": function(checkSet, part){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3998 |
var isPartStr = typeof part === "string", |
| 101 | 3999 |
isTag = isPartStr && !rNonWord.test( part ), |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4000 |
isPartStrNotTag = isPartStr && !isTag; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4001 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4002 |
if ( isTag ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4003 |
part = part.toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4004 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4005 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4006 |
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4007 |
if ( (elem = checkSet[i]) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4008 |
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4009 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4010 |
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4011 |
elem || false : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4012 |
elem === part; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4013 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4014 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4015 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4016 |
if ( isPartStrNotTag ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4017 |
Sizzle.filter( part, checkSet, true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4018 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4019 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4020 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4021 |
">": function( checkSet, part ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4022 |
var elem, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4023 |
isPartStr = typeof part === "string", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4024 |
i = 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4025 |
l = checkSet.length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4026 |
|
| 101 | 4027 |
if ( isPartStr && !rNonWord.test( part ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4028 |
part = part.toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4029 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4030 |
for ( ; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4031 |
elem = checkSet[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4032 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4033 |
if ( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4034 |
var parent = elem.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4035 |
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4036 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4037 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4038 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4039 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4040 |
for ( ; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4041 |
elem = checkSet[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4042 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4043 |
if ( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4044 |
checkSet[i] = isPartStr ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4045 |
elem.parentNode : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4046 |
elem.parentNode === part; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4047 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4048 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4049 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4050 |
if ( isPartStr ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4051 |
Sizzle.filter( part, checkSet, true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4052 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4053 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4054 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4055 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4056 |
"": function(checkSet, part, isXML){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4057 |
var nodeCheck, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4058 |
doneName = done++, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4059 |
checkFn = dirCheck; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4060 |
|
| 101 | 4061 |
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4062 |
part = part.toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4063 |
nodeCheck = part; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4064 |
checkFn = dirNodeCheck; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4065 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4066 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4067 |
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4068 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4069 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4070 |
"~": function( checkSet, part, isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4071 |
var nodeCheck, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4072 |
doneName = done++, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4073 |
checkFn = dirCheck; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4074 |
|
| 101 | 4075 |
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4076 |
part = part.toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4077 |
nodeCheck = part; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4078 |
checkFn = dirNodeCheck; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4079 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4080 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4081 |
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4082 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4083 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4084 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4085 |
find: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4086 |
ID: function( match, context, isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4087 |
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4088 |
var m = context.getElementById(match[1]); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4089 |
// Check parentNode to catch when Blackberry 4.6 returns |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4090 |
// nodes that are no longer in the document #6963 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4091 |
return m && m.parentNode ? [m] : []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4092 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4093 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4094 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4095 |
NAME: function( match, context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4096 |
if ( typeof context.getElementsByName !== "undefined" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4097 |
var ret = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4098 |
results = context.getElementsByName( match[1] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4099 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4100 |
for ( var i = 0, l = results.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4101 |
if ( results[i].getAttribute("name") === match[1] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4102 |
ret.push( results[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4103 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4104 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4105 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4106 |
return ret.length === 0 ? null : ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4107 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4108 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4109 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4110 |
TAG: function( match, context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4111 |
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4112 |
return context.getElementsByTagName( match[1] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4113 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4114 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4115 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4116 |
preFilter: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4117 |
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
|
| 101 | 4118 |
match = " " + match[1].replace( rBackslash, "" ) + " "; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4119 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4120 |
if ( isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4121 |
return match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4122 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4123 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4124 |
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4125 |
if ( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4126 |
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4127 |
if ( !inplace ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4128 |
result.push( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4129 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4130 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4131 |
} else if ( inplace ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4132 |
curLoop[i] = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4133 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4134 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4135 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4136 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4137 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4138 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4139 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4140 |
ID: function( match ) {
|
| 101 | 4141 |
return match[1].replace( rBackslash, "" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4142 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4143 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4144 |
TAG: function( match, curLoop ) {
|
| 101 | 4145 |
return match[1].replace( rBackslash, "" ).toLowerCase(); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4146 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4147 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4148 |
CHILD: function( match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4149 |
if ( match[1] === "nth" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4150 |
if ( !match[2] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4151 |
Sizzle.error( match[0] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4152 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4153 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4154 |
match[2] = match[2].replace(/^\+|\s*/g, ''); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4155 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4156 |
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4157 |
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4158 |
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4159 |
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4160 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4161 |
// calculate the numbers (first)n+(last) including if they are negative |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4162 |
match[2] = (test[1] + (test[2] || 1)) - 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4163 |
match[3] = test[3] - 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4164 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4165 |
else if ( match[2] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4166 |
Sizzle.error( match[0] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4167 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4168 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4169 |
// TODO: Move to normal caching system |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4170 |
match[0] = done++; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4171 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4172 |
return match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4173 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4174 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4175 |
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
|
| 101 | 4176 |
var name = match[1] = match[1].replace( rBackslash, "" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4177 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4178 |
if ( !isXML && Expr.attrMap[name] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4179 |
match[1] = Expr.attrMap[name]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4180 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4181 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4182 |
// Handle if an un-quoted value was used |
| 101 | 4183 |
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4184 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4185 |
if ( match[2] === "~=" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4186 |
match[4] = " " + match[4] + " "; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4187 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4188 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4189 |
return match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4190 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4191 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4192 |
PSEUDO: function( match, curLoop, inplace, result, not ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4193 |
if ( match[1] === "not" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4194 |
// If we're dealing with a complex expression, or a simple one |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4195 |
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4196 |
match[3] = Sizzle(match[3], null, null, curLoop); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4197 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4198 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4199 |
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4200 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4201 |
if ( !inplace ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4202 |
result.push.apply( result, ret ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4203 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4204 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4205 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4206 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4207 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4208 |
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4209 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4210 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4211 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4212 |
return match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4213 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4214 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4215 |
POS: function( match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4216 |
match.unshift( true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4217 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4218 |
return match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4219 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4220 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4221 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4222 |
filters: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4223 |
enabled: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4224 |
return elem.disabled === false && elem.type !== "hidden"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4225 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4226 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4227 |
disabled: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4228 |
return elem.disabled === true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4229 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4230 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4231 |
checked: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4232 |
return elem.checked === true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4233 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4234 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4235 |
selected: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4236 |
// Accessing this property makes selected-by-default |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4237 |
// options in Safari work properly |
| 101 | 4238 |
if ( elem.parentNode ) {
|
4239 |
elem.parentNode.selectedIndex; |
|
4240 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4241 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4242 |
return elem.selected === true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4243 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4244 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4245 |
parent: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4246 |
return !!elem.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4247 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4248 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4249 |
empty: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4250 |
return !elem.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4251 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4252 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4253 |
has: function( elem, i, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4254 |
return !!Sizzle( match[3], elem ).length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4255 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4256 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4257 |
header: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4258 |
return (/h\d/i).test( elem.nodeName ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4259 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4260 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4261 |
text: function( elem ) {
|
| 101 | 4262 |
var attr = elem.getAttribute( "type" ), type = elem.type; |
4263 |
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) |
|
4264 |
// use getAttribute instead to test this case |
|
4265 |
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4266 |
}, |
| 101 | 4267 |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4268 |
radio: function( elem ) {
|
| 101 | 4269 |
return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4270 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4271 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4272 |
checkbox: function( elem ) {
|
| 101 | 4273 |
return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4274 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4275 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4276 |
file: function( elem ) {
|
| 101 | 4277 |
return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4278 |
}, |
| 101 | 4279 |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4280 |
password: function( elem ) {
|
| 101 | 4281 |
return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4282 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4283 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4284 |
submit: function( elem ) {
|
| 101 | 4285 |
var name = elem.nodeName.toLowerCase(); |
4286 |
return (name === "input" || name === "button") && "submit" === elem.type; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4287 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4288 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4289 |
image: function( elem ) {
|
| 101 | 4290 |
return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4291 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4292 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4293 |
reset: function( elem ) {
|
| 101 | 4294 |
return elem.nodeName.toLowerCase() === "input" && "reset" === elem.type; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4295 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4296 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4297 |
button: function( elem ) {
|
| 101 | 4298 |
var name = elem.nodeName.toLowerCase(); |
4299 |
return name === "input" && "button" === elem.type || name === "button"; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4300 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4301 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4302 |
input: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4303 |
return (/input|select|textarea|button/i).test( elem.nodeName ); |
| 101 | 4304 |
}, |
4305 |
||
4306 |
focus: function( elem ) {
|
|
4307 |
return elem === elem.ownerDocument.activeElement; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4308 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4309 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4310 |
setFilters: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4311 |
first: function( elem, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4312 |
return i === 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4313 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4314 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4315 |
last: function( elem, i, match, array ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4316 |
return i === array.length - 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4317 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4318 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4319 |
even: function( elem, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4320 |
return i % 2 === 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4321 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4322 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4323 |
odd: function( elem, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4324 |
return i % 2 === 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4325 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4326 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4327 |
lt: function( elem, i, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4328 |
return i < match[3] - 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4329 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4330 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4331 |
gt: function( elem, i, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4332 |
return i > match[3] - 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4333 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4334 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4335 |
nth: function( elem, i, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4336 |
return match[3] - 0 === i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4337 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4338 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4339 |
eq: function( elem, i, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4340 |
return match[3] - 0 === i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4341 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4342 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4343 |
filter: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4344 |
PSEUDO: function( elem, match, i, array ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4345 |
var name = match[1], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4346 |
filter = Expr.filters[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4347 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4348 |
if ( filter ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4349 |
return filter( elem, i, match, array ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4350 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4351 |
} else if ( name === "contains" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4352 |
return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4353 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4354 |
} else if ( name === "not" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4355 |
var not = match[3]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4356 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4357 |
for ( var j = 0, l = not.length; j < l; j++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4358 |
if ( not[j] === elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4359 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4360 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4361 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4362 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4363 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4364 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4365 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4366 |
Sizzle.error( name ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4367 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4368 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4369 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4370 |
CHILD: function( elem, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4371 |
var type = match[1], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4372 |
node = elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4373 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4374 |
switch ( type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4375 |
case "only": |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4376 |
case "first": |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4377 |
while ( (node = node.previousSibling) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4378 |
if ( node.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4379 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4380 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4381 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4382 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4383 |
if ( type === "first" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4384 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4385 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4386 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4387 |
node = elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4388 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4389 |
case "last": |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4390 |
while ( (node = node.nextSibling) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4391 |
if ( node.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4392 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4393 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4394 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4395 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4396 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4397 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4398 |
case "nth": |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4399 |
var first = match[2], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4400 |
last = match[3]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4401 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4402 |
if ( first === 1 && last === 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4403 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4404 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4405 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4406 |
var doneName = match[0], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4407 |
parent = elem.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4408 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4409 |
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4410 |
var count = 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4411 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4412 |
for ( node = parent.firstChild; node; node = node.nextSibling ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4413 |
if ( node.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4414 |
node.nodeIndex = ++count; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4415 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4416 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4417 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4418 |
parent.sizcache = doneName; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4419 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4420 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4421 |
var diff = elem.nodeIndex - last; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4422 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4423 |
if ( first === 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4424 |
return diff === 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4425 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4426 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4427 |
return ( diff % first === 0 && diff / first >= 0 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4428 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4429 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4430 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4431 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4432 |
ID: function( elem, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4433 |
return elem.nodeType === 1 && elem.getAttribute("id") === match;
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4434 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4435 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4436 |
TAG: function( elem, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4437 |
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4438 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4439 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4440 |
CLASS: function( elem, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4441 |
return (" " + (elem.className || elem.getAttribute("class")) + " ")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4442 |
.indexOf( match ) > -1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4443 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4444 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4445 |
ATTR: function( elem, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4446 |
var name = match[1], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4447 |
result = Expr.attrHandle[ name ] ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4448 |
Expr.attrHandle[ name ]( elem ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4449 |
elem[ name ] != null ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4450 |
elem[ name ] : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4451 |
elem.getAttribute( name ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4452 |
value = result + "", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4453 |
type = match[2], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4454 |
check = match[4]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4455 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4456 |
return result == null ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4457 |
type === "!=" : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4458 |
type === "=" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4459 |
value === check : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4460 |
type === "*=" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4461 |
value.indexOf(check) >= 0 : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4462 |
type === "~=" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4463 |
(" " + value + " ").indexOf(check) >= 0 :
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4464 |
!check ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4465 |
value && result !== false : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4466 |
type === "!=" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4467 |
value !== check : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4468 |
type === "^=" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4469 |
value.indexOf(check) === 0 : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4470 |
type === "$=" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4471 |
value.substr(value.length - check.length) === check : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4472 |
type === "|=" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4473 |
value === check || value.substr(0, check.length + 1) === check + "-" : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4474 |
false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4475 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4476 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4477 |
POS: function( elem, match, i, array ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4478 |
var name = match[2], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4479 |
filter = Expr.setFilters[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4480 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4481 |
if ( filter ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4482 |
return filter( elem, i, match, array ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4483 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4484 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4485 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4486 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4487 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4488 |
var origPOS = Expr.match.POS, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4489 |
fescape = function(all, num){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4490 |
return "\\" + (num - 0 + 1); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4491 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4492 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4493 |
for ( var type in Expr.match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4494 |
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4495 |
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4496 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4497 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4498 |
var makeArray = function( array, results ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4499 |
array = Array.prototype.slice.call( array, 0 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4500 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4501 |
if ( results ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4502 |
results.push.apply( results, array ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4503 |
return results; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4504 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4505 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4506 |
return array; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4507 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4508 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4509 |
// Perform a simple check to determine if the browser is capable of |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4510 |
// converting a NodeList to an array using builtin methods. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4511 |
// Also verifies that the returned array holds DOM nodes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4512 |
// (which is not the case in the Blackberry browser) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4513 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4514 |
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4515 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4516 |
// Provide a fallback method if it does not work |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4517 |
} catch( e ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4518 |
makeArray = function( array, results ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4519 |
var i = 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4520 |
ret = results || []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4521 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4522 |
if ( toString.call(array) === "[object Array]" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4523 |
Array.prototype.push.apply( ret, array ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4524 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4525 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4526 |
if ( typeof array.length === "number" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4527 |
for ( var l = array.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4528 |
ret.push( array[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4529 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4530 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4531 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4532 |
for ( ; array[i]; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4533 |
ret.push( array[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4534 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4535 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4536 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4537 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4538 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4539 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4540 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4541 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4542 |
var sortOrder, siblingCheck; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4543 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4544 |
if ( document.documentElement.compareDocumentPosition ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4545 |
sortOrder = function( a, b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4546 |
if ( a === b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4547 |
hasDuplicate = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4548 |
return 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4549 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4550 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4551 |
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4552 |
return a.compareDocumentPosition ? -1 : 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4553 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4554 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4555 |
return a.compareDocumentPosition(b) & 4 ? -1 : 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4556 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4557 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4558 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4559 |
sortOrder = function( a, b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4560 |
var al, bl, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4561 |
ap = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4562 |
bp = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4563 |
aup = a.parentNode, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4564 |
bup = b.parentNode, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4565 |
cur = aup; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4566 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4567 |
// The nodes are identical, we can exit early |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4568 |
if ( a === b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4569 |
hasDuplicate = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4570 |
return 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4571 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4572 |
// If the nodes are siblings (or identical) we can do a quick check |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4573 |
} else if ( aup === bup ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4574 |
return siblingCheck( a, b ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4575 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4576 |
// If no parents were found then the nodes are disconnected |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4577 |
} else if ( !aup ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4578 |
return -1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4579 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4580 |
} else if ( !bup ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4581 |
return 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4582 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4583 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4584 |
// Otherwise they're somewhere else in the tree so we need |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4585 |
// to build up a full list of the parentNodes for comparison |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4586 |
while ( cur ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4587 |
ap.unshift( cur ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4588 |
cur = cur.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4589 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4590 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4591 |
cur = bup; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4592 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4593 |
while ( cur ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4594 |
bp.unshift( cur ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4595 |
cur = cur.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4596 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4597 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4598 |
al = ap.length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4599 |
bl = bp.length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4600 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4601 |
// Start walking down the tree looking for a discrepancy |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4602 |
for ( var i = 0; i < al && i < bl; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4603 |
if ( ap[i] !== bp[i] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4604 |
return siblingCheck( ap[i], bp[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4605 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4606 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4607 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4608 |
// We ended someplace up the tree so do a sibling check |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4609 |
return i === al ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4610 |
siblingCheck( a, bp[i], -1 ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4611 |
siblingCheck( ap[i], b, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4612 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4613 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4614 |
siblingCheck = function( a, b, ret ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4615 |
if ( a === b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4616 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4617 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4618 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4619 |
var cur = a.nextSibling; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4620 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4621 |
while ( cur ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4622 |
if ( cur === b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4623 |
return -1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4624 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4625 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4626 |
cur = cur.nextSibling; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4627 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4628 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4629 |
return 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4630 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4631 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4632 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4633 |
// Utility function for retreiving the text value of an array of DOM nodes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4634 |
Sizzle.getText = function( elems ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4635 |
var ret = "", elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4636 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4637 |
for ( var i = 0; elems[i]; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4638 |
elem = elems[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4639 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4640 |
// Get the text from text nodes and CDATA nodes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4641 |
if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4642 |
ret += elem.nodeValue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4643 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4644 |
// Traverse everything else, except comment nodes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4645 |
} else if ( elem.nodeType !== 8 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4646 |
ret += Sizzle.getText( elem.childNodes ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4647 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4648 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4649 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4650 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4651 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4652 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4653 |
// Check to see if the browser returns elements by name when |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4654 |
// querying by getElementById (and provide a workaround) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4655 |
(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4656 |
// We're going to inject a fake input element with a specified name |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4657 |
var form = document.createElement("div"),
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4658 |
id = "script" + (new Date()).getTime(), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4659 |
root = document.documentElement; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4660 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4661 |
form.innerHTML = "<a name='" + id + "'/>"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4662 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4663 |
// Inject it into the root element, check its status, and remove it quickly |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4664 |
root.insertBefore( form, root.firstChild ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4665 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4666 |
// The workaround has to do additional checks after a getElementById |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4667 |
// Which slows things down for other browsers (hence the branching) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4668 |
if ( document.getElementById( id ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4669 |
Expr.find.ID = function( match, context, isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4670 |
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4671 |
var m = context.getElementById(match[1]); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4672 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4673 |
return m ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4674 |
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4675 |
[m] : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4676 |
undefined : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4677 |
[]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4678 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4679 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4680 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4681 |
Expr.filter.ID = function( elem, match ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4682 |
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4683 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4684 |
return elem.nodeType === 1 && node && node.nodeValue === match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4685 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4686 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4687 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4688 |
root.removeChild( form ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4689 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4690 |
// release memory in IE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4691 |
root = form = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4692 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4693 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4694 |
(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4695 |
// Check to see if the browser returns only elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4696 |
// when doing getElementsByTagName("*")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4697 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4698 |
// Create a fake element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4699 |
var div = document.createElement("div");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4700 |
div.appendChild( document.createComment("") );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4701 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4702 |
// Make sure no comments are found |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4703 |
if ( div.getElementsByTagName("*").length > 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4704 |
Expr.find.TAG = function( match, context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4705 |
var results = context.getElementsByTagName( match[1] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4706 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4707 |
// Filter out possible comments |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4708 |
if ( match[1] === "*" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4709 |
var tmp = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4710 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4711 |
for ( var i = 0; results[i]; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4712 |
if ( results[i].nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4713 |
tmp.push( results[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4714 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4715 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4716 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4717 |
results = tmp; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4718 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4719 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4720 |
return results; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4721 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4722 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4723 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4724 |
// Check to see if an attribute returns normalized href attributes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4725 |
div.innerHTML = "<a href='#'></a>"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4726 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4727 |
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4728 |
div.firstChild.getAttribute("href") !== "#" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4729 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4730 |
Expr.attrHandle.href = function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4731 |
return elem.getAttribute( "href", 2 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4732 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4733 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4734 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4735 |
// release memory in IE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4736 |
div = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4737 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4738 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4739 |
if ( document.querySelectorAll ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4740 |
(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4741 |
var oldSizzle = Sizzle, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4742 |
div = document.createElement("div"),
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4743 |
id = "__sizzle__"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4744 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4745 |
div.innerHTML = "<p class='TEST'></p>"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4746 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4747 |
// Safari can't handle uppercase or unicode characters when |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4748 |
// in quirks mode. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4749 |
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4750 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4751 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4752 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4753 |
Sizzle = function( query, context, extra, seed ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4754 |
context = context || document; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4755 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4756 |
// Only use querySelectorAll on non-XML documents |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4757 |
// (ID selectors don't work in non-HTML documents) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4758 |
if ( !seed && !Sizzle.isXML(context) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4759 |
// See if we find a selector to speed up |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4760 |
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4761 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4762 |
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4763 |
// Speed-up: Sizzle("TAG")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4764 |
if ( match[1] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4765 |
return makeArray( context.getElementsByTagName( query ), extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4766 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4767 |
// Speed-up: Sizzle(".CLASS")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4768 |
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4769 |
return makeArray( context.getElementsByClassName( match[2] ), extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4770 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4771 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4772 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4773 |
if ( context.nodeType === 9 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4774 |
// Speed-up: Sizzle("body")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4775 |
// The body element only exists once, optimize finding it |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4776 |
if ( query === "body" && context.body ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4777 |
return makeArray( [ context.body ], extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4778 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4779 |
// Speed-up: Sizzle("#ID")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4780 |
} else if ( match && match[3] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4781 |
var elem = context.getElementById( match[3] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4782 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4783 |
// Check parentNode to catch when Blackberry 4.6 returns |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4784 |
// nodes that are no longer in the document #6963 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4785 |
if ( elem && elem.parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4786 |
// Handle the case where IE and Opera return items |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4787 |
// by name instead of ID |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4788 |
if ( elem.id === match[3] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4789 |
return makeArray( [ elem ], extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4790 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4791 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4792 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4793 |
return makeArray( [], extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4794 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4795 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4796 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4797 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4798 |
return makeArray( context.querySelectorAll(query), extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4799 |
} catch(qsaError) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4800 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4801 |
// qSA works strangely on Element-rooted queries |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4802 |
// We can work around this by specifying an extra ID on the root |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4803 |
// and working up from there (Thanks to Andrew Dupont for the technique) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4804 |
// IE 8 doesn't work on object elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4805 |
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
| 101 | 4806 |
var oldContext = context, |
4807 |
old = context.getAttribute( "id" ), |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4808 |
nid = old || id, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4809 |
hasParent = context.parentNode, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4810 |
relativeHierarchySelector = /^\s*[+~]/.test( query ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4811 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4812 |
if ( !old ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4813 |
context.setAttribute( "id", nid ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4814 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4815 |
nid = nid.replace( /'/g, "\\$&" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4816 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4817 |
if ( relativeHierarchySelector && hasParent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4818 |
context = context.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4819 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4820 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4821 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4822 |
if ( !relativeHierarchySelector || hasParent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4823 |
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4824 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4825 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4826 |
} catch(pseudoError) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4827 |
} finally {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4828 |
if ( !old ) {
|
| 101 | 4829 |
oldContext.removeAttribute( "id" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4830 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4831 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4832 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4833 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4834 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4835 |
return oldSizzle(query, context, extra, seed); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4836 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4837 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4838 |
for ( var prop in oldSizzle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4839 |
Sizzle[ prop ] = oldSizzle[ prop ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4840 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4841 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4842 |
// release memory in IE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4843 |
div = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4844 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4845 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4846 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4847 |
(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4848 |
var html = document.documentElement, |
| 101 | 4849 |
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4850 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4851 |
if ( matches ) {
|
| 101 | 4852 |
// Check to see if it's possible to do matchesSelector |
4853 |
// on a disconnected node (IE 9 fails this) |
|
4854 |
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), |
|
4855 |
pseudoWorks = false; |
|
4856 |
||
4857 |
try {
|
|
4858 |
// This should fail with an exception |
|
4859 |
// Gecko does not error, returns false instead |
|
4860 |
matches.call( document.documentElement, "[test!='']:sizzle" ); |
|
4861 |
||
4862 |
} catch( pseudoError ) {
|
|
4863 |
pseudoWorks = true; |
|
4864 |
} |
|
4865 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4866 |
Sizzle.matchesSelector = function( node, expr ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4867 |
// Make sure that attribute selectors are quoted |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4868 |
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4869 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4870 |
if ( !Sizzle.isXML( node ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4871 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4872 |
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
|
| 101 | 4873 |
var ret = matches.call( node, expr ); |
4874 |
||
4875 |
// IE 9's matchesSelector returns false on disconnected nodes |
|
4876 |
if ( ret || !disconnectedMatch || |
|
4877 |
// As well, disconnected nodes are said to be in a document |
|
4878 |
// fragment in IE 9, so check for that |
|
4879 |
node.document && node.document.nodeType !== 11 ) {
|
|
4880 |
return ret; |
|
4881 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4882 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4883 |
} catch(e) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4884 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4885 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4886 |
return Sizzle(expr, null, null, [node]).length > 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4887 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4888 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4889 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4890 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4891 |
(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4892 |
var div = document.createElement("div");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4893 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4894 |
div.innerHTML = "<div class='test e'></div><div class='test'></div>"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4895 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4896 |
// Opera can't find a second classname (in 9.6) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4897 |
// Also, make sure that getElementsByClassName actually exists |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4898 |
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4899 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4900 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4901 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4902 |
// Safari caches class attributes, doesn't catch changes (in 3.2) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4903 |
div.lastChild.className = "e"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4904 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4905 |
if ( div.getElementsByClassName("e").length === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4906 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4907 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4908 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4909 |
Expr.order.splice(1, 0, "CLASS"); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4910 |
Expr.find.CLASS = function( match, context, isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4911 |
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4912 |
return context.getElementsByClassName(match[1]); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4913 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4914 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4915 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4916 |
// release memory in IE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4917 |
div = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4918 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4919 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4920 |
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4921 |
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4922 |
var elem = checkSet[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4923 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4924 |
if ( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4925 |
var match = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4926 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4927 |
elem = elem[dir]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4928 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4929 |
while ( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4930 |
if ( elem.sizcache === doneName ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4931 |
match = checkSet[elem.sizset]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4932 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4933 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4934 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4935 |
if ( elem.nodeType === 1 && !isXML ){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4936 |
elem.sizcache = doneName; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4937 |
elem.sizset = i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4938 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4939 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4940 |
if ( elem.nodeName.toLowerCase() === cur ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4941 |
match = elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4942 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4943 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4944 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4945 |
elem = elem[dir]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4946 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4947 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4948 |
checkSet[i] = match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4949 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4950 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4951 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4952 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4953 |
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4954 |
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4955 |
var elem = checkSet[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4956 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4957 |
if ( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4958 |
var match = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4959 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4960 |
elem = elem[dir]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4961 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4962 |
while ( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4963 |
if ( elem.sizcache === doneName ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4964 |
match = checkSet[elem.sizset]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4965 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4966 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4967 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4968 |
if ( elem.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4969 |
if ( !isXML ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4970 |
elem.sizcache = doneName; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4971 |
elem.sizset = i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4972 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4973 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4974 |
if ( typeof cur !== "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4975 |
if ( elem === cur ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4976 |
match = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4977 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4978 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4979 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4980 |
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4981 |
match = elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4982 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4983 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4984 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4985 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4986 |
elem = elem[dir]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4987 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4988 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4989 |
checkSet[i] = match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4990 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4991 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4992 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4993 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4994 |
if ( document.documentElement.contains ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4995 |
Sizzle.contains = function( a, b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4996 |
return a !== b && (a.contains ? a.contains(b) : true); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4997 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4998 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4999 |
} else if ( document.documentElement.compareDocumentPosition ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5000 |
Sizzle.contains = function( a, b ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5001 |
return !!(a.compareDocumentPosition(b) & 16); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5002 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5003 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5004 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5005 |
Sizzle.contains = function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5006 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5007 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5008 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5009 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5010 |
Sizzle.isXML = function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5011 |
// documentElement is verified for cases where it doesn't yet exist |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5012 |
// (such as loading iframes in IE - #4833) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5013 |
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5014 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5015 |
return documentElement ? documentElement.nodeName !== "HTML" : false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5016 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5017 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5018 |
var posProcess = function( selector, context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5019 |
var match, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5020 |
tmpSet = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5021 |
later = "", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5022 |
root = context.nodeType ? [context] : context; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5023 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5024 |
// Position selectors must be done after the filter |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5025 |
// And so must :not(positional) so we move all PSEUDOs to the end |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5026 |
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5027 |
later += match[0]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5028 |
selector = selector.replace( Expr.match.PSEUDO, "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5029 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5030 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5031 |
selector = Expr.relative[selector] ? selector + "*" : selector; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5032 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5033 |
for ( var i = 0, l = root.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5034 |
Sizzle( selector, root[i], tmpSet ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5035 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5036 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5037 |
return Sizzle.filter( later, tmpSet ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5038 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5039 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5040 |
// EXPOSE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5041 |
jQuery.find = Sizzle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5042 |
jQuery.expr = Sizzle.selectors; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5043 |
jQuery.expr[":"] = jQuery.expr.filters; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5044 |
jQuery.unique = Sizzle.uniqueSort; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5045 |
jQuery.text = Sizzle.getText; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5046 |
jQuery.isXMLDoc = Sizzle.isXML; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5047 |
jQuery.contains = Sizzle.contains; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5048 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5049 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5050 |
})(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5051 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5052 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5053 |
var runtil = /Until$/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5054 |
rparentsprev = /^(?:parents|prevUntil|prevAll)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5055 |
// Note: This RegExp should be improved, or likely pulled from Sizzle |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5056 |
rmultiselector = /,/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5057 |
isSimple = /^.[^:#\[\.,]*$/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5058 |
slice = Array.prototype.slice, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5059 |
POS = jQuery.expr.match.POS, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5060 |
// methods guaranteed to produce a unique set when starting from a unique set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5061 |
guaranteedUnique = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5062 |
children: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5063 |
contents: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5064 |
next: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5065 |
prev: true |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5066 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5067 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5068 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5069 |
find: function( selector ) {
|
| 101 | 5070 |
var self = this, |
5071 |
i, l; |
|
5072 |
||
5073 |
if ( typeof selector !== "string" ) {
|
|
5074 |
return jQuery( selector ).filter(function() {
|
|
5075 |
for ( i = 0, l = self.length; i < l; i++ ) {
|
|
5076 |
if ( jQuery.contains( self[ i ], this ) ) {
|
|
5077 |
return true; |
|
5078 |
} |
|
5079 |
} |
|
5080 |
}); |
|
5081 |
} |
|
5082 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5083 |
var ret = this.pushStack( "", "find", selector ), |
| 101 | 5084 |
length, n, r; |
5085 |
||
5086 |
for ( i = 0, l = this.length; i < l; i++ ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5087 |
length = ret.length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5088 |
jQuery.find( selector, this[i], ret ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5089 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5090 |
if ( i > 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5091 |
// Make sure that the results are unique |
| 101 | 5092 |
for ( n = length; n < ret.length; n++ ) {
|
5093 |
for ( r = 0; r < length; r++ ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5094 |
if ( ret[r] === ret[n] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5095 |
ret.splice(n--, 1); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5096 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5097 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5098 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5099 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5100 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5101 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5102 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5103 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5104 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5105 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5106 |
has: function( target ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5107 |
var targets = jQuery( target ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5108 |
return this.filter(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5109 |
for ( var i = 0, l = targets.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5110 |
if ( jQuery.contains( this, targets[i] ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5111 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5112 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5113 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5114 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5115 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5116 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5117 |
not: function( selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5118 |
return this.pushStack( winnow(this, selector, false), "not", selector); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5119 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5120 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5121 |
filter: function( selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5122 |
return this.pushStack( winnow(this, selector, true), "filter", selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5123 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5124 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5125 |
is: function( selector ) {
|
| 101 | 5126 |
return !!selector && ( typeof selector === "string" ? |
5127 |
jQuery.filter( selector, this ).length > 0 : |
|
5128 |
this.filter( selector ).length > 0 ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5129 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5130 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5131 |
closest: function( selectors, context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5132 |
var ret = [], i, l, cur = this[0]; |
| 101 | 5133 |
|
5134 |
// Array |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5135 |
if ( jQuery.isArray( selectors ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5136 |
var match, selector, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5137 |
matches = {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5138 |
level = 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5139 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5140 |
if ( cur && selectors.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5141 |
for ( i = 0, l = selectors.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5142 |
selector = selectors[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5143 |
|
| 101 | 5144 |
if ( !matches[ selector ] ) {
|
5145 |
matches[ selector ] = POS.test( selector ) ? |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5146 |
jQuery( selector, context || this.context ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5147 |
selector; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5148 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5149 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5150 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5151 |
while ( cur && cur.ownerDocument && cur !== context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5152 |
for ( selector in matches ) {
|
| 101 | 5153 |
match = matches[ selector ]; |
5154 |
||
5155 |
if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5156 |
ret.push({ selector: selector, elem: cur, level: level });
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5157 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5158 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5159 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5160 |
cur = cur.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5161 |
level++; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5162 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5163 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5164 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5165 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5166 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5167 |
|
| 101 | 5168 |
// String |
5169 |
var pos = POS.test( selectors ) || typeof selectors !== "string" ? |
|
5170 |
jQuery( selectors, context || this.context ) : |
|
5171 |
0; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5172 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5173 |
for ( i = 0, l = this.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5174 |
cur = this[i]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5175 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5176 |
while ( cur ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5177 |
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5178 |
ret.push( cur ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5179 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5180 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5181 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5182 |
cur = cur.parentNode; |
| 101 | 5183 |
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5184 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5185 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5186 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5187 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5188 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5189 |
|
| 101 | 5190 |
ret = ret.length > 1 ? jQuery.unique( ret ) : ret; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5191 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5192 |
return this.pushStack( ret, "closest", selectors ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5193 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5194 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5195 |
// Determine the position of an element within |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5196 |
// the matched set of elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5197 |
index: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5198 |
if ( !elem || typeof elem === "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5199 |
return jQuery.inArray( this[0], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5200 |
// If it receives a string, the selector is used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5201 |
// If it receives nothing, the siblings are used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5202 |
elem ? jQuery( elem ) : this.parent().children() ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5203 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5204 |
// Locate the position of the desired element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5205 |
return jQuery.inArray( |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5206 |
// If it receives a jQuery object, the first element is used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5207 |
elem.jquery ? elem[0] : elem, this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5208 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5209 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5210 |
add: function( selector, context ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5211 |
var set = typeof selector === "string" ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5212 |
jQuery( selector, context ) : |
| 101 | 5213 |
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5214 |
all = jQuery.merge( this.get(), set ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5215 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5216 |
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5217 |
all : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5218 |
jQuery.unique( all ) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5219 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5220 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5221 |
andSelf: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5222 |
return this.add( this.prevObject ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5223 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5224 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5225 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5226 |
// A painfully simple check to see if an element is disconnected |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5227 |
// from a document (should be improved, where feasible). |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5228 |
function isDisconnected( node ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5229 |
return !node || !node.parentNode || node.parentNode.nodeType === 11; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5230 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5231 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5232 |
jQuery.each({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5233 |
parent: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5234 |
var parent = elem.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5235 |
return parent && parent.nodeType !== 11 ? parent : null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5236 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5237 |
parents: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5238 |
return jQuery.dir( elem, "parentNode" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5239 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5240 |
parentsUntil: function( elem, i, until ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5241 |
return jQuery.dir( elem, "parentNode", until ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5242 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5243 |
next: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5244 |
return jQuery.nth( elem, 2, "nextSibling" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5245 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5246 |
prev: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5247 |
return jQuery.nth( elem, 2, "previousSibling" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5248 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5249 |
nextAll: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5250 |
return jQuery.dir( elem, "nextSibling" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5251 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5252 |
prevAll: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5253 |
return jQuery.dir( elem, "previousSibling" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5254 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5255 |
nextUntil: function( elem, i, until ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5256 |
return jQuery.dir( elem, "nextSibling", until ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5257 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5258 |
prevUntil: function( elem, i, until ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5259 |
return jQuery.dir( elem, "previousSibling", until ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5260 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5261 |
siblings: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5262 |
return jQuery.sibling( elem.parentNode.firstChild, elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5263 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5264 |
children: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5265 |
return jQuery.sibling( elem.firstChild ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5266 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5267 |
contents: function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5268 |
return jQuery.nodeName( elem, "iframe" ) ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5269 |
elem.contentDocument || elem.contentWindow.document : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5270 |
jQuery.makeArray( elem.childNodes ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5271 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5272 |
}, function( name, fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5273 |
jQuery.fn[ name ] = function( until, selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5274 |
var ret = jQuery.map( this, fn, until ), |
| 101 | 5275 |
// The variable 'args' was introduced in |
5276 |
// https://github.com/jquery/jquery/commit/52a0238 |
|
5277 |
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. |
|
5278 |
// http://code.google.com/p/v8/issues/detail?id=1050 |
|
5279 |
args = slice.call(arguments); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5280 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5281 |
if ( !runtil.test( name ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5282 |
selector = until; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5283 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5284 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5285 |
if ( selector && typeof selector === "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5286 |
ret = jQuery.filter( selector, ret ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5287 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5288 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5289 |
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5290 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5291 |
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5292 |
ret = ret.reverse(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5293 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5294 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5295 |
return this.pushStack( ret, name, args.join(",") );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5296 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5297 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5298 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5299 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5300 |
filter: function( expr, elems, not ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5301 |
if ( not ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5302 |
expr = ":not(" + expr + ")";
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5303 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5304 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5305 |
return elems.length === 1 ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5306 |
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5307 |
jQuery.find.matches(expr, elems); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5308 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5309 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5310 |
dir: function( elem, dir, until ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5311 |
var matched = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5312 |
cur = elem[ dir ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5313 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5314 |
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5315 |
if ( cur.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5316 |
matched.push( cur ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5317 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5318 |
cur = cur[dir]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5319 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5320 |
return matched; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5321 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5322 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5323 |
nth: function( cur, result, dir, elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5324 |
result = result || 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5325 |
var num = 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5326 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5327 |
for ( ; cur; cur = cur[dir] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5328 |
if ( cur.nodeType === 1 && ++num === result ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5329 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5330 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5331 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5332 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5333 |
return cur; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5334 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5335 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5336 |
sibling: function( n, elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5337 |
var r = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5338 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5339 |
for ( ; n; n = n.nextSibling ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5340 |
if ( n.nodeType === 1 && n !== elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5341 |
r.push( n ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5342 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5343 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5344 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5345 |
return r; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5346 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5347 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5348 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5349 |
// Implement the identical functionality for filter and not |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5350 |
function winnow( elements, qualifier, keep ) {
|
| 101 | 5351 |
|
5352 |
// Can't pass null or undefined to indexOf in Firefox 4 |
|
5353 |
// Set to 0 to skip string check |
|
5354 |
qualifier = qualifier || 0; |
|
5355 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5356 |
if ( jQuery.isFunction( qualifier ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5357 |
return jQuery.grep(elements, function( elem, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5358 |
var retVal = !!qualifier.call( elem, i, elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5359 |
return retVal === keep; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5360 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5361 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5362 |
} else if ( qualifier.nodeType ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5363 |
return jQuery.grep(elements, function( elem, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5364 |
return (elem === qualifier) === keep; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5365 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5366 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5367 |
} else if ( typeof qualifier === "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5368 |
var filtered = jQuery.grep(elements, function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5369 |
return elem.nodeType === 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5370 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5371 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5372 |
if ( isSimple.test( qualifier ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5373 |
return jQuery.filter(qualifier, filtered, !keep); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5374 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5375 |
qualifier = jQuery.filter( qualifier, filtered ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5376 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5377 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5378 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5379 |
return jQuery.grep(elements, function( elem, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5380 |
return (jQuery.inArray( elem, qualifier ) >= 0) === keep; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5381 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5382 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5383 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5384 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5385 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5386 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5387 |
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5388 |
rleadingWhitespace = /^\s+/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5389 |
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5390 |
rtagName = /<([\w:]+)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5391 |
rtbody = /<tbody/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5392 |
rhtml = /<|&#?\w+;/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5393 |
rnocache = /<(?:script|object|embed|option|style)/i, |
| 101 | 5394 |
// checked="checked" or checked |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5395 |
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, |
| 101 | 5396 |
rscriptType = /\/(java|ecma)script/i, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5397 |
wrapMap = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5398 |
option: [ 1, "<select multiple='multiple'>", "</select>" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5399 |
legend: [ 1, "<fieldset>", "</fieldset>" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5400 |
thead: [ 1, "<table>", "</table>" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5401 |
tr: [ 2, "<table><tbody>", "</tbody></table>" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5402 |
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5403 |
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5404 |
area: [ 1, "<map>", "</map>" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5405 |
_default: [ 0, "", "" ] |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5406 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5407 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5408 |
wrapMap.optgroup = wrapMap.option; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5409 |
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5410 |
wrapMap.th = wrapMap.td; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5411 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5412 |
// IE can't serialize <link> and <script> tags normally |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5413 |
if ( !jQuery.support.htmlSerialize ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5414 |
wrapMap._default = [ 1, "div<div>", "</div>" ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5415 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5416 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5417 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5418 |
text: function( text ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5419 |
if ( jQuery.isFunction(text) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5420 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5421 |
var self = jQuery( this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5422 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5423 |
self.text( text.call(this, i, self.text()) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5424 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5425 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5426 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5427 |
if ( typeof text !== "object" && text !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5428 |
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5429 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5430 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5431 |
return jQuery.text( this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5432 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5433 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5434 |
wrapAll: function( html ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5435 |
if ( jQuery.isFunction( html ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5436 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5437 |
jQuery(this).wrapAll( html.call(this, i) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5438 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5439 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5440 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5441 |
if ( this[0] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5442 |
// The elements to wrap the target around |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5443 |
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5444 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5445 |
if ( this[0].parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5446 |
wrap.insertBefore( this[0] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5447 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5448 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5449 |
wrap.map(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5450 |
var elem = this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5451 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5452 |
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5453 |
elem = elem.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5454 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5455 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5456 |
return elem; |
| 101 | 5457 |
}).append( this ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5458 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5459 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5460 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5461 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5462 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5463 |
wrapInner: function( html ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5464 |
if ( jQuery.isFunction( html ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5465 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5466 |
jQuery(this).wrapInner( html.call(this, i) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5467 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5468 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5469 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5470 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5471 |
var self = jQuery( this ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5472 |
contents = self.contents(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5473 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5474 |
if ( contents.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5475 |
contents.wrapAll( html ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5476 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5477 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5478 |
self.append( html ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5479 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5480 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5481 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5482 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5483 |
wrap: function( html ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5484 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5485 |
jQuery( this ).wrapAll( html ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5486 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5487 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5488 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5489 |
unwrap: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5490 |
return this.parent().each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5491 |
if ( !jQuery.nodeName( this, "body" ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5492 |
jQuery( this ).replaceWith( this.childNodes ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5493 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5494 |
}).end(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5495 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5496 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5497 |
append: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5498 |
return this.domManip(arguments, true, function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5499 |
if ( this.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5500 |
this.appendChild( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5501 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5502 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5503 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5504 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5505 |
prepend: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5506 |
return this.domManip(arguments, true, function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5507 |
if ( this.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5508 |
this.insertBefore( elem, this.firstChild ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5509 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5510 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5511 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5512 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5513 |
before: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5514 |
if ( this[0] && this[0].parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5515 |
return this.domManip(arguments, false, function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5516 |
this.parentNode.insertBefore( elem, this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5517 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5518 |
} else if ( arguments.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5519 |
var set = jQuery(arguments[0]); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5520 |
set.push.apply( set, this.toArray() ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5521 |
return this.pushStack( set, "before", arguments ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5522 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5523 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5524 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5525 |
after: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5526 |
if ( this[0] && this[0].parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5527 |
return this.domManip(arguments, false, function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5528 |
this.parentNode.insertBefore( elem, this.nextSibling ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5529 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5530 |
} else if ( arguments.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5531 |
var set = this.pushStack( this, "after", arguments ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5532 |
set.push.apply( set, jQuery(arguments[0]).toArray() ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5533 |
return set; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5534 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5535 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5536 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5537 |
// keepData is for internal use only--do not document |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5538 |
remove: function( selector, keepData ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5539 |
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5540 |
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5541 |
if ( !keepData && elem.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5542 |
jQuery.cleanData( elem.getElementsByTagName("*") );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5543 |
jQuery.cleanData( [ elem ] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5544 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5545 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5546 |
if ( elem.parentNode ) {
|
| 101 | 5547 |
elem.parentNode.removeChild( elem ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5548 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5549 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5550 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5551 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5552 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5553 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5554 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5555 |
empty: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5556 |
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5557 |
// Remove element nodes and prevent memory leaks |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5558 |
if ( elem.nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5559 |
jQuery.cleanData( elem.getElementsByTagName("*") );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5560 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5561 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5562 |
// Remove any remaining nodes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5563 |
while ( elem.firstChild ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5564 |
elem.removeChild( elem.firstChild ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5565 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5566 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5567 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5568 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5569 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5570 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5571 |
clone: function( dataAndEvents, deepDataAndEvents ) {
|
| 101 | 5572 |
dataAndEvents = dataAndEvents == null ? false : dataAndEvents; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5573 |
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5574 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5575 |
return this.map( function () {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5576 |
return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5577 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5578 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5579 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5580 |
html: function( value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5581 |
if ( value === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5582 |
return this[0] && this[0].nodeType === 1 ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5583 |
this[0].innerHTML.replace(rinlinejQuery, "") : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5584 |
null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5585 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5586 |
// See if we can take a shortcut and just use innerHTML |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5587 |
} else if ( typeof value === "string" && !rnocache.test( value ) && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5588 |
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5589 |
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5590 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5591 |
value = value.replace(rxhtmlTag, "<$1></$2>"); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5592 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5593 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5594 |
for ( var i = 0, l = this.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5595 |
// Remove element nodes and prevent memory leaks |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5596 |
if ( this[i].nodeType === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5597 |
jQuery.cleanData( this[i].getElementsByTagName("*") );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5598 |
this[i].innerHTML = value; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5599 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5600 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5601 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5602 |
// If using innerHTML throws an exception, use the fallback method |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5603 |
} catch(e) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5604 |
this.empty().append( value ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5605 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5606 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5607 |
} else if ( jQuery.isFunction( value ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5608 |
this.each(function(i){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5609 |
var self = jQuery( this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5610 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5611 |
self.html( value.call(this, i, self.html()) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5612 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5613 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5614 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5615 |
this.empty().append( value ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5616 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5617 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5618 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5619 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5620 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5621 |
replaceWith: function( value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5622 |
if ( this[0] && this[0].parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5623 |
// Make sure that the elements are removed from the DOM before they are inserted |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5624 |
// this can help fix replacing a parent with child elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5625 |
if ( jQuery.isFunction( value ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5626 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5627 |
var self = jQuery(this), old = self.html(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5628 |
self.replaceWith( value.call( this, i, old ) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5629 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5630 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5631 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5632 |
if ( typeof value !== "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5633 |
value = jQuery( value ).detach(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5634 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5635 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5636 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5637 |
var next = this.nextSibling, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5638 |
parent = this.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5639 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5640 |
jQuery( this ).remove(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5641 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5642 |
if ( next ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5643 |
jQuery(next).before( value ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5644 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5645 |
jQuery(parent).append( value ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5646 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5647 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5648 |
} else {
|
| 101 | 5649 |
return this.length ? |
5650 |
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : |
|
5651 |
this; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5652 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5653 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5654 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5655 |
detach: function( selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5656 |
return this.remove( selector, true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5657 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5658 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5659 |
domManip: function( args, table, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5660 |
var results, first, fragment, parent, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5661 |
value = args[0], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5662 |
scripts = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5663 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5664 |
// We can't cloneNode fragments that contain checked, in WebKit |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5665 |
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5666 |
return this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5667 |
jQuery(this).domManip( args, table, callback, true ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5668 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5669 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5670 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5671 |
if ( jQuery.isFunction(value) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5672 |
return this.each(function(i) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5673 |
var self = jQuery(this); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5674 |
args[0] = value.call(this, i, table ? self.html() : undefined); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5675 |
self.domManip( args, table, callback ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5676 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5677 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5678 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5679 |
if ( this[0] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5680 |
parent = value && value.parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5681 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5682 |
// If we're in a fragment, just use that instead of building a new one |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5683 |
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5684 |
results = { fragment: parent };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5685 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5686 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5687 |
results = jQuery.buildFragment( args, this, scripts ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5688 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5689 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5690 |
fragment = results.fragment; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5691 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5692 |
if ( fragment.childNodes.length === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5693 |
first = fragment = fragment.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5694 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5695 |
first = fragment.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5696 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5697 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5698 |
if ( first ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5699 |
table = table && jQuery.nodeName( first, "tr" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5700 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5701 |
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5702 |
callback.call( |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5703 |
table ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5704 |
root(this[i], first) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5705 |
this[i], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5706 |
// Make sure that we do not leak memory by inadvertently discarding |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5707 |
// the original fragment (which might have attached data) instead of |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5708 |
// using it; in addition, use the original fragment object for the last |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5709 |
// item instead of first because it can end up being emptied incorrectly |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5710 |
// in certain situations (Bug #8070). |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5711 |
// Fragments from the fragment cache must always be cloned and never used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5712 |
// in place. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5713 |
results.cacheable || (l > 1 && i < lastIndex) ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5714 |
jQuery.clone( fragment, true, true ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5715 |
fragment |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5716 |
); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5717 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5718 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5719 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5720 |
if ( scripts.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5721 |
jQuery.each( scripts, evalScript ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5722 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5723 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5724 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5725 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5726 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5727 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5728 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5729 |
function root( elem, cur ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5730 |
return jQuery.nodeName(elem, "table") ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5731 |
(elem.getElementsByTagName("tbody")[0] ||
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5732 |
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5733 |
elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5734 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5735 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5736 |
function cloneCopyEvent( src, dest ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5737 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5738 |
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5739 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5740 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5741 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5742 |
var internalKey = jQuery.expando, |
| 101 | 5743 |
oldData = jQuery.data( src ), |
5744 |
curData = jQuery.data( dest, oldData ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5745 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5746 |
// Switch to use the internal data object, if it exists, for the next |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5747 |
// stage of data copying |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5748 |
if ( (oldData = oldData[ internalKey ]) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5749 |
var events = oldData.events; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5750 |
curData = curData[ internalKey ] = jQuery.extend({}, oldData);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5751 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5752 |
if ( events ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5753 |
delete curData.handle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5754 |
curData.events = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5755 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5756 |
for ( var type in events ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5757 |
for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
|
| 101 | 5758 |
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5759 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5760 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5761 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5762 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5763 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5764 |
|
| 101 | 5765 |
function cloneFixAttributes( src, dest ) {
|
5766 |
var nodeName; |
|
5767 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5768 |
// We do not need to do anything for non-Elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5769 |
if ( dest.nodeType !== 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5770 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5771 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5772 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5773 |
// clearAttributes removes the attributes, which we don't want, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5774 |
// but also removes the attachEvent events, which we *do* want |
| 101 | 5775 |
if ( dest.clearAttributes ) {
|
5776 |
dest.clearAttributes(); |
|
5777 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5778 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5779 |
// mergeAttributes, in contrast, only merges back on the |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5780 |
// original attributes, not the events |
| 101 | 5781 |
if ( dest.mergeAttributes ) {
|
5782 |
dest.mergeAttributes( src ); |
|
5783 |
} |
|
5784 |
||
5785 |
nodeName = dest.nodeName.toLowerCase(); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5786 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5787 |
// IE6-8 fail to clone children inside object elements that use |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5788 |
// the proprietary classid attribute value (rather than the type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5789 |
// attribute) to identify the type of content to display |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5790 |
if ( nodeName === "object" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5791 |
dest.outerHTML = src.outerHTML; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5792 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5793 |
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5794 |
// IE6-8 fails to persist the checked state of a cloned checkbox |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5795 |
// or radio button. Worse, IE6-7 fail to give the cloned element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5796 |
// a checked appearance if the defaultChecked value isn't also set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5797 |
if ( src.checked ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5798 |
dest.defaultChecked = dest.checked = src.checked; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5799 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5800 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5801 |
// IE6-7 get confused and end up setting the value of a cloned |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5802 |
// checkbox/radio button to an empty string instead of "on" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5803 |
if ( dest.value !== src.value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5804 |
dest.value = src.value; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5805 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5806 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5807 |
// IE6-8 fails to return the selected option to the default selected |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5808 |
// state when cloning options |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5809 |
} else if ( nodeName === "option" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5810 |
dest.selected = src.defaultSelected; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5811 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5812 |
// IE6-8 fails to set the defaultValue to the correct value when |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5813 |
// cloning other types of input fields |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5814 |
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5815 |
dest.defaultValue = src.defaultValue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5816 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5817 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5818 |
// Event data gets referenced instead of copied if the expando |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5819 |
// gets copied too |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5820 |
dest.removeAttribute( jQuery.expando ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5821 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5822 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5823 |
jQuery.buildFragment = function( args, nodes, scripts ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5824 |
var fragment, cacheable, cacheresults, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5825 |
doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5826 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5827 |
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5828 |
// Cloning options loses the selected state, so don't cache them |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5829 |
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5830 |
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5831 |
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5832 |
args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5833 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5834 |
cacheable = true; |
| 101 | 5835 |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5836 |
cacheresults = jQuery.fragments[ args[0] ]; |
| 101 | 5837 |
if ( cacheresults && cacheresults !== 1 ) {
|
5838 |
fragment = cacheresults; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5839 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5840 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5841 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5842 |
if ( !fragment ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5843 |
fragment = doc.createDocumentFragment(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5844 |
jQuery.clean( args, doc, fragment, scripts ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5845 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5846 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5847 |
if ( cacheable ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5848 |
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5849 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5850 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5851 |
return { fragment: fragment, cacheable: cacheable };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5852 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5853 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5854 |
jQuery.fragments = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5855 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5856 |
jQuery.each({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5857 |
appendTo: "append", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5858 |
prependTo: "prepend", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5859 |
insertBefore: "before", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5860 |
insertAfter: "after", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5861 |
replaceAll: "replaceWith" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5862 |
}, function( name, original ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5863 |
jQuery.fn[ name ] = function( selector ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5864 |
var ret = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5865 |
insert = jQuery( selector ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5866 |
parent = this.length === 1 && this[0].parentNode; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5867 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5868 |
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5869 |
insert[ original ]( this[0] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5870 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5871 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5872 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5873 |
for ( var i = 0, l = insert.length; i < l; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5874 |
var elems = (i > 0 ? this.clone(true) : this).get(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5875 |
jQuery( insert[i] )[ original ]( elems ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5876 |
ret = ret.concat( elems ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5877 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5878 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5879 |
return this.pushStack( ret, name, insert.selector ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5880 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5881 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5882 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5883 |
|
| 101 | 5884 |
function getAll( elem ) {
|
5885 |
if ( "getElementsByTagName" in elem ) {
|
|
5886 |
return elem.getElementsByTagName( "*" ); |
|
5887 |
||
5888 |
} else if ( "querySelectorAll" in elem ) {
|
|
5889 |
return elem.querySelectorAll( "*" ); |
|
5890 |
||
5891 |
} else {
|
|
5892 |
return []; |
|
5893 |
} |
|
5894 |
} |
|
5895 |
||
5896 |
// Used in clean, fixes the defaultChecked property |
|
5897 |
function fixDefaultChecked( elem ) {
|
|
5898 |
if ( elem.type === "checkbox" || elem.type === "radio" ) {
|
|
5899 |
elem.defaultChecked = elem.checked; |
|
5900 |
} |
|
5901 |
} |
|
5902 |
// Finds all inputs and passes them to fixDefaultChecked |
|
5903 |
function findInputs( elem ) {
|
|
5904 |
if ( jQuery.nodeName( elem, "input" ) ) {
|
|
5905 |
fixDefaultChecked( elem ); |
|
5906 |
} else if ( elem.getElementsByTagName ) {
|
|
5907 |
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
|
|
5908 |
} |
|
5909 |
} |
|
5910 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5911 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5912 |
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5913 |
var clone = elem.cloneNode(true), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5914 |
srcElements, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5915 |
destElements, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5916 |
i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5917 |
|
| 101 | 5918 |
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && |
5919 |
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5920 |
// IE copies events bound via attachEvent when using cloneNode. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5921 |
// Calling detachEvent on the clone will also remove the events |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5922 |
// from the original. In order to get around this, we use some |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5923 |
// proprietary methods to clear the events. Thanks to MooTools |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5924 |
// guys for this hotness. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5925 |
|
| 101 | 5926 |
cloneFixAttributes( elem, clone ); |
5927 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5928 |
// Using Sizzle here is crazy slow, so we use getElementsByTagName |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5929 |
// instead |
| 101 | 5930 |
srcElements = getAll( elem ); |
5931 |
destElements = getAll( clone ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5932 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5933 |
// Weird iteration because IE will replace the length property |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5934 |
// with an element if you are cloning the body and one of the |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5935 |
// elements on the page has a name or id of "length" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5936 |
for ( i = 0; srcElements[i]; ++i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5937 |
cloneFixAttributes( srcElements[i], destElements[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5938 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5939 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5940 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5941 |
// Copy the events from the original to the clone |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5942 |
if ( dataAndEvents ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5943 |
cloneCopyEvent( elem, clone ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5944 |
|
| 101 | 5945 |
if ( deepDataAndEvents ) {
|
5946 |
srcElements = getAll( elem ); |
|
5947 |
destElements = getAll( clone ); |
|
5948 |
||
5949 |
for ( i = 0; srcElements[i]; ++i ) {
|
|
5950 |
cloneCopyEvent( srcElements[i], destElements[i] ); |
|
5951 |
} |
|
5952 |
} |
|
5953 |
} |
|
5954 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5955 |
// Return the cloned set |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5956 |
return clone; |
| 101 | 5957 |
}, |
5958 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5959 |
clean: function( elems, context, fragment, scripts ) {
|
| 101 | 5960 |
var checkScriptType; |
5961 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5962 |
context = context || document; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5963 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5964 |
// !context.createElement fails in IE with an error but returns typeof 'object' |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5965 |
if ( typeof context.createElement === "undefined" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5966 |
context = context.ownerDocument || context[0] && context[0].ownerDocument || document; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5967 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5968 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5969 |
var ret = []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5970 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5971 |
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5972 |
if ( typeof elem === "number" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5973 |
elem += ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5974 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5975 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5976 |
if ( !elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5977 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5978 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5979 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5980 |
// Convert html string into DOM nodes |
| 101 | 5981 |
if ( typeof elem === "string" ) {
|
5982 |
if ( !rhtml.test( elem ) ) {
|
|
5983 |
elem = context.createTextNode( elem ); |
|
5984 |
} else {
|
|
5985 |
// Fix "XHTML"-style tags in all browsers |
|
5986 |
elem = elem.replace(rxhtmlTag, "<$1></$2>"); |
|
5987 |
||
5988 |
// Trim whitespace, otherwise indexOf won't work as expected |
|
5989 |
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), |
|
5990 |
wrap = wrapMap[ tag ] || wrapMap._default, |
|
5991 |
depth = wrap[0], |
|
5992 |
div = context.createElement("div");
|
|
5993 |
||
5994 |
// Go to html and back, then peel off extra wrappers |
|
5995 |
div.innerHTML = wrap[1] + elem + wrap[2]; |
|
5996 |
||
5997 |
// Move to the right depth |
|
5998 |
while ( depth-- ) {
|
|
5999 |
div = div.lastChild; |
|
6000 |
} |
|
6001 |
||
6002 |
// Remove IE's autoinserted <tbody> from table fragments |
|
6003 |
if ( !jQuery.support.tbody ) {
|
|
6004 |
||
6005 |
// String was a <table>, *may* have spurious <tbody> |
|
6006 |
var hasBody = rtbody.test(elem), |
|
6007 |
tbody = tag === "table" && !hasBody ? |
|
6008 |
div.firstChild && div.firstChild.childNodes : |
|
6009 |
||
6010 |
// String was a bare <thead> or <tfoot> |
|
6011 |
wrap[1] === "<table>" && !hasBody ? |
|
6012 |
div.childNodes : |
|
6013 |
[]; |
|
6014 |
||
6015 |
for ( var j = tbody.length - 1; j >= 0 ; --j ) {
|
|
6016 |
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
|
|
6017 |
tbody[ j ].parentNode.removeChild( tbody[ j ] ); |
|
6018 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6019 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6020 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6021 |
|
| 101 | 6022 |
// IE completely kills leading whitespace when innerHTML is used |
6023 |
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
|
|
6024 |
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); |
|
6025 |
} |
|
6026 |
||
6027 |
elem = div.childNodes; |
|
6028 |
} |
|
6029 |
} |
|
6030 |
||
6031 |
// Resets defaultChecked for any radios and checkboxes |
|
6032 |
// about to be appended to the DOM in IE 6/7 (#8060) |
|
6033 |
var len; |
|
6034 |
if ( !jQuery.support.appendChecked ) {
|
|
6035 |
if ( elem[0] && typeof (len = elem.length) === "number" ) {
|
|
6036 |
for ( i = 0; i < len; i++ ) {
|
|
6037 |
findInputs( elem[i] ); |
|
6038 |
} |
|
6039 |
} else {
|
|
6040 |
findInputs( elem ); |
|
6041 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6042 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6043 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6044 |
if ( elem.nodeType ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6045 |
ret.push( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6046 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6047 |
ret = jQuery.merge( ret, elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6048 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6049 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6050 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6051 |
if ( fragment ) {
|
| 101 | 6052 |
checkScriptType = function( elem ) {
|
6053 |
return !elem.type || rscriptType.test( elem.type ); |
|
6054 |
}; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6055 |
for ( i = 0; ret[i]; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6056 |
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6057 |
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6058 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6059 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6060 |
if ( ret[i].nodeType === 1 ) {
|
| 101 | 6061 |
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType ); |
6062 |
||
6063 |
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6064 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6065 |
fragment.appendChild( ret[i] ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6066 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6067 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6068 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6069 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6070 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6071 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6072 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6073 |
cleanData: function( elems ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6074 |
var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6075 |
deleteExpando = jQuery.support.deleteExpando; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6076 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6077 |
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6078 |
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6079 |
continue; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6080 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6081 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6082 |
id = elem[ jQuery.expando ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6083 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6084 |
if ( id ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6085 |
data = cache[ id ] && cache[ id ][ internalKey ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6086 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6087 |
if ( data && data.events ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6088 |
for ( var type in data.events ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6089 |
if ( special[ type ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6090 |
jQuery.event.remove( elem, type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6091 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6092 |
// This is a shortcut to avoid jQuery.event.remove's overhead |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6093 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6094 |
jQuery.removeEvent( elem, type, data.handle ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6095 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6096 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6097 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6098 |
// Null the DOM reference to avoid IE6/7/8 leak (#7054) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6099 |
if ( data.handle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6100 |
data.handle.elem = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6101 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6102 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6103 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6104 |
if ( deleteExpando ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6105 |
delete elem[ jQuery.expando ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6106 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6107 |
} else if ( elem.removeAttribute ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6108 |
elem.removeAttribute( jQuery.expando ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6109 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6110 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6111 |
delete cache[ id ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6112 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6113 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6114 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6115 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6116 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6117 |
function evalScript( i, elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6118 |
if ( elem.src ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6119 |
jQuery.ajax({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6120 |
url: elem.src, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6121 |
async: false, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6122 |
dataType: "script" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6123 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6124 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6125 |
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6126 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6127 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6128 |
if ( elem.parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6129 |
elem.parentNode.removeChild( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6130 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6131 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6132 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6133 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6134 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6135 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6136 |
var ralpha = /alpha\([^)]*\)/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6137 |
ropacity = /opacity=([^)]*)/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6138 |
rdashAlpha = /-([a-z])/ig, |
| 101 | 6139 |
// fixed for IE9, see #8346 |
6140 |
rupper = /([A-Z]|^ms)/g, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6141 |
rnumpx = /^-?\d+(?:px)?$/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6142 |
rnum = /^-?\d/, |
| 101 | 6143 |
rrelNum = /^[+\-]=/, |
6144 |
rrelNumFilter = /[^+\-\.\de]+/g, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6145 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6146 |
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6147 |
cssWidth = [ "Left", "Right" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6148 |
cssHeight = [ "Top", "Bottom" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6149 |
curCSS, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6150 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6151 |
getComputedStyle, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6152 |
currentStyle, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6153 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6154 |
fcamelCase = function( all, letter ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6155 |
return letter.toUpperCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6156 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6157 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6158 |
jQuery.fn.css = function( name, value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6159 |
// Setting 'undefined' is a no-op |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6160 |
if ( arguments.length === 2 && value === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6161 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6162 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6163 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6164 |
return jQuery.access( this, name, value, true, function( elem, name, value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6165 |
return value !== undefined ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6166 |
jQuery.style( elem, name, value ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6167 |
jQuery.css( elem, name ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6168 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6169 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6170 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6171 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6172 |
// Add in style property hooks for overriding the default |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6173 |
// behavior of getting and setting a style property |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6174 |
cssHooks: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6175 |
opacity: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6176 |
get: function( elem, computed ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6177 |
if ( computed ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6178 |
// We should always get a number back from opacity |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6179 |
var ret = curCSS( elem, "opacity", "opacity" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6180 |
return ret === "" ? "1" : ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6181 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6182 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6183 |
return elem.style.opacity; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6184 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6185 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6186 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6187 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6188 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6189 |
// Exclude the following css properties to add px |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6190 |
cssNumber: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6191 |
"zIndex": true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6192 |
"fontWeight": true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6193 |
"opacity": true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6194 |
"zoom": true, |
| 101 | 6195 |
"lineHeight": true, |
6196 |
"widows": true, |
|
6197 |
"orphans": true |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6198 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6199 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6200 |
// Add in properties whose names you wish to fix before |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6201 |
// setting or getting the value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6202 |
cssProps: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6203 |
// normalize float css property |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6204 |
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6205 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6206 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6207 |
// Get and set the style property on a DOM Node |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6208 |
style: function( elem, name, value, extra ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6209 |
// Don't set styles on text and comment nodes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6210 |
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6211 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6212 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6213 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6214 |
// Make sure that we're working with the right name |
| 101 | 6215 |
var ret, type, origName = jQuery.camelCase( name ), |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6216 |
style = elem.style, hooks = jQuery.cssHooks[ origName ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6217 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6218 |
name = jQuery.cssProps[ origName ] || origName; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6219 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6220 |
// Check if we're setting a value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6221 |
if ( value !== undefined ) {
|
| 101 | 6222 |
type = typeof value; |
6223 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6224 |
// Make sure that NaN and null values aren't set. See: #7116 |
| 101 | 6225 |
if ( type === "number" && isNaN( value ) || value == null ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6226 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6227 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6228 |
|
| 101 | 6229 |
// convert relative number strings (+= or -=) to relative numbers. #7345 |
6230 |
if ( type === "string" && rrelNum.test( value ) ) {
|
|
6231 |
value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) ); |
|
6232 |
} |
|
6233 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6234 |
// If a number was passed in, add 'px' to the (except for certain CSS properties) |
| 101 | 6235 |
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6236 |
value += "px"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6237 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6238 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6239 |
// If a hook was provided, use that value, otherwise just set the specified value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6240 |
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6241 |
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6242 |
// Fixes bug #5509 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6243 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6244 |
style[ name ] = value; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6245 |
} catch(e) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6246 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6247 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6248 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6249 |
// If a hook was provided get the non-computed value from there |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6250 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6251 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6252 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6253 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6254 |
// Otherwise just get the value from the style object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6255 |
return style[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6256 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6257 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6258 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6259 |
css: function( elem, name, extra ) {
|
| 101 | 6260 |
var ret, hooks; |
6261 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6262 |
// Make sure that we're working with the right name |
| 101 | 6263 |
name = jQuery.camelCase( name ); |
6264 |
hooks = jQuery.cssHooks[ name ]; |
|
6265 |
name = jQuery.cssProps[ name ] || name; |
|
6266 |
||
6267 |
// cssFloat needs a special treatment |
|
6268 |
if ( name === "cssFloat" ) {
|
|
6269 |
name = "float"; |
|
6270 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6271 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6272 |
// If a hook was provided get the computed value from there |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6273 |
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6274 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6275 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6276 |
// Otherwise, if a way to get the computed value exists, use that |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6277 |
} else if ( curCSS ) {
|
| 101 | 6278 |
return curCSS( elem, name ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6279 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6280 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6281 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6282 |
// A method for quickly swapping in/out CSS properties to get correct calculations |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6283 |
swap: function( elem, options, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6284 |
var old = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6285 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6286 |
// Remember the old values, and insert the new ones |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6287 |
for ( var name in options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6288 |
old[ name ] = elem.style[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6289 |
elem.style[ name ] = options[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6290 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6291 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6292 |
callback.call( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6293 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6294 |
// Revert the old values |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6295 |
for ( name in options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6296 |
elem.style[ name ] = old[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6297 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6298 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6299 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6300 |
camelCase: function( string ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6301 |
return string.replace( rdashAlpha, fcamelCase ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6302 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6303 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6304 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6305 |
// DEPRECATED, Use jQuery.css() instead |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6306 |
jQuery.curCSS = jQuery.css; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6307 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6308 |
jQuery.each(["height", "width"], function( i, name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6309 |
jQuery.cssHooks[ name ] = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6310 |
get: function( elem, computed, extra ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6311 |
var val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6312 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6313 |
if ( computed ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6314 |
if ( elem.offsetWidth !== 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6315 |
val = getWH( elem, name, extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6316 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6317 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6318 |
jQuery.swap( elem, cssShow, function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6319 |
val = getWH( elem, name, extra ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6320 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6321 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6322 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6323 |
if ( val <= 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6324 |
val = curCSS( elem, name, name ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6325 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6326 |
if ( val === "0px" && currentStyle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6327 |
val = currentStyle( elem, name, name ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6328 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6329 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6330 |
if ( val != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6331 |
// Should return "auto" instead of 0, use 0 for |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6332 |
// temporary backwards-compat |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6333 |
return val === "" || val === "auto" ? "0px" : val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6334 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6335 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6336 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6337 |
if ( val < 0 || val == null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6338 |
val = elem.style[ name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6339 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6340 |
// Should return "auto" instead of 0, use 0 for |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6341 |
// temporary backwards-compat |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6342 |
return val === "" || val === "auto" ? "0px" : val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6343 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6344 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6345 |
return typeof val === "string" ? val : val + "px"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6346 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6347 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6348 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6349 |
set: function( elem, value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6350 |
if ( rnumpx.test( value ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6351 |
// ignore negative width and height values #1599 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6352 |
value = parseFloat(value); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6353 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6354 |
if ( value >= 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6355 |
return value + "px"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6356 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6357 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6358 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6359 |
return value; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6360 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6361 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6362 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6363 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6364 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6365 |
if ( !jQuery.support.opacity ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6366 |
jQuery.cssHooks.opacity = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6367 |
get: function( elem, computed ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6368 |
// IE uses filters for opacity |
| 101 | 6369 |
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? |
6370 |
( parseFloat( RegExp.$1 ) / 100 ) + "" : |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6371 |
computed ? "1" : ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6372 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6373 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6374 |
set: function( elem, value ) {
|
| 101 | 6375 |
var style = elem.style, |
6376 |
currentStyle = elem.currentStyle; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6377 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6378 |
// IE has trouble with opacity if it does not have layout |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6379 |
// Force it by setting the zoom level |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6380 |
style.zoom = 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6381 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6382 |
// Set the alpha filter to set the opacity |
| 101 | 6383 |
var opacity = jQuery.isNaN( value ) ? |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6384 |
"" : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6385 |
"alpha(opacity=" + value * 100 + ")", |
| 101 | 6386 |
filter = currentStyle && currentStyle.filter || style.filter || ""; |
6387 |
||
6388 |
style.filter = ralpha.test( filter ) ? |
|
6389 |
filter.replace( ralpha, opacity ) : |
|
6390 |
filter + " " + opacity; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6391 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6392 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6393 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6394 |
|
| 101 | 6395 |
jQuery(function() {
|
6396 |
// This hook cannot be added until DOM ready because the support test |
|
6397 |
// for it is not run until after DOM ready |
|
6398 |
if ( !jQuery.support.reliableMarginRight ) {
|
|
6399 |
jQuery.cssHooks.marginRight = {
|
|
6400 |
get: function( elem, computed ) {
|
|
6401 |
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
|
6402 |
// Work around by temporarily setting element display to inline-block |
|
6403 |
var ret; |
|
6404 |
jQuery.swap( elem, { "display": "inline-block" }, function() {
|
|
6405 |
if ( computed ) {
|
|
6406 |
ret = curCSS( elem, "margin-right", "marginRight" ); |
|
6407 |
} else {
|
|
6408 |
ret = elem.style.marginRight; |
|
6409 |
} |
|
6410 |
}); |
|
6411 |
return ret; |
|
6412 |
} |
|
6413 |
}; |
|
6414 |
} |
|
6415 |
}); |
|
6416 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6417 |
if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
| 101 | 6418 |
getComputedStyle = function( elem, name ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6419 |
var ret, defaultView, computedStyle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6420 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6421 |
name = name.replace( rupper, "-$1" ).toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6422 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6423 |
if ( !(defaultView = elem.ownerDocument.defaultView) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6424 |
return undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6425 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6426 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6427 |
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6428 |
ret = computedStyle.getPropertyValue( name ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6429 |
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6430 |
ret = jQuery.style( elem, name ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6431 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6432 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6433 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6434 |
return ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6435 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6436 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6437 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6438 |
if ( document.documentElement.currentStyle ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6439 |
currentStyle = function( elem, name ) {
|
| 101 | 6440 |
var left, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6441 |
ret = elem.currentStyle && elem.currentStyle[ name ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6442 |
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6443 |
style = elem.style; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6444 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6445 |
// From the awesome hack by Dean Edwards |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6446 |
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6447 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6448 |
// If we're not dealing with a regular pixel number |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6449 |
// but a number that has a weird ending, we need to convert it to pixels |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6450 |
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6451 |
// Remember the original values |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6452 |
left = style.left; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6453 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6454 |
// Put in the new values to get a computed value out |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6455 |
if ( rsLeft ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6456 |
elem.runtimeStyle.left = elem.currentStyle.left; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6457 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6458 |
style.left = name === "fontSize" ? "1em" : (ret || 0); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6459 |
ret = style.pixelLeft + "px"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6460 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6461 |
// Revert the changed values |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6462 |
style.left = left; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6463 |
if ( rsLeft ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6464 |
elem.runtimeStyle.left = rsLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6465 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6466 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6467 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6468 |
return ret === "" ? "auto" : ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6469 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6470 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6471 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6472 |
curCSS = getComputedStyle || currentStyle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6473 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6474 |
function getWH( elem, name, extra ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6475 |
var which = name === "width" ? cssWidth : cssHeight, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6476 |
val = name === "width" ? elem.offsetWidth : elem.offsetHeight; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6477 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6478 |
if ( extra === "border" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6479 |
return val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6480 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6481 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6482 |
jQuery.each( which, function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6483 |
if ( !extra ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6484 |
val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6485 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6486 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6487 |
if ( extra === "margin" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6488 |
val += parseFloat(jQuery.css( elem, "margin" + this )) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6489 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6490 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6491 |
val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6492 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6493 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6494 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6495 |
return val; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6496 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6497 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6498 |
if ( jQuery.expr && jQuery.expr.filters ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6499 |
jQuery.expr.filters.hidden = function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6500 |
var width = elem.offsetWidth, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6501 |
height = elem.offsetHeight; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6502 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6503 |
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none"); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6504 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6505 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6506 |
jQuery.expr.filters.visible = function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6507 |
return !jQuery.expr.filters.hidden( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6508 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6509 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6510 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6511 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6512 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6513 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6514 |
var r20 = /%20/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6515 |
rbracket = /\[\]$/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6516 |
rCRLF = /\r?\n/g, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6517 |
rhash = /#.*$/, |
| 101 | 6518 |
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6519 |
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, |
| 101 | 6520 |
// #7653, #8125, #8152: local protocol detection |
6521 |
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6522 |
rnoContent = /^(?:GET|HEAD)$/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6523 |
rprotocol = /^\/\//, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6524 |
rquery = /\?/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6525 |
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6526 |
rselectTextarea = /^(?:select|textarea)/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6527 |
rspacesAjax = /\s+/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6528 |
rts = /([?&])_=[^&]*/, |
| 101 | 6529 |
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6530 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6531 |
// Keep a copy of the old load method |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6532 |
_load = jQuery.fn.load, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6533 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6534 |
/* Prefilters |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6535 |
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6536 |
* 2) These are called: |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6537 |
* - BEFORE asking for a transport |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6538 |
* - AFTER param serialization (s.data is a string if s.processData is true) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6539 |
* 3) key is the dataType |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6540 |
* 4) the catchall symbol "*" can be used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6541 |
* 5) execution will start with transport dataType and THEN continue down to "*" if needed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6542 |
*/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6543 |
prefilters = {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6544 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6545 |
/* Transports bindings |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6546 |
* 1) key is the dataType |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6547 |
* 2) the catchall symbol "*" can be used |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6548 |
* 3) selection will start with transport dataType and THEN go to "*" if needed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6549 |
*/ |
| 101 | 6550 |
transports = {},
|
6551 |
||
6552 |
// Document location |
|
6553 |
ajaxLocation, |
|
6554 |
||
6555 |
// Document location segments |
|
6556 |
ajaxLocParts; |
|
6557 |
||
6558 |
// #8138, IE may throw an exception when accessing |
|
6559 |
// a field from window.location if document.domain has been set |
|
6560 |
try {
|
|
6561 |
ajaxLocation = location.href; |
|
6562 |
} catch( e ) {
|
|
6563 |
// Use the href attribute of an A element |
|
6564 |
// since IE will modify it given document.location |
|
6565 |
ajaxLocation = document.createElement( "a" ); |
|
6566 |
ajaxLocation.href = ""; |
|
6567 |
ajaxLocation = ajaxLocation.href; |
|
6568 |
} |
|
6569 |
||
6570 |
// Segment location into parts |
|
6571 |
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6572 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6573 |
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6574 |
function addToPrefiltersOrTransports( structure ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6575 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6576 |
// dataTypeExpression is optional and defaults to "*" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6577 |
return function( dataTypeExpression, func ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6578 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6579 |
if ( typeof dataTypeExpression !== "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6580 |
func = dataTypeExpression; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6581 |
dataTypeExpression = "*"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6582 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6583 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6584 |
if ( jQuery.isFunction( func ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6585 |
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6586 |
i = 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6587 |
length = dataTypes.length, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6588 |
dataType, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6589 |
list, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6590 |
placeBefore; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6591 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6592 |
// For each dataType in the dataTypeExpression |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6593 |
for(; i < length; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6594 |
dataType = dataTypes[ i ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6595 |
// We control if we're asked to add before |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6596 |
// any existing element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6597 |
placeBefore = /^\+/.test( dataType ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6598 |
if ( placeBefore ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6599 |
dataType = dataType.substr( 1 ) || "*"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6600 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6601 |
list = structure[ dataType ] = structure[ dataType ] || []; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6602 |
// then we add to the structure accordingly |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6603 |
list[ placeBefore ? "unshift" : "push" ]( func ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6604 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6605 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6606 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6607 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6608 |
|
| 101 | 6609 |
// Base inspection function for prefilters and transports |
6610 |
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6611 |
dataType /* internal */, inspected /* internal */ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6612 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6613 |
dataType = dataType || options.dataTypes[ 0 ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6614 |
inspected = inspected || {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6615 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6616 |
inspected[ dataType ] = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6617 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6618 |
var list = structure[ dataType ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6619 |
i = 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6620 |
length = list ? list.length : 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6621 |
executeOnly = ( structure === prefilters ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6622 |
selection; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6623 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6624 |
for(; i < length && ( executeOnly || !selection ); i++ ) {
|
| 101 | 6625 |
selection = list[ i ]( options, originalOptions, jqXHR ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6626 |
// If we got redirected to another dataType |
| 101 | 6627 |
// we try there if executing only and not done already |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6628 |
if ( typeof selection === "string" ) {
|
| 101 | 6629 |
if ( !executeOnly || inspected[ selection ] ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6630 |
selection = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6631 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6632 |
options.dataTypes.unshift( selection ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6633 |
selection = inspectPrefiltersOrTransports( |
| 101 | 6634 |
structure, options, originalOptions, jqXHR, selection, inspected ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6635 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6636 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6637 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6638 |
// If we're only executing or nothing was selected |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6639 |
// we try the catchall dataType if not done already |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6640 |
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6641 |
selection = inspectPrefiltersOrTransports( |
| 101 | 6642 |
structure, options, originalOptions, jqXHR, "*", inspected ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6643 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6644 |
// unnecessary when only executing (prefilters) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6645 |
// but it'll be ignored by the caller in that case |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6646 |
return selection; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6647 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6648 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6649 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6650 |
load: function( url, params, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6651 |
if ( typeof url !== "string" && _load ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6652 |
return _load.apply( this, arguments ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6653 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6654 |
// Don't do a request if no elements are being requested |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6655 |
} else if ( !this.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6656 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6657 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6658 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6659 |
var off = url.indexOf( " " ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6660 |
if ( off >= 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6661 |
var selector = url.slice( off, url.length ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6662 |
url = url.slice( 0, off ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6663 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6664 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6665 |
// Default to a GET request |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6666 |
var type = "GET"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6667 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6668 |
// If the second parameter was provided |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6669 |
if ( params ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6670 |
// If it's a function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6671 |
if ( jQuery.isFunction( params ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6672 |
// We assume that it's the callback |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6673 |
callback = params; |
| 101 | 6674 |
params = undefined; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6675 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6676 |
// Otherwise, build a param string |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6677 |
} else if ( typeof params === "object" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6678 |
params = jQuery.param( params, jQuery.ajaxSettings.traditional ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6679 |
type = "POST"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6680 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6681 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6682 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6683 |
var self = this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6684 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6685 |
// Request the remote document |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6686 |
jQuery.ajax({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6687 |
url: url, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6688 |
type: type, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6689 |
dataType: "html", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6690 |
data: params, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6691 |
// Complete callback (responseText is used internally) |
| 101 | 6692 |
complete: function( jqXHR, status, responseText ) {
|
6693 |
// Store the response as specified by the jqXHR object |
|
6694 |
responseText = jqXHR.responseText; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6695 |
// If successful, inject the HTML into all the matched elements |
| 101 | 6696 |
if ( jqXHR.isResolved() ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6697 |
// #4825: Get the actual response in case |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6698 |
// a dataFilter is present in ajaxSettings |
| 101 | 6699 |
jqXHR.done(function( r ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6700 |
responseText = r; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6701 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6702 |
// See if a selector was specified |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6703 |
self.html( selector ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6704 |
// Create a dummy div to hold the results |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6705 |
jQuery("<div>")
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6706 |
// inject the contents of the document in, removing the scripts |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6707 |
// to avoid any 'Permission Denied' errors in IE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6708 |
.append(responseText.replace(rscript, "")) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6709 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6710 |
// Locate the specified elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6711 |
.find(selector) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6712 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6713 |
// If not, just inject the full result |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6714 |
responseText ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6715 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6716 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6717 |
if ( callback ) {
|
| 101 | 6718 |
self.each( callback, [ responseText, status, jqXHR ] ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6719 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6720 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6721 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6722 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6723 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6724 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6725 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6726 |
serialize: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6727 |
return jQuery.param( this.serializeArray() ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6728 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6729 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6730 |
serializeArray: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6731 |
return this.map(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6732 |
return this.elements ? jQuery.makeArray( this.elements ) : this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6733 |
}) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6734 |
.filter(function(){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6735 |
return this.name && !this.disabled && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6736 |
( this.checked || rselectTextarea.test( this.nodeName ) || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6737 |
rinput.test( this.type ) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6738 |
}) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6739 |
.map(function( i, elem ){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6740 |
var val = jQuery( this ).val(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6741 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6742 |
return val == null ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6743 |
null : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6744 |
jQuery.isArray( val ) ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6745 |
jQuery.map( val, function( val, i ){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6746 |
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6747 |
}) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6748 |
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6749 |
}).get(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6750 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6751 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6752 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6753 |
// Attach a bunch of functions for handling common AJAX events |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6754 |
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6755 |
jQuery.fn[ o ] = function( f ){
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6756 |
return this.bind( o, f ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6757 |
}; |
| 101 | 6758 |
}); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6759 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6760 |
jQuery.each( [ "get", "post" ], function( i, method ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6761 |
jQuery[ method ] = function( url, data, callback, type ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6762 |
// shift arguments if data argument was omitted |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6763 |
if ( jQuery.isFunction( data ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6764 |
type = type || callback; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6765 |
callback = data; |
| 101 | 6766 |
data = undefined; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6767 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6768 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6769 |
return jQuery.ajax({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6770 |
type: method, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6771 |
url: url, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6772 |
data: data, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6773 |
success: callback, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6774 |
dataType: type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6775 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6776 |
}; |
| 101 | 6777 |
}); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6778 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6779 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6780 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6781 |
getScript: function( url, callback ) {
|
| 101 | 6782 |
return jQuery.get( url, undefined, callback, "script" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6783 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6784 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6785 |
getJSON: function( url, data, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6786 |
return jQuery.get( url, data, callback, "json" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6787 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6788 |
|
| 101 | 6789 |
// Creates a full fledged settings object into target |
6790 |
// with both ajaxSettings and settings fields. |
|
6791 |
// If target is omitted, writes into ajaxSettings. |
|
6792 |
ajaxSetup: function ( target, settings ) {
|
|
6793 |
if ( !settings ) {
|
|
6794 |
// Only one parameter, we extend ajaxSettings |
|
6795 |
settings = target; |
|
6796 |
target = jQuery.extend( true, jQuery.ajaxSettings, settings ); |
|
6797 |
} else {
|
|
6798 |
// target was provided, we extend into it |
|
6799 |
jQuery.extend( true, target, jQuery.ajaxSettings, settings ); |
|
6800 |
} |
|
6801 |
// Flatten fields we don't want deep extended |
|
6802 |
for( var field in { context: 1, url: 1 } ) {
|
|
6803 |
if ( field in settings ) {
|
|
6804 |
target[ field ] = settings[ field ]; |
|
6805 |
} else if( field in jQuery.ajaxSettings ) {
|
|
6806 |
target[ field ] = jQuery.ajaxSettings[ field ]; |
|
6807 |
} |
|
6808 |
} |
|
6809 |
return target; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6810 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6811 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6812 |
ajaxSettings: {
|
| 101 | 6813 |
url: ajaxLocation, |
6814 |
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6815 |
global: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6816 |
type: "GET", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6817 |
contentType: "application/x-www-form-urlencoded", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6818 |
processData: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6819 |
async: true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6820 |
/* |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6821 |
timeout: 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6822 |
data: null, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6823 |
dataType: null, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6824 |
username: null, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6825 |
password: null, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6826 |
cache: null, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6827 |
traditional: false, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6828 |
headers: {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6829 |
*/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6830 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6831 |
accepts: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6832 |
xml: "application/xml, text/xml", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6833 |
html: "text/html", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6834 |
text: "text/plain", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6835 |
json: "application/json, text/javascript", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6836 |
"*": "*/*" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6837 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6838 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6839 |
contents: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6840 |
xml: /xml/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6841 |
html: /html/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6842 |
json: /json/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6843 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6844 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6845 |
responseFields: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6846 |
xml: "responseXML", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6847 |
text: "responseText" |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6848 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6849 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6850 |
// List of data converters |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6851 |
// 1) key format is "source_type destination_type" (a single space in-between) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6852 |
// 2) the catchall symbol "*" can be used for source_type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6853 |
converters: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6854 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6855 |
// Convert anything to text |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6856 |
"* text": window.String, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6857 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6858 |
// Text to html (true = no transformation) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6859 |
"text html": true, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6860 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6861 |
// Evaluate text as a json expression |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6862 |
"text json": jQuery.parseJSON, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6863 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6864 |
// Parse text as xml |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6865 |
"text xml": jQuery.parseXML |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6866 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6867 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6868 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6869 |
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6870 |
ajaxTransport: addToPrefiltersOrTransports( transports ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6871 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6872 |
// Main method |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6873 |
ajax: function( url, options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6874 |
|
| 101 | 6875 |
// If url is an object, simulate pre-1.5 signature |
6876 |
if ( typeof url === "object" ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6877 |
options = url; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6878 |
url = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6879 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6880 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6881 |
// Force options to be an object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6882 |
options = options || {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6883 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6884 |
var // Create the final options object |
| 101 | 6885 |
s = jQuery.ajaxSetup( {}, options ),
|
6886 |
// Callbacks context |
|
6887 |
callbackContext = s.context || s, |
|
6888 |
// Context for global events |
|
6889 |
// It's the callbackContext if one was provided in the options |
|
6890 |
// and if it's a DOM node or a jQuery collection |
|
6891 |
globalEventContext = callbackContext !== s && |
|
6892 |
( callbackContext.nodeType || callbackContext instanceof jQuery ) ? |
|
6893 |
jQuery( callbackContext ) : jQuery.event, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6894 |
// Deferreds |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6895 |
deferred = jQuery.Deferred(), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6896 |
completeDeferred = jQuery._Deferred(), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6897 |
// Status-dependent callbacks |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6898 |
statusCode = s.statusCode || {},
|
| 101 | 6899 |
// ifModified key |
6900 |
ifModifiedKey, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6901 |
// Headers (they are sent all at once) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6902 |
requestHeaders = {},
|
| 101 | 6903 |
requestHeadersNames = {},
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6904 |
// Response headers |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6905 |
responseHeadersString, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6906 |
responseHeaders, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6907 |
// transport |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6908 |
transport, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6909 |
// timeout handle |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6910 |
timeoutTimer, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6911 |
// Cross-domain detection vars |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6912 |
parts, |
| 101 | 6913 |
// The jqXHR state |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6914 |
state = 0, |
| 101 | 6915 |
// To know if global events are to be dispatched |
6916 |
fireGlobals, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6917 |
// Loop variable |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6918 |
i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6919 |
// Fake xhr |
| 101 | 6920 |
jqXHR = {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6921 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6922 |
readyState: 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6923 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6924 |
// Caches the header |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6925 |
setRequestHeader: function( name, value ) {
|
| 101 | 6926 |
if ( !state ) {
|
6927 |
var lname = name.toLowerCase(); |
|
6928 |
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; |
|
6929 |
requestHeaders[ name ] = value; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6930 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6931 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6932 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6933 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6934 |
// Raw string |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6935 |
getAllResponseHeaders: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6936 |
return state === 2 ? responseHeadersString : null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6937 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6938 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6939 |
// Builds headers hashtable if needed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6940 |
getResponseHeader: function( key ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6941 |
var match; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6942 |
if ( state === 2 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6943 |
if ( !responseHeaders ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6944 |
responseHeaders = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6945 |
while( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6946 |
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6947 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6948 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6949 |
match = responseHeaders[ key.toLowerCase() ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6950 |
} |
| 101 | 6951 |
return match === undefined ? null : match; |
6952 |
}, |
|
6953 |
||
6954 |
// Overrides response content-type header |
|
6955 |
overrideMimeType: function( type ) {
|
|
6956 |
if ( !state ) {
|
|
6957 |
s.mimeType = type; |
|
6958 |
} |
|
6959 |
return this; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6960 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6961 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6962 |
// Cancel the request |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6963 |
abort: function( statusText ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6964 |
statusText = statusText || "abort"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6965 |
if ( transport ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6966 |
transport.abort( statusText ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6967 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6968 |
done( 0, statusText ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6969 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6970 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6971 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6972 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6973 |
// Callback for when everything is done |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6974 |
// It is defined here because jslint complains if it is declared |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6975 |
// at the end of the function (which would be more logical and readable) |
| 101 | 6976 |
function done( status, statusText, responses, headers ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6977 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6978 |
// Called once |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6979 |
if ( state === 2 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6980 |
return; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6981 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6982 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6983 |
// State is "done" now |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6984 |
state = 2; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6985 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6986 |
// Clear timeout if it exists |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6987 |
if ( timeoutTimer ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6988 |
clearTimeout( timeoutTimer ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6989 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6990 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6991 |
// Dereference transport for early garbage collection |
| 101 | 6992 |
// (no matter how long the jqXHR object will be used) |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6993 |
transport = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6994 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6995 |
// Cache response headers |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6996 |
responseHeadersString = headers || ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6997 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6998 |
// Set readyState |
| 101 | 6999 |
jqXHR.readyState = status ? 4 : 0; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7000 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7001 |
var isSuccess, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7002 |
success, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7003 |
error, |
| 101 | 7004 |
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7005 |
lastModified, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7006 |
etag; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7007 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7008 |
// If successful, handle type chaining |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7009 |
if ( status >= 200 && status < 300 || status === 304 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7010 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7011 |
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7012 |
if ( s.ifModified ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7013 |
|
| 101 | 7014 |
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
|
7015 |
jQuery.lastModified[ ifModifiedKey ] = lastModified; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7016 |
} |
| 101 | 7017 |
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
|
7018 |
jQuery.etag[ ifModifiedKey ] = etag; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7019 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7020 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7021 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7022 |
// If not modified |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7023 |
if ( status === 304 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7024 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7025 |
statusText = "notmodified"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7026 |
isSuccess = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7027 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7028 |
// If we have data |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7029 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7030 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7031 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7032 |
success = ajaxConvert( s, response ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7033 |
statusText = "success"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7034 |
isSuccess = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7035 |
} catch(e) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7036 |
// We have a parsererror |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7037 |
statusText = "parsererror"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7038 |
error = e; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7039 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7040 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7041 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7042 |
// We extract error from statusText |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7043 |
// then normalize statusText and status for non-aborts |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7044 |
error = statusText; |
| 101 | 7045 |
if( !statusText || status ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7046 |
statusText = "error"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7047 |
if ( status < 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7048 |
status = 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7049 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7050 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7051 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7052 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7053 |
// Set data for the fake xhr object |
| 101 | 7054 |
jqXHR.status = status; |
7055 |
jqXHR.statusText = statusText; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7056 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7057 |
// Success/Error |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7058 |
if ( isSuccess ) {
|
| 101 | 7059 |
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7060 |
} else {
|
| 101 | 7061 |
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7062 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7063 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7064 |
// Status-dependent callbacks |
| 101 | 7065 |
jqXHR.statusCode( statusCode ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7066 |
statusCode = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7067 |
|
| 101 | 7068 |
if ( fireGlobals ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7069 |
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), |
| 101 | 7070 |
[ jqXHR, s, isSuccess ? success : error ] ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7071 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7072 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7073 |
// Complete |
| 101 | 7074 |
completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] ); |
7075 |
||
7076 |
if ( fireGlobals ) {
|
|
7077 |
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7078 |
// Handle the global AJAX counter |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7079 |
if ( !( --jQuery.active ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7080 |
jQuery.event.trigger( "ajaxStop" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7081 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7082 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7083 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7084 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7085 |
// Attach deferreds |
| 101 | 7086 |
deferred.promise( jqXHR ); |
7087 |
jqXHR.success = jqXHR.done; |
|
7088 |
jqXHR.error = jqXHR.fail; |
|
7089 |
jqXHR.complete = completeDeferred.done; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7090 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7091 |
// Status-dependent callbacks |
| 101 | 7092 |
jqXHR.statusCode = function( map ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7093 |
if ( map ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7094 |
var tmp; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7095 |
if ( state < 2 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7096 |
for( tmp in map ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7097 |
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7098 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7099 |
} else {
|
| 101 | 7100 |
tmp = map[ jqXHR.status ]; |
7101 |
jqXHR.then( tmp, tmp ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7102 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7103 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7104 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7105 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7106 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7107 |
// Remove hash character (#7531: and string promotion) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7108 |
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7109 |
// We also use the url parameter if available |
| 101 | 7110 |
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7111 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7112 |
// Extract dataTypes list |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7113 |
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7114 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7115 |
// Determine if a cross-domain request is in order |
| 101 | 7116 |
if ( s.crossDomain == null ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7117 |
parts = rurl.exec( s.url.toLowerCase() ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7118 |
s.crossDomain = !!( parts && |
| 101 | 7119 |
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7120 |
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != |
| 101 | 7121 |
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7122 |
); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7123 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7124 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7125 |
// Convert data if not already a string |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7126 |
if ( s.data && s.processData && typeof s.data !== "string" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7127 |
s.data = jQuery.param( s.data, s.traditional ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7128 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7129 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7130 |
// Apply prefilters |
| 101 | 7131 |
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); |
7132 |
||
7133 |
// If request was aborted inside a prefiler, stop there |
|
7134 |
if ( state === 2 ) {
|
|
7135 |
return false; |
|
7136 |
} |
|
7137 |
||
7138 |
// We can fire global events as of now if asked to |
|
7139 |
fireGlobals = s.global; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7140 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7141 |
// Uppercase the type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7142 |
s.type = s.type.toUpperCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7143 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7144 |
// Determine if request has content |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7145 |
s.hasContent = !rnoContent.test( s.type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7146 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7147 |
// Watch for a new set of requests |
| 101 | 7148 |
if ( fireGlobals && jQuery.active++ === 0 ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7149 |
jQuery.event.trigger( "ajaxStart" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7150 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7151 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7152 |
// More options handling for requests with no content |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7153 |
if ( !s.hasContent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7154 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7155 |
// If data is available, append data to url |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7156 |
if ( s.data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7157 |
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7158 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7159 |
|
| 101 | 7160 |
// Get ifModifiedKey before adding the anti-cache parameter |
7161 |
ifModifiedKey = s.url; |
|
7162 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7163 |
// Add anti-cache in url if needed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7164 |
if ( s.cache === false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7165 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7166 |
var ts = jQuery.now(), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7167 |
// try replacing _= if it is there |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7168 |
ret = s.url.replace( rts, "$1_=" + ts ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7169 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7170 |
// if nothing was replaced, add timestamp to the end |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7171 |
s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7172 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7173 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7174 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7175 |
// Set the correct header, if data is being sent |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7176 |
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
| 101 | 7177 |
jqXHR.setRequestHeader( "Content-Type", s.contentType ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7178 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7179 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7180 |
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7181 |
if ( s.ifModified ) {
|
| 101 | 7182 |
ifModifiedKey = ifModifiedKey || s.url; |
7183 |
if ( jQuery.lastModified[ ifModifiedKey ] ) {
|
|
7184 |
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); |
|
7185 |
} |
|
7186 |
if ( jQuery.etag[ ifModifiedKey ] ) {
|
|
7187 |
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7188 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7189 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7190 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7191 |
// Set the Accepts header for the server, depending on the dataType |
| 101 | 7192 |
jqXHR.setRequestHeader( |
7193 |
"Accept", |
|
7194 |
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? |
|
7195 |
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) : |
|
7196 |
s.accepts[ "*" ] |
|
7197 |
); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7198 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7199 |
// Check for headers option |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7200 |
for ( i in s.headers ) {
|
| 101 | 7201 |
jqXHR.setRequestHeader( i, s.headers[ i ] ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7202 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7203 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7204 |
// Allow custom headers/mimetypes and early abort |
| 101 | 7205 |
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7206 |
// Abort if not done already |
| 101 | 7207 |
jqXHR.abort(); |
7208 |
return false; |
|
7209 |
||
7210 |
} |
|
7211 |
||
7212 |
// Install callbacks on deferreds |
|
7213 |
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
|
7214 |
jqXHR[ i ]( s[ i ] ); |
|
7215 |
} |
|
7216 |
||
7217 |
// Get transport |
|
7218 |
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); |
|
7219 |
||
7220 |
// If no transport, we auto-abort |
|
7221 |
if ( !transport ) {
|
|
7222 |
done( -1, "No Transport" ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7223 |
} else {
|
| 101 | 7224 |
jqXHR.readyState = 1; |
7225 |
// Send global event |
|
7226 |
if ( fireGlobals ) {
|
|
7227 |
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); |
|
7228 |
} |
|
7229 |
// Timeout |
|
7230 |
if ( s.async && s.timeout > 0 ) {
|
|
7231 |
timeoutTimer = setTimeout( function(){
|
|
7232 |
jqXHR.abort( "timeout" ); |
|
7233 |
}, s.timeout ); |
|
7234 |
} |
|
7235 |
||
7236 |
try {
|
|
7237 |
state = 1; |
|
7238 |
transport.send( requestHeaders, done ); |
|
7239 |
} catch (e) {
|
|
7240 |
// Propagate exception as error if not done |
|
7241 |
if ( status < 2 ) {
|
|
7242 |
done( -1, e ); |
|
7243 |
// Simply rethrow otherwise |
|
7244 |
} else {
|
|
7245 |
jQuery.error( e ); |
|
7246 |
} |
|
7247 |
} |
|
7248 |
} |
|
7249 |
||
7250 |
return jqXHR; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7251 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7252 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7253 |
// Serialize an array of form elements or a set of |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7254 |
// key/values into a query string |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7255 |
param: function( a, traditional ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7256 |
var s = [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7257 |
add = function( key, value ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7258 |
// If value is a function, invoke it and return its value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7259 |
value = jQuery.isFunction( value ) ? value() : value; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7260 |
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7261 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7262 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7263 |
// Set traditional to true for jQuery <= 1.3.2 behavior. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7264 |
if ( traditional === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7265 |
traditional = jQuery.ajaxSettings.traditional; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7266 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7267 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7268 |
// If an array was passed in, assume that it is an array of form elements. |
| 101 | 7269 |
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7270 |
// Serialize the form elements |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7271 |
jQuery.each( a, function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7272 |
add( this.name, this.value ); |
| 101 | 7273 |
}); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7274 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7275 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7276 |
// If traditional, encode the "old" way (the way 1.3.2 or older |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7277 |
// did it), otherwise encode params recursively. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7278 |
for ( var prefix in a ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7279 |
buildParams( prefix, a[ prefix ], traditional, add ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7280 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7281 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7282 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7283 |
// Return the resulting serialization |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7284 |
return s.join( "&" ).replace( r20, "+" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7285 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7286 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7287 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7288 |
function buildParams( prefix, obj, traditional, add ) {
|
| 101 | 7289 |
if ( jQuery.isArray( obj ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7290 |
// Serialize array item. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7291 |
jQuery.each( obj, function( i, v ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7292 |
if ( traditional || rbracket.test( prefix ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7293 |
// Treat each array item as a scalar. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7294 |
add( prefix, v ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7295 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7296 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7297 |
// If array item is non-scalar (array or object), encode its |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7298 |
// numeric index to resolve deserialization ambiguity issues. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7299 |
// Note that rack (as of 1.0.0) can't currently deserialize |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7300 |
// nested arrays properly, and attempting to do so may cause |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7301 |
// a server error. Possible fixes are to modify rack's |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7302 |
// deserialization algorithm or to provide an option or flag |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7303 |
// to force array serialization to be shallow. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7304 |
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7305 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7306 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7307 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7308 |
} else if ( !traditional && obj != null && typeof obj === "object" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7309 |
// Serialize object item. |
| 101 | 7310 |
for ( var name in obj ) {
|
7311 |
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7312 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7313 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7314 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7315 |
// Serialize scalar item. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7316 |
add( prefix, obj ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7317 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7318 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7319 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7320 |
// This is still on the jQuery object... for now |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7321 |
// Want to move this to jQuery.ajax some day |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7322 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7323 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7324 |
// Counter for holding the number of active queries |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7325 |
active: 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7326 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7327 |
// Last-Modified header cache for next request |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7328 |
lastModified: {},
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7329 |
etag: {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7330 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7331 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7332 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7333 |
/* Handles responses to an ajax request: |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7334 |
* - sets all responseXXX fields accordingly |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7335 |
* - finds the right dataType (mediates between content-type and expected dataType) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7336 |
* - returns the corresponding response |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7337 |
*/ |
| 101 | 7338 |
function ajaxHandleResponses( s, jqXHR, responses ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7339 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7340 |
var contents = s.contents, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7341 |
dataTypes = s.dataTypes, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7342 |
responseFields = s.responseFields, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7343 |
ct, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7344 |
type, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7345 |
finalDataType, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7346 |
firstDataType; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7347 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7348 |
// Fill responseXXX fields |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7349 |
for( type in responseFields ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7350 |
if ( type in responses ) {
|
| 101 | 7351 |
jqXHR[ responseFields[type] ] = responses[ type ]; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7352 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7353 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7354 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7355 |
// Remove auto dataType and get content-type in the process |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7356 |
while( dataTypes[ 0 ] === "*" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7357 |
dataTypes.shift(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7358 |
if ( ct === undefined ) {
|
| 101 | 7359 |
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7360 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7361 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7362 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7363 |
// Check if we're dealing with a known content-type |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7364 |
if ( ct ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7365 |
for ( type in contents ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7366 |
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7367 |
dataTypes.unshift( type ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7368 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7369 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7370 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7371 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7372 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7373 |
// Check to see if we have a response for the expected dataType |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7374 |
if ( dataTypes[ 0 ] in responses ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7375 |
finalDataType = dataTypes[ 0 ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7376 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7377 |
// Try convertible dataTypes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7378 |
for ( type in responses ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7379 |
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7380 |
finalDataType = type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7381 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7382 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7383 |
if ( !firstDataType ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7384 |
firstDataType = type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7385 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7386 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7387 |
// Or just use first one |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7388 |
finalDataType = finalDataType || firstDataType; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7389 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7390 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7391 |
// If we found a dataType |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7392 |
// We add the dataType to the list if needed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7393 |
// and return the corresponding response |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7394 |
if ( finalDataType ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7395 |
if ( finalDataType !== dataTypes[ 0 ] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7396 |
dataTypes.unshift( finalDataType ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7397 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7398 |
return responses[ finalDataType ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7399 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7400 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7401 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7402 |
// Chain conversions given the request and the original response |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7403 |
function ajaxConvert( s, response ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7404 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7405 |
// Apply the dataFilter if provided |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7406 |
if ( s.dataFilter ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7407 |
response = s.dataFilter( response, s.dataType ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7408 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7409 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7410 |
var dataTypes = s.dataTypes, |
| 101 | 7411 |
converters = {},
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7412 |
i, |
| 101 | 7413 |
key, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7414 |
length = dataTypes.length, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7415 |
tmp, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7416 |
// Current and previous dataTypes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7417 |
current = dataTypes[ 0 ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7418 |
prev, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7419 |
// Conversion expression |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7420 |
conversion, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7421 |
// Conversion function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7422 |
conv, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7423 |
// Conversion functions (transitive conversion) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7424 |
conv1, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7425 |
conv2; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7426 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7427 |
// For each dataType in the chain |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7428 |
for( i = 1; i < length; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7429 |
|
| 101 | 7430 |
// Create converters map |
7431 |
// with lowercased keys |
|
7432 |
if ( i === 1 ) {
|
|
7433 |
for( key in s.converters ) {
|
|
7434 |
if( typeof key === "string" ) {
|
|
7435 |
converters[ key.toLowerCase() ] = s.converters[ key ]; |
|
7436 |
} |
|
7437 |
} |
|
7438 |
} |
|
7439 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7440 |
// Get the dataTypes |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7441 |
prev = current; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7442 |
current = dataTypes[ i ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7443 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7444 |
// If current is auto dataType, update it to prev |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7445 |
if( current === "*" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7446 |
current = prev; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7447 |
// If no auto and dataTypes are actually different |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7448 |
} else if ( prev !== "*" && prev !== current ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7449 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7450 |
// Get the converter |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7451 |
conversion = prev + " " + current; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7452 |
conv = converters[ conversion ] || converters[ "* " + current ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7453 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7454 |
// If there is no direct converter, search transitively |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7455 |
if ( !conv ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7456 |
conv2 = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7457 |
for( conv1 in converters ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7458 |
tmp = conv1.split( " " ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7459 |
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7460 |
conv2 = converters[ tmp[1] + " " + current ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7461 |
if ( conv2 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7462 |
conv1 = converters[ conv1 ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7463 |
if ( conv1 === true ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7464 |
conv = conv2; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7465 |
} else if ( conv2 === true ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7466 |
conv = conv1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7467 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7468 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7469 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7470 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7471 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7472 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7473 |
// If we found no converter, dispatch an error |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7474 |
if ( !( conv || conv2 ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7475 |
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7476 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7477 |
// If found converter is not an equivalence |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7478 |
if ( conv !== true ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7479 |
// Convert with 1 or 2 converters accordingly |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7480 |
response = conv ? conv( response ) : conv2( conv1(response) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7481 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7482 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7483 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7484 |
return response; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7485 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7486 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7487 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7488 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7489 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7490 |
var jsc = jQuery.now(), |
| 101 | 7491 |
jsre = /(\=)\?(&|$)|\?\?/i; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7492 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7493 |
// Default jsonp settings |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7494 |
jQuery.ajaxSetup({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7495 |
jsonp: "callback", |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7496 |
jsonpCallback: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7497 |
return jQuery.expando + "_" + ( jsc++ ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7498 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7499 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7500 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7501 |
// Detect, normalize options and install callbacks for jsonp requests |
| 101 | 7502 |
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
7503 |
||
7504 |
var inspectData = s.contentType === "application/x-www-form-urlencoded" && |
|
7505 |
( typeof s.data === "string" ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7506 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7507 |
if ( s.dataTypes[ 0 ] === "jsonp" || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7508 |
s.jsonp !== false && ( jsre.test( s.url ) || |
| 101 | 7509 |
inspectData && jsre.test( s.data ) ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7510 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7511 |
var responseContainer, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7512 |
jsonpCallback = s.jsonpCallback = |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7513 |
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7514 |
previous = window[ jsonpCallback ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7515 |
url = s.url, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7516 |
data = s.data, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7517 |
replace = "$1" + jsonpCallback + "$2"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7518 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7519 |
if ( s.jsonp !== false ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7520 |
url = url.replace( jsre, replace ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7521 |
if ( s.url === url ) {
|
| 101 | 7522 |
if ( inspectData ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7523 |
data = data.replace( jsre, replace ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7524 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7525 |
if ( s.data === data ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7526 |
// Add callback manually |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7527 |
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7528 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7529 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7530 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7531 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7532 |
s.url = url; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7533 |
s.data = data; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7534 |
|
| 101 | 7535 |
// Install callback |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7536 |
window[ jsonpCallback ] = function( response ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7537 |
responseContainer = [ response ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7538 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7539 |
|
| 101 | 7540 |
// Clean-up function |
7541 |
jqXHR.always(function() {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7542 |
// Set callback back to previous value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7543 |
window[ jsonpCallback ] = previous; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7544 |
// Call if it was a function and we have a response |
| 101 | 7545 |
if ( responseContainer && jQuery.isFunction( previous ) ) {
|
7546 |
window[ jsonpCallback ]( responseContainer[ 0 ] ); |
|
7547 |
} |
|
7548 |
}); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7549 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7550 |
// Use data converter to retrieve json after script execution |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7551 |
s.converters["script json"] = function() {
|
| 101 | 7552 |
if ( !responseContainer ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7553 |
jQuery.error( jsonpCallback + " was not called" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7554 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7555 |
return responseContainer[ 0 ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7556 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7557 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7558 |
// force json dataType |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7559 |
s.dataTypes[ 0 ] = "json"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7560 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7561 |
// Delegate to script |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7562 |
return "script"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7563 |
} |
| 101 | 7564 |
}); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7565 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7566 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7567 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7568 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7569 |
// Install script dataType |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7570 |
jQuery.ajaxSetup({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7571 |
accepts: {
|
| 101 | 7572 |
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7573 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7574 |
contents: {
|
| 101 | 7575 |
script: /javascript|ecmascript/ |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7576 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7577 |
converters: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7578 |
"text script": function( text ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7579 |
jQuery.globalEval( text ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7580 |
return text; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7581 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7582 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7583 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7584 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7585 |
// Handle cache's special case and global |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7586 |
jQuery.ajaxPrefilter( "script", function( s ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7587 |
if ( s.cache === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7588 |
s.cache = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7589 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7590 |
if ( s.crossDomain ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7591 |
s.type = "GET"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7592 |
s.global = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7593 |
} |
| 101 | 7594 |
}); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7595 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7596 |
// Bind script tag hack transport |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7597 |
jQuery.ajaxTransport( "script", function(s) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7598 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7599 |
// This transport only deals with cross domain requests |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7600 |
if ( s.crossDomain ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7601 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7602 |
var script, |
| 101 | 7603 |
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7604 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7605 |
return {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7606 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7607 |
send: function( _, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7608 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7609 |
script = document.createElement( "script" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7610 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7611 |
script.async = "async"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7612 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7613 |
if ( s.scriptCharset ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7614 |
script.charset = s.scriptCharset; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7615 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7616 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7617 |
script.src = s.url; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7618 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7619 |
// Attach handlers for all browsers |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7620 |
script.onload = script.onreadystatechange = function( _, isAbort ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7621 |
|
| 101 | 7622 |
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7623 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7624 |
// Handle memory leak in IE |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7625 |
script.onload = script.onreadystatechange = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7626 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7627 |
// Remove the script |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7628 |
if ( head && script.parentNode ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7629 |
head.removeChild( script ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7630 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7631 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7632 |
// Dereference the script |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7633 |
script = undefined; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7634 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7635 |
// Callback if not abort |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7636 |
if ( !isAbort ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7637 |
callback( 200, "success" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7638 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7639 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7640 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7641 |
// Use insertBefore instead of appendChild to circumvent an IE6 bug. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7642 |
// This arises when a base node is used (#2709 and #4378). |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7643 |
head.insertBefore( script, head.firstChild ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7644 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7645 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7646 |
abort: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7647 |
if ( script ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7648 |
script.onload( 0, 1 ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7649 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7650 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7651 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7652 |
} |
| 101 | 7653 |
}); |
7654 |
||
7655 |
||
7656 |
||
7657 |
||
7658 |
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload |
|
7659 |
xhrOnUnloadAbort = window.ActiveXObject ? function() {
|
|
7660 |
// Abort all pending requests |
|
7661 |
for ( var key in xhrCallbacks ) {
|
|
7662 |
xhrCallbacks[ key ]( 0, 1 ); |
|
7663 |
} |
|
7664 |
} : false, |
|
7665 |
xhrId = 0, |
|
7666 |
xhrCallbacks; |
|
7667 |
||
7668 |
// Functions to create xhrs |
|
7669 |
function createStandardXHR() {
|
|
7670 |
try {
|
|
7671 |
return new window.XMLHttpRequest(); |
|
7672 |
} catch( e ) {}
|
|
7673 |
} |
|
7674 |
||
7675 |
function createActiveXHR() {
|
|
7676 |
try {
|
|
7677 |
return new window.ActiveXObject( "Microsoft.XMLHTTP" ); |
|
7678 |
} catch( e ) {}
|
|
7679 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7680 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7681 |
// Create the request object |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7682 |
// (This is still attached to ajaxSettings for backward compatibility) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7683 |
jQuery.ajaxSettings.xhr = window.ActiveXObject ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7684 |
/* Microsoft failed to properly |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7685 |
* implement the XMLHttpRequest in IE7 (can't request local files), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7686 |
* so we use the ActiveXObject when it is available |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7687 |
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7688 |
* we need a fallback. |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7689 |
*/ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7690 |
function() {
|
| 101 | 7691 |
return !this.isLocal && createStandardXHR() || createActiveXHR(); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7692 |
} : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7693 |
// For all other browsers, use the standard XMLHttpRequest object |
| 101 | 7694 |
createStandardXHR; |
7695 |
||
7696 |
// Determine support properties |
|
7697 |
(function( xhr ) {
|
|
7698 |
jQuery.extend( jQuery.support, {
|
|
7699 |
ajax: !!xhr, |
|
7700 |
cors: !!xhr && ( "withCredentials" in xhr ) |
|
7701 |
}); |
|
7702 |
})( jQuery.ajaxSettings.xhr() ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7703 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7704 |
// Create transport if the browser can provide an xhr |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7705 |
if ( jQuery.support.ajax ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7706 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7707 |
jQuery.ajaxTransport(function( s ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7708 |
// Cross domain only allowed if supported through XMLHttpRequest |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7709 |
if ( !s.crossDomain || jQuery.support.cors ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7710 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7711 |
var callback; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7712 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7713 |
return {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7714 |
send: function( headers, complete ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7715 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7716 |
// Get a new xhr |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7717 |
var xhr = s.xhr(), |
| 101 | 7718 |
handle, |
7719 |
i; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7720 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7721 |
// Open the socket |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7722 |
// Passing null username, generates a login popup on Opera (#2865) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7723 |
if ( s.username ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7724 |
xhr.open( s.type, s.url, s.async, s.username, s.password ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7725 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7726 |
xhr.open( s.type, s.url, s.async ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7727 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7728 |
|
| 101 | 7729 |
// Apply custom fields if provided |
7730 |
if ( s.xhrFields ) {
|
|
7731 |
for ( i in s.xhrFields ) {
|
|
7732 |
xhr[ i ] = s.xhrFields[ i ]; |
|
7733 |
} |
|
7734 |
} |
|
7735 |
||
7736 |
// Override mime type if needed |
|
7737 |
if ( s.mimeType && xhr.overrideMimeType ) {
|
|
7738 |
xhr.overrideMimeType( s.mimeType ); |
|
7739 |
} |
|
7740 |
||
7741 |
// X-Requested-With header |
|
7742 |
// For cross-domain requests, seeing as conditions for a preflight are |
|
7743 |
// akin to a jigsaw puzzle, we simply never set it to be sure. |
|
7744 |
// (it can always be set on a per-request basis or even using ajaxSetup) |
|
7745 |
// For same-domain requests, won't change header if already provided. |
|
7746 |
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
|
|
7747 |
headers[ "X-Requested-With" ] = "XMLHttpRequest"; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7748 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7749 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7750 |
// Need an extra try/catch for cross domain requests in Firefox 3 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7751 |
try {
|
| 101 | 7752 |
for ( i in headers ) {
|
7753 |
xhr.setRequestHeader( i, headers[ i ] ); |
|
7754 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7755 |
} catch( _ ) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7756 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7757 |
// Do send the request |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7758 |
// This may raise an exception which is actually |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7759 |
// handled in jQuery.ajax (so no try/catch here) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7760 |
xhr.send( ( s.hasContent && s.data ) || null ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7761 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7762 |
// Listener |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7763 |
callback = function( _, isAbort ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7764 |
|
| 101 | 7765 |
var status, |
7766 |
statusText, |
|
7767 |
responseHeaders, |
|
7768 |
responses, |
|
7769 |
xml; |
|
7770 |
||
7771 |
// Firefox throws exceptions when accessing properties |
|
7772 |
// of an xhr when a network error occured |
|
7773 |
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) |
|
7774 |
try {
|
|
7775 |
||
7776 |
// Was never called and is aborted or complete |
|
7777 |
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
|
|
7778 |
||
7779 |
// Only called once |
|
7780 |
callback = undefined; |
|
7781 |
||
7782 |
// Do not keep as active anymore |
|
7783 |
if ( handle ) {
|
|
7784 |
xhr.onreadystatechange = jQuery.noop; |
|
7785 |
if ( xhrOnUnloadAbort ) {
|
|
7786 |
delete xhrCallbacks[ handle ]; |
|
7787 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7788 |
} |
| 101 | 7789 |
|
7790 |
// If it's an abort |
|
7791 |
if ( isAbort ) {
|
|
7792 |
// Abort it manually if needed |
|
7793 |
if ( xhr.readyState !== 4 ) {
|
|
7794 |
xhr.abort(); |
|
7795 |
} |
|
7796 |
} else {
|
|
7797 |
status = xhr.status; |
|
7798 |
responseHeaders = xhr.getAllResponseHeaders(); |
|
7799 |
responses = {};
|
|
7800 |
xml = xhr.responseXML; |
|
7801 |
||
7802 |
// Construct response list |
|
7803 |
if ( xml && xml.documentElement /* #4958 */ ) {
|
|
7804 |
responses.xml = xml; |
|
7805 |
} |
|
7806 |
responses.text = xhr.responseText; |
|
7807 |
||
7808 |
// Firefox throws an exception when accessing |
|
7809 |
// statusText for faulty cross-domain requests |
|
7810 |
try {
|
|
7811 |
statusText = xhr.statusText; |
|
7812 |
} catch( e ) {
|
|
7813 |
// We normalize with Webkit giving an empty statusText |
|
7814 |
statusText = ""; |
|
7815 |
} |
|
7816 |
||
7817 |
// Filter status for non standard behaviors |
|
7818 |
||
7819 |
// If the request is local and we have data: assume a success |
|
7820 |
// (success with no data won't get notified, that's the best we |
|
7821 |
// can do given current implementations) |
|
7822 |
if ( !status && s.isLocal && !s.crossDomain ) {
|
|
7823 |
status = responses.text ? 200 : 404; |
|
7824 |
// IE - #1450: sometimes returns 1223 when it should be 204 |
|
7825 |
} else if ( status === 1223 ) {
|
|
7826 |
status = 204; |
|
7827 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7828 |
} |
| 101 | 7829 |
} |
7830 |
} catch( firefoxAccessException ) {
|
|
7831 |
if ( !isAbort ) {
|
|
7832 |
complete( -1, firefoxAccessException ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7833 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7834 |
} |
| 101 | 7835 |
|
7836 |
// Call complete if needed |
|
7837 |
if ( responses ) {
|
|
7838 |
complete( status, statusText, responses, responseHeaders ); |
|
7839 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7840 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7841 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7842 |
// if we're in sync mode or it's in cache |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7843 |
// and has been retrieved directly (IE6 & IE7) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7844 |
// we need to manually fire the callback |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7845 |
if ( !s.async || xhr.readyState === 4 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7846 |
callback(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7847 |
} else {
|
| 101 | 7848 |
handle = ++xhrId; |
7849 |
if ( xhrOnUnloadAbort ) {
|
|
7850 |
// Create the active xhrs callbacks list if needed |
|
7851 |
// and attach the unload handler |
|
7852 |
if ( !xhrCallbacks ) {
|
|
7853 |
xhrCallbacks = {};
|
|
7854 |
jQuery( window ).unload( xhrOnUnloadAbort ); |
|
7855 |
} |
|
7856 |
// Add to list of active xhrs callbacks |
|
7857 |
xhrCallbacks[ handle ] = callback; |
|
7858 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7859 |
xhr.onreadystatechange = callback; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7860 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7861 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7862 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7863 |
abort: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7864 |
if ( callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7865 |
callback(0,1); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7866 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7867 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7868 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7869 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7870 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7871 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7872 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7873 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7874 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7875 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7876 |
var elemdisplay = {},
|
| 101 | 7877 |
iframe, iframeDoc, |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7878 |
rfxtypes = /^(?:toggle|show|hide)$/, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7879 |
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7880 |
timerId, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7881 |
fxAttrs = [ |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7882 |
// height animations |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7883 |
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7884 |
// width animations |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7885 |
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7886 |
// opacity animations |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7887 |
[ "opacity" ] |
| 101 | 7888 |
], |
7889 |
fxNow, |
|
7890 |
requestAnimationFrame = window.webkitRequestAnimationFrame || |
|
7891 |
window.mozRequestAnimationFrame || |
|
7892 |
window.oRequestAnimationFrame; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7893 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7894 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7895 |
show: function( speed, easing, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7896 |
var elem, display; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7897 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7898 |
if ( speed || speed === 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7899 |
return this.animate( genFx("show", 3), speed, easing, callback);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7900 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7901 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7902 |
for ( var i = 0, j = this.length; i < j; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7903 |
elem = this[i]; |
| 101 | 7904 |
|
7905 |
if ( elem.style ) {
|
|
7906 |
display = elem.style.display; |
|
7907 |
||
7908 |
// Reset the inline display of this element to learn if it is |
|
7909 |
// being hidden by cascaded rules or not |
|
7910 |
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
|
|
7911 |
display = elem.style.display = ""; |
|
7912 |
} |
|
7913 |
||
7914 |
// Set elements which have been overridden with display: none |
|
7915 |
// in a stylesheet to whatever the default browser style is |
|
7916 |
// for such an element |
|
7917 |
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
|
|
7918 |
jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName)); |
|
7919 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7920 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7921 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7922 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7923 |
// Set the display of most of the elements in a second loop |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7924 |
// to avoid the constant reflow |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7925 |
for ( i = 0; i < j; i++ ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7926 |
elem = this[i]; |
| 101 | 7927 |
|
7928 |
if ( elem.style ) {
|
|
7929 |
display = elem.style.display; |
|
7930 |
||
7931 |
if ( display === "" || display === "none" ) {
|
|
7932 |
elem.style.display = jQuery._data(elem, "olddisplay") || ""; |
|
7933 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7934 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7935 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7936 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7937 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7938 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7939 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7940 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7941 |
hide: function( speed, easing, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7942 |
if ( speed || speed === 0 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7943 |
return this.animate( genFx("hide", 3), speed, easing, callback);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7944 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7945 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7946 |
for ( var i = 0, j = this.length; i < j; i++ ) {
|
| 101 | 7947 |
if ( this[i].style ) {
|
7948 |
var display = jQuery.css( this[i], "display" ); |
|
7949 |
||
7950 |
if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
|
|
7951 |
jQuery._data( this[i], "olddisplay", display ); |
|
7952 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7953 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7954 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7955 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7956 |
// Set the display of the elements in a second loop |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7957 |
// to avoid the constant reflow |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7958 |
for ( i = 0; i < j; i++ ) {
|
| 101 | 7959 |
if ( this[i].style ) {
|
7960 |
this[i].style.display = "none"; |
|
7961 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7962 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7963 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7964 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7965 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7966 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7967 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7968 |
// Save the old toggle function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7969 |
_toggle: jQuery.fn.toggle, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7970 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7971 |
toggle: function( fn, fn2, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7972 |
var bool = typeof fn === "boolean"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7973 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7974 |
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7975 |
this._toggle.apply( this, arguments ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7976 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7977 |
} else if ( fn == null || bool ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7978 |
this.each(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7979 |
var state = bool ? fn : jQuery(this).is(":hidden");
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7980 |
jQuery(this)[ state ? "show" : "hide" ](); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7981 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7982 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7983 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7984 |
this.animate(genFx("toggle", 3), fn, fn2, callback);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7985 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7986 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7987 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7988 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7989 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7990 |
fadeTo: function( speed, to, easing, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7991 |
return this.filter(":hidden").css("opacity", 0).show().end()
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7992 |
.animate({opacity: to}, speed, easing, callback);
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7993 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7994 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7995 |
animate: function( prop, speed, easing, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7996 |
var optall = jQuery.speed(speed, easing, callback); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7997 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7998 |
if ( jQuery.isEmptyObject( prop ) ) {
|
| 101 | 7999 |
return this.each( optall.complete, [ false ] ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8000 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8001 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8002 |
return this[ optall.queue === false ? "each" : "queue" ](function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8003 |
// XXX 'this' does not always have a nodeName when running the |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8004 |
// test suite |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8005 |
|
| 101 | 8006 |
if ( optall.queue === false ) {
|
8007 |
jQuery._mark( this ); |
|
8008 |
} |
|
8009 |
||
8010 |
var opt = jQuery.extend({}, optall),
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8011 |
isElement = this.nodeType === 1, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8012 |
hidden = isElement && jQuery(this).is(":hidden"),
|
| 101 | 8013 |
name, val, p, |
8014 |
display, e, |
|
8015 |
parts, start, end, unit; |
|
8016 |
||
8017 |
// will store per property easing and be used to determine when an animation is complete |
|
8018 |
opt.animatedProperties = {};
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8019 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8020 |
for ( p in prop ) {
|
| 101 | 8021 |
|
8022 |
// property name normalization |
|
8023 |
name = jQuery.camelCase( p ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8024 |
if ( p !== name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8025 |
prop[ name ] = prop[ p ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8026 |
delete prop[ p ]; |
| 101 | 8027 |
} |
8028 |
||
8029 |
val = prop[name]; |
|
8030 |
||
8031 |
if ( val === "hide" && hidden || val === "show" && !hidden ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8032 |
return opt.complete.call(this); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8033 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8034 |
|
| 101 | 8035 |
if ( isElement && ( name === "height" || name === "width" ) ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8036 |
// Make sure that nothing sneaks out |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8037 |
// Record all 3 overflow attributes because IE does not |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8038 |
// change the overflow attribute when overflowX and |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8039 |
// overflowY are set to the same value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8040 |
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8041 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8042 |
// Set display property to inline-block for height/width |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8043 |
// animations on inline elements that are having width/height |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8044 |
// animated |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8045 |
if ( jQuery.css( this, "display" ) === "inline" && |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8046 |
jQuery.css( this, "float" ) === "none" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8047 |
if ( !jQuery.support.inlineBlockNeedsLayout ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8048 |
this.style.display = "inline-block"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8049 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8050 |
} else {
|
| 101 | 8051 |
display = defaultDisplay(this.nodeName); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8052 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8053 |
// inline-level elements accept inline-block; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8054 |
// block-level elements need to be inline with layout |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8055 |
if ( display === "inline" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8056 |
this.style.display = "inline-block"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8057 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8058 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8059 |
this.style.display = "inline"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8060 |
this.style.zoom = 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8061 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8062 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8063 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8064 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8065 |
|
| 101 | 8066 |
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) |
8067 |
opt.animatedProperties[name] = jQuery.isArray( val ) ? |
|
8068 |
val[1]: |
|
8069 |
opt.specialEasing && opt.specialEasing[name] || opt.easing || 'swing'; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8070 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8071 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8072 |
if ( opt.overflow != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8073 |
this.style.overflow = "hidden"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8074 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8075 |
|
| 101 | 8076 |
for ( p in prop ) {
|
8077 |
e = new jQuery.fx( this, opt, p ); |
|
8078 |
||
8079 |
val = prop[p]; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8080 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8081 |
if ( rfxtypes.test(val) ) {
|
| 101 | 8082 |
e[ val === "toggle" ? hidden ? "show" : "hide" : val ](); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8083 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8084 |
} else {
|
| 101 | 8085 |
parts = rfxnum.exec(val); |
8086 |
start = e.cur(); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8087 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8088 |
if ( parts ) {
|
| 101 | 8089 |
end = parseFloat( parts[2] ); |
8090 |
unit = parts[3] || ( jQuery.cssNumber[ name ] ? "" : "px" ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8091 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8092 |
// We need to compute starting value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8093 |
if ( unit !== "px" ) {
|
| 101 | 8094 |
jQuery.style( this, p, (end || 1) + unit); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8095 |
start = ((end || 1) / e.cur()) * start; |
| 101 | 8096 |
jQuery.style( this, p, start + unit); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8097 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8098 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8099 |
// If a +=/-= token was provided, we're doing a relative animation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8100 |
if ( parts[1] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8101 |
end = ((parts[1] === "-=" ? -1 : 1) * end) + start; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8102 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8103 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8104 |
e.custom( start, end, unit ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8105 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8106 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8107 |
e.custom( start, val, "" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8108 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8109 |
} |
| 101 | 8110 |
} |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8111 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8112 |
// For JS strict compliance |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8113 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8114 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8115 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8116 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8117 |
stop: function( clearQueue, gotoEnd ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8118 |
if ( clearQueue ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8119 |
this.queue([]); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8120 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8121 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8122 |
this.each(function() {
|
| 101 | 8123 |
var timers = jQuery.timers, |
8124 |
i = timers.length; |
|
8125 |
// clear marker counters if we know they won't be |
|
8126 |
if ( !gotoEnd ) {
|
|
8127 |
jQuery._unmark( true, this ); |
|
8128 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8129 |
// go in reverse order so anything added to the queue during the loop is ignored |
| 101 | 8130 |
while ( i-- ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8131 |
if ( timers[i].elem === this ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8132 |
if (gotoEnd) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8133 |
// force the next step to be the last |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8134 |
timers[i](true); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8135 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8136 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8137 |
timers.splice(i, 1); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8138 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8139 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8140 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8141 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8142 |
// start the next in the queue if the last step wasn't forced |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8143 |
if ( !gotoEnd ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8144 |
this.dequeue(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8145 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8146 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8147 |
return this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8148 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8149 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8150 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8151 |
|
| 101 | 8152 |
// Animations created synchronously will run synchronously |
8153 |
function createFxNow() {
|
|
8154 |
setTimeout( clearFxNow, 0 ); |
|
8155 |
return ( fxNow = jQuery.now() ); |
|
8156 |
} |
|
8157 |
||
8158 |
function clearFxNow() {
|
|
8159 |
fxNow = undefined; |
|
8160 |
} |
|
8161 |
||
8162 |
// Generate parameters to create a standard animation |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8163 |
function genFx( type, num ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8164 |
var obj = {};
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8165 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8166 |
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8167 |
obj[ this ] = type; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8168 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8169 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8170 |
return obj; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8171 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8172 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8173 |
// Generate shortcuts for custom animations |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8174 |
jQuery.each({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8175 |
slideDown: genFx("show", 1),
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8176 |
slideUp: genFx("hide", 1),
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8177 |
slideToggle: genFx("toggle", 1),
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8178 |
fadeIn: { opacity: "show" },
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8179 |
fadeOut: { opacity: "hide" },
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8180 |
fadeToggle: { opacity: "toggle" }
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8181 |
}, function( name, props ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8182 |
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8183 |
return this.animate( props, speed, easing, callback ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8184 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8185 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8186 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8187 |
jQuery.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8188 |
speed: function( speed, easing, fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8189 |
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8190 |
complete: fn || !fn && easing || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8191 |
jQuery.isFunction( speed ) && speed, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8192 |
duration: speed, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8193 |
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8194 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8195 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8196 |
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8197 |
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8198 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8199 |
// Queueing |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8200 |
opt.old = opt.complete; |
| 101 | 8201 |
opt.complete = function( noUnmark ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8202 |
if ( opt.queue !== false ) {
|
| 101 | 8203 |
jQuery.dequeue( this ); |
8204 |
} else if ( noUnmark !== false ) {
|
|
8205 |
jQuery._unmark( this ); |
|
8206 |
} |
|
8207 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8208 |
if ( jQuery.isFunction( opt.old ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8209 |
opt.old.call( this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8210 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8211 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8212 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8213 |
return opt; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8214 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8215 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8216 |
easing: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8217 |
linear: function( p, n, firstNum, diff ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8218 |
return firstNum + diff * p; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8219 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8220 |
swing: function( p, n, firstNum, diff ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8221 |
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8222 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8223 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8224 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8225 |
timers: [], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8226 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8227 |
fx: function( elem, options, prop ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8228 |
this.options = options; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8229 |
this.elem = elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8230 |
this.prop = prop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8231 |
|
| 101 | 8232 |
options.orig = options.orig || {};
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8233 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8234 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8235 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8236 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8237 |
jQuery.fx.prototype = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8238 |
// Simple function for setting a style value |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8239 |
update: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8240 |
if ( this.options.step ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8241 |
this.options.step.call( this.elem, this.now, this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8242 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8243 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8244 |
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8245 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8246 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8247 |
// Get the current size |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8248 |
cur: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8249 |
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8250 |
return this.elem[ this.prop ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8251 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8252 |
|
| 101 | 8253 |
var parsed, |
8254 |
r = jQuery.css( this.elem, this.prop ); |
|
8255 |
// Empty strings, null, undefined and "auto" are converted to 0, |
|
8256 |
// complex values such as "rotate(1rad)" are returned as is, |
|
8257 |
// simple values such as "10px" are parsed to Float. |
|
8258 |
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8259 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8260 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8261 |
// Start an animation from one number to another |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8262 |
custom: function( from, to, unit ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8263 |
var self = this, |
| 101 | 8264 |
fx = jQuery.fx, |
8265 |
raf; |
|
8266 |
||
8267 |
this.startTime = fxNow || createFxNow(); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8268 |
this.start = from; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8269 |
this.end = to; |
| 101 | 8270 |
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8271 |
this.now = this.start; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8272 |
this.pos = this.state = 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8273 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8274 |
function t( gotoEnd ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8275 |
return self.step(gotoEnd); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8276 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8277 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8278 |
t.elem = this.elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8279 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8280 |
if ( t() && jQuery.timers.push(t) && !timerId ) {
|
| 101 | 8281 |
// Use requestAnimationFrame instead of setInterval if available |
8282 |
if ( requestAnimationFrame ) {
|
|
8283 |
timerId = 1; |
|
8284 |
raf = function() {
|
|
8285 |
// When timerId gets set to null at any point, this stops |
|
8286 |
if ( timerId ) {
|
|
8287 |
requestAnimationFrame( raf ); |
|
8288 |
fx.tick(); |
|
8289 |
} |
|
8290 |
}; |
|
8291 |
requestAnimationFrame( raf ); |
|
8292 |
} else {
|
|
8293 |
timerId = setInterval( fx.tick, fx.interval ); |
|
8294 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8295 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8296 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8297 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8298 |
// Simple 'show' function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8299 |
show: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8300 |
// Remember where we started, so that we can go back to it later |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8301 |
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8302 |
this.options.show = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8303 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8304 |
// Begin the animation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8305 |
// Make sure that we start at a small width/height to avoid any |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8306 |
// flash of content |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8307 |
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8308 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8309 |
// Start by showing the element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8310 |
jQuery( this.elem ).show(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8311 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8312 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8313 |
// Simple 'hide' function |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8314 |
hide: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8315 |
// Remember where we started, so that we can go back to it later |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8316 |
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8317 |
this.options.hide = true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8318 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8319 |
// Begin the animation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8320 |
this.custom(this.cur(), 0); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8321 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8322 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8323 |
// Each step of an animation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8324 |
step: function( gotoEnd ) {
|
| 101 | 8325 |
var t = fxNow || createFxNow(), |
8326 |
done = true, |
|
8327 |
elem = this.elem, |
|
8328 |
options = this.options, |
|
8329 |
i, n; |
|
8330 |
||
8331 |
if ( gotoEnd || t >= options.duration + this.startTime ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8332 |
this.now = this.end; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8333 |
this.pos = this.state = 1; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8334 |
this.update(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8335 |
|
| 101 | 8336 |
options.animatedProperties[ this.prop ] = true; |
8337 |
||
8338 |
for ( i in options.animatedProperties ) {
|
|
8339 |
if ( options.animatedProperties[i] !== true ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8340 |
done = false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8341 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8342 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8343 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8344 |
if ( done ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8345 |
// Reset the overflow |
| 101 | 8346 |
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8347 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8348 |
jQuery.each( [ "", "X", "Y" ], function (index, value) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8349 |
elem.style[ "overflow" + value ] = options.overflow[index]; |
| 101 | 8350 |
}); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8351 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8352 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8353 |
// Hide the element if the "hide" operation was done |
| 101 | 8354 |
if ( options.hide ) {
|
8355 |
jQuery(elem).hide(); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8356 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8357 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8358 |
// Reset the properties, if the item has been hidden or shown |
| 101 | 8359 |
if ( options.hide || options.show ) {
|
8360 |
for ( var p in options.animatedProperties ) {
|
|
8361 |
jQuery.style( elem, p, options.orig[p] ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8362 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8363 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8364 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8365 |
// Execute the complete function |
| 101 | 8366 |
options.complete.call( elem ); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8367 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8368 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8369 |
return false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8370 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8371 |
} else {
|
| 101 | 8372 |
// classical easing cannot be used with an Infinity duration |
8373 |
if ( options.duration == Infinity ) {
|
|
8374 |
this.now = t; |
|
8375 |
} else {
|
|
8376 |
n = t - this.startTime; |
|
8377 |
||
8378 |
this.state = n / options.duration; |
|
8379 |
// Perform the easing function, defaults to swing |
|
8380 |
this.pos = jQuery.easing[options.animatedProperties[this.prop]](this.state, n, 0, 1, options.duration); |
|
8381 |
this.now = this.start + ((this.end - this.start) * this.pos); |
|
8382 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8383 |
// Perform the next step of the animation |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8384 |
this.update(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8385 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8386 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8387 |
return true; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8388 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8389 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8390 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8391 |
jQuery.extend( jQuery.fx, {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8392 |
tick: function() {
|
| 101 | 8393 |
var timers = jQuery.timers, |
8394 |
i = timers.length; |
|
8395 |
while ( i-- ) {
|
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8396 |
if ( !timers[i]() ) {
|
| 101 | 8397 |
timers.splice(i, 1); |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8398 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8399 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8400 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8401 |
if ( !timers.length ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8402 |
jQuery.fx.stop(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8403 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8404 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8405 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8406 |
interval: 13, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8407 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8408 |
stop: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8409 |
clearInterval( timerId ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8410 |
timerId = null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8411 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8412 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8413 |
speeds: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8414 |
slow: 600, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8415 |
fast: 200, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8416 |
// Default speed |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8417 |
_default: 400 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8418 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8419 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8420 |
step: {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8421 |
opacity: function( fx ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8422 |
jQuery.style( fx.elem, "opacity", fx.now ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8423 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8424 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8425 |
_default: function( fx ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8426 |
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8427 |
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8428 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8429 |
fx.elem[ fx.prop ] = fx.now; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8430 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8431 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8432 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8433 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8434 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8435 |
if ( jQuery.expr && jQuery.expr.filters ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8436 |
jQuery.expr.filters.animated = function( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8437 |
return jQuery.grep(jQuery.timers, function( fn ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8438 |
return elem === fn.elem; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8439 |
}).length; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8440 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8441 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8442 |
|
| 101 | 8443 |
// Try to restore the default display value of an element |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8444 |
function defaultDisplay( nodeName ) {
|
| 101 | 8445 |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8446 |
if ( !elemdisplay[ nodeName ] ) {
|
| 101 | 8447 |
|
8448 |
var elem = jQuery( "<" + nodeName + ">" ).appendTo( "body" ), |
|
8449 |
display = elem.css( "display" ); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8450 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8451 |
elem.remove(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8452 |
|
| 101 | 8453 |
// If the simple way fails, |
8454 |
// get element's real default display by attaching it to a temp iframe |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8455 |
if ( display === "none" || display === "" ) {
|
| 101 | 8456 |
// No iframe to use yet, so create it |
8457 |
if ( !iframe ) {
|
|
8458 |
iframe = document.createElement( "iframe" ); |
|
8459 |
iframe.frameBorder = iframe.width = iframe.height = 0; |
|
8460 |
} |
|
8461 |
||
8462 |
document.body.appendChild( iframe ); |
|
8463 |
||
8464 |
// Create a cacheable copy of the iframe document on first call. |
|
8465 |
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake html |
|
8466 |
// document to it, Webkit & Firefox won't allow reusing the iframe document |
|
8467 |
if ( !iframeDoc || !iframe.createElement ) {
|
|
8468 |
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; |
|
8469 |
iframeDoc.write( "<!doctype><html><body></body></html>" ); |
|
8470 |
} |
|
8471 |
||
8472 |
elem = iframeDoc.createElement( nodeName ); |
|
8473 |
||
8474 |
iframeDoc.body.appendChild( elem ); |
|
8475 |
||
8476 |
display = jQuery.css( elem, "display" ); |
|
8477 |
||
8478 |
document.body.removeChild( iframe ); |
|
8479 |
} |
|
8480 |
||
8481 |
// Store the correct default display |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8482 |
elemdisplay[ nodeName ] = display; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8483 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8484 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8485 |
return elemdisplay[ nodeName ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8486 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8487 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8488 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8489 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8490 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8491 |
var rtable = /^t(?:able|d|h)$/i, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8492 |
rroot = /^(?:body|html)$/i; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8493 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8494 |
if ( "getBoundingClientRect" in document.documentElement ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8495 |
jQuery.fn.offset = function( options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8496 |
var elem = this[0], box; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8497 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8498 |
if ( options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8499 |
return this.each(function( i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8500 |
jQuery.offset.setOffset( this, options, i ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8501 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8502 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8503 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8504 |
if ( !elem || !elem.ownerDocument ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8505 |
return null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8506 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8507 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8508 |
if ( elem === elem.ownerDocument.body ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8509 |
return jQuery.offset.bodyOffset( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8510 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8511 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8512 |
try {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8513 |
box = elem.getBoundingClientRect(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8514 |
} catch(e) {}
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8515 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8516 |
var doc = elem.ownerDocument, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8517 |
docElem = doc.documentElement; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8518 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8519 |
// Make sure we're not dealing with a disconnected DOM node |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8520 |
if ( !box || !jQuery.contains( docElem, elem ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8521 |
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8522 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8523 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8524 |
var body = doc.body, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8525 |
win = getWindow(doc), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8526 |
clientTop = docElem.clientTop || body.clientTop || 0, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8527 |
clientLeft = docElem.clientLeft || body.clientLeft || 0, |
| 101 | 8528 |
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, |
8529 |
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8530 |
top = box.top + scrollTop - clientTop, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8531 |
left = box.left + scrollLeft - clientLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8532 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8533 |
return { top: top, left: left };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8534 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8535 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8536 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8537 |
jQuery.fn.offset = function( options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8538 |
var elem = this[0]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8539 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8540 |
if ( options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8541 |
return this.each(function( i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8542 |
jQuery.offset.setOffset( this, options, i ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8543 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8544 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8545 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8546 |
if ( !elem || !elem.ownerDocument ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8547 |
return null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8548 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8549 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8550 |
if ( elem === elem.ownerDocument.body ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8551 |
return jQuery.offset.bodyOffset( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8552 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8553 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8554 |
jQuery.offset.initialize(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8555 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8556 |
var computedStyle, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8557 |
offsetParent = elem.offsetParent, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8558 |
prevOffsetParent = elem, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8559 |
doc = elem.ownerDocument, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8560 |
docElem = doc.documentElement, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8561 |
body = doc.body, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8562 |
defaultView = doc.defaultView, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8563 |
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8564 |
top = elem.offsetTop, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8565 |
left = elem.offsetLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8566 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8567 |
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8568 |
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8569 |
break; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8570 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8571 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8572 |
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8573 |
top -= elem.scrollTop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8574 |
left -= elem.scrollLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8575 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8576 |
if ( elem === offsetParent ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8577 |
top += elem.offsetTop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8578 |
left += elem.offsetLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8579 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8580 |
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8581 |
top += parseFloat( computedStyle.borderTopWidth ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8582 |
left += parseFloat( computedStyle.borderLeftWidth ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8583 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8584 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8585 |
prevOffsetParent = offsetParent; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8586 |
offsetParent = elem.offsetParent; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8587 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8588 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8589 |
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8590 |
top += parseFloat( computedStyle.borderTopWidth ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8591 |
left += parseFloat( computedStyle.borderLeftWidth ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8592 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8593 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8594 |
prevComputedStyle = computedStyle; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8595 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8596 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8597 |
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8598 |
top += body.offsetTop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8599 |
left += body.offsetLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8600 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8601 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8602 |
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8603 |
top += Math.max( docElem.scrollTop, body.scrollTop ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8604 |
left += Math.max( docElem.scrollLeft, body.scrollLeft ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8605 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8606 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8607 |
return { top: top, left: left };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8608 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8609 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8610 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8611 |
jQuery.offset = {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8612 |
initialize: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8613 |
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8614 |
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>"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8615 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8616 |
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8617 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8618 |
container.innerHTML = html; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8619 |
body.insertBefore( container, body.firstChild ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8620 |
innerDiv = container.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8621 |
checkDiv = innerDiv.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8622 |
td = innerDiv.nextSibling.firstChild.firstChild; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8623 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8624 |
this.doesNotAddBorder = (checkDiv.offsetTop !== 5); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8625 |
this.doesAddBorderForTableAndCells = (td.offsetTop === 5); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8626 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8627 |
checkDiv.style.position = "fixed"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8628 |
checkDiv.style.top = "20px"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8629 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8630 |
// safari subtracts parent border width here which is 5px |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8631 |
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8632 |
checkDiv.style.position = checkDiv.style.top = ""; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8633 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8634 |
innerDiv.style.overflow = "hidden"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8635 |
innerDiv.style.position = "relative"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8636 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8637 |
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8638 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8639 |
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8640 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8641 |
body.removeChild( container ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8642 |
jQuery.offset.initialize = jQuery.noop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8643 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8644 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8645 |
bodyOffset: function( body ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8646 |
var top = body.offsetTop, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8647 |
left = body.offsetLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8648 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8649 |
jQuery.offset.initialize(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8650 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8651 |
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8652 |
top += parseFloat( jQuery.css(body, "marginTop") ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8653 |
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8654 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8655 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8656 |
return { top: top, left: left };
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8657 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8658 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8659 |
setOffset: function( elem, options, i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8660 |
var position = jQuery.css( elem, "position" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8661 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8662 |
// set position first, in-case top/left are set even on static elem |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8663 |
if ( position === "static" ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8664 |
elem.style.position = "relative"; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8665 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8666 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8667 |
var curElem = jQuery( elem ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8668 |
curOffset = curElem.offset(), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8669 |
curCSSTop = jQuery.css( elem, "top" ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8670 |
curCSSLeft = jQuery.css( elem, "left" ), |
| 101 | 8671 |
calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8672 |
props = {}, curPosition = {}, curTop, curLeft;
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8673 |
|
| 101 | 8674 |
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8675 |
if ( calculatePosition ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8676 |
curPosition = curElem.position(); |
| 101 | 8677 |
curTop = curPosition.top; |
8678 |
curLeft = curPosition.left; |
|
8679 |
} else {
|
|
8680 |
curTop = parseFloat( curCSSTop ) || 0; |
|
8681 |
curLeft = parseFloat( curCSSLeft ) || 0; |
|
8682 |
} |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8683 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8684 |
if ( jQuery.isFunction( options ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8685 |
options = options.call( elem, i, curOffset ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8686 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8687 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8688 |
if (options.top != null) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8689 |
props.top = (options.top - curOffset.top) + curTop; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8690 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8691 |
if (options.left != null) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8692 |
props.left = (options.left - curOffset.left) + curLeft; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8693 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8694 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8695 |
if ( "using" in options ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8696 |
options.using.call( elem, props ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8697 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8698 |
curElem.css( props ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8699 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8700 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8701 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8702 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8703 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8704 |
jQuery.fn.extend({
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8705 |
position: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8706 |
if ( !this[0] ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8707 |
return null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8708 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8709 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8710 |
var elem = this[0], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8711 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8712 |
// Get *real* offsetParent |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8713 |
offsetParent = this.offsetParent(), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8714 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8715 |
// Get correct offsets |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8716 |
offset = this.offset(), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8717 |
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8718 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8719 |
// Subtract element margins |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8720 |
// note: when an element has margin: auto the offsetLeft and marginLeft |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8721 |
// are the same in Safari causing offset.left to incorrectly be 0 |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8722 |
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8723 |
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8724 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8725 |
// Add offsetParent borders |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8726 |
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8727 |
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8728 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8729 |
// Subtract the two offsets |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8730 |
return {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8731 |
top: offset.top - parentOffset.top, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8732 |
left: offset.left - parentOffset.left |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8733 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8734 |
}, |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8735 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8736 |
offsetParent: function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8737 |
return this.map(function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8738 |
var offsetParent = this.offsetParent || document.body; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8739 |
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8740 |
offsetParent = offsetParent.offsetParent; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8741 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8742 |
return offsetParent; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8743 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8744 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8745 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8746 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8747 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8748 |
// Create scrollLeft and scrollTop methods |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8749 |
jQuery.each( ["Left", "Top"], function( i, name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8750 |
var method = "scroll" + name; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8751 |
|
| 101 | 8752 |
jQuery.fn[ method ] = function( val ) {
|
8753 |
var elem, win; |
|
8754 |
||
8755 |
if ( val === undefined ) {
|
|
8756 |
elem = this[ 0 ]; |
|
8757 |
||
8758 |
if ( !elem ) {
|
|
8759 |
return null; |
|
8760 |
} |
|
8761 |
||
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8762 |
win = getWindow( elem ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8763 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8764 |
// Return the scroll offset |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8765 |
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8766 |
jQuery.support.boxModel && win.document.documentElement[ method ] || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8767 |
win.document.body[ method ] : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8768 |
elem[ method ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8769 |
} |
| 101 | 8770 |
|
8771 |
// Set the scroll offset |
|
8772 |
return this.each(function() {
|
|
8773 |
win = getWindow( this ); |
|
8774 |
||
8775 |
if ( win ) {
|
|
8776 |
win.scrollTo( |
|
8777 |
!i ? val : jQuery( win ).scrollLeft(), |
|
8778 |
i ? val : jQuery( win ).scrollTop() |
|
8779 |
); |
|
8780 |
||
8781 |
} else {
|
|
8782 |
this[ method ] = val; |
|
8783 |
} |
|
8784 |
}); |
|
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8785 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8786 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8787 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8788 |
function getWindow( elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8789 |
return jQuery.isWindow( elem ) ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8790 |
elem : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8791 |
elem.nodeType === 9 ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8792 |
elem.defaultView || elem.parentWindow : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8793 |
false; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8794 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8795 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8796 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8797 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8798 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8799 |
// Create innerHeight, innerWidth, outerHeight and outerWidth methods |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8800 |
jQuery.each([ "Height", "Width" ], function( i, name ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8801 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8802 |
var type = name.toLowerCase(); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8803 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8804 |
// innerHeight and innerWidth |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8805 |
jQuery.fn["inner" + name] = function() {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8806 |
return this[0] ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8807 |
parseFloat( jQuery.css( this[0], type, "padding" ) ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8808 |
null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8809 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8810 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8811 |
// outerHeight and outerWidth |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8812 |
jQuery.fn["outer" + name] = function( margin ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8813 |
return this[0] ? |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8814 |
parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) : |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8815 |
null; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8816 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8817 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8818 |
jQuery.fn[ type ] = function( size ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8819 |
// Get window width or height |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8820 |
var elem = this[0]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8821 |
if ( !elem ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8822 |
return size == null ? null : this; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8823 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8824 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8825 |
if ( jQuery.isFunction( size ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8826 |
return this.each(function( i ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8827 |
var self = jQuery( this ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8828 |
self[ type ]( size.call( this, i, self[ type ]() ) ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8829 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8830 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8831 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8832 |
if ( jQuery.isWindow( elem ) ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8833 |
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8834 |
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8835 |
var docElemProp = elem.document.documentElement[ "client" + name ]; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8836 |
return elem.document.compatMode === "CSS1Compat" && docElemProp || |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8837 |
elem.document.body[ "client" + name ] || docElemProp; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8838 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8839 |
// Get document width or height |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8840 |
} else if ( elem.nodeType === 9 ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8841 |
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8842 |
return Math.max( |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8843 |
elem.documentElement["client" + name], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8844 |
elem.body["scroll" + name], elem.documentElement["scroll" + name], |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8845 |
elem.body["offset" + name], elem.documentElement["offset" + name] |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8846 |
); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8847 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8848 |
// Get or set width or height on the element |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8849 |
} else if ( size === undefined ) {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8850 |
var orig = jQuery.css( elem, type ), |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8851 |
ret = parseFloat( orig ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8852 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8853 |
return jQuery.isNaN( ret ) ? orig : ret; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8854 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8855 |
// Set the width or height on the element (default to pixels if value is unitless) |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8856 |
} else {
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8857 |
return this.css( type, typeof size === "string" ? size : size + "px" ); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8858 |
} |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8859 |
}; |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8860 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8861 |
}); |
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8862 |
|
|
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8863 |
|
| 101 | 8864 |
window.jQuery = window.$ = jQuery; |
|
69
4775601a2531
use platform and clean install files next
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8865 |
})(window); |