smparkes-envjs 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/envjsrb +157 -73
- data/bin/jquery-1.3.2-test.js +11 -4
- data/lib/envjs/env.js +935 -11028
- data/lib/envjs/net/cgi.rb +94 -0
- data/lib/envjs/net/file.rb +4 -4
- data/lib/envjs/runtime.rb +80 -24
- data/test/call-load-test.js +0 -2
- data/test/firebug/errorIcon.png +0 -0
- data/test/firebug/firebug.css +209 -0
- data/test/firebug/firebug.html +23 -0
- data/test/firebug/firebug.js +672 -0
- data/test/firebug/firebugx.js +10 -0
- data/test/firebug/infoIcon.png +0 -0
- data/test/firebug/warningIcon.png +0 -0
- data/test/fixtures/html/events.html +171 -0
- data/test/fixtures/html/iframe1.html +46 -0
- data/test/fixtures/html/iframe1a.html +46 -0
- data/test/fixtures/html/iframe2.html +45 -0
- data/test/fixtures/html/iframe3.html +28 -0
- data/test/fixtures/html/iframeN.html +57 -0
- data/test/fixtures/html/malformed.html +181 -0
- data/test/fixtures/html/scope.html +81 -0
- data/test/fixtures/html/trivial.html +19 -0
- data/test/fixtures/html/with_js.html +26 -0
- data/test/fixtures/images/icon-blue.png +0 -0
- data/test/fixtures/js/external_script.js +1 -0
- data/test/fixtures/js/script.js +1 -0
- data/test/fixtures/js/script_error.js +2 -0
- data/test/html/malformed.html +1 -0
- data/test/index.html +21 -19
- data/test/{primaryTests.js → primary-tests.js} +1 -3
- data/test/{prototype.js → prototype-test.js} +0 -2
- data/test/qunit/qunit/qunit.css +0 -0
- data/test/qunit/qunit/qunit.js +2 -2
- data/test/{qunit/qunit/qunit.js.smp → specs/dist/env.spec.js} +539 -7
- data/test/specs/envjs.spec.css +46 -0
- data/test/specs/parser/html.js +31 -0
- data/test/specs/parser/spec.html +40 -0
- data/test/specs/parser/xml.js +31 -0
- data/test/specs/qunit.bdd.js +210 -0
- data/test/{qunit.smp/qunit → specs}/qunit.css +0 -0
- data/test/{qunit.smp/qunit → specs}/qunit.js +2 -2
- data/test/specs/template/spec-0.js +31 -0
- data/test/specs/template/spec-1.js +31 -0
- data/test/specs/template/spec.html +40 -0
- data/test/specs/window/css.js +23 -0
- data/test/specs/window/dialog.js +25 -0
- data/test/specs/window/document.js +23 -0
- data/test/specs/window/event.js +25 -0
- data/test/specs/window/history.js +34 -0
- data/test/specs/window/location.js +34 -0
- data/test/specs/window/navigator.js +71 -0
- data/test/specs/window/screen.js +42 -0
- data/test/specs/window/spec.html +48 -0
- data/test/specs/window/timer.js +26 -0
- data/test/specs/window/window.js +53 -0
- data/test/specs/xhr/spec.html +47 -0
- data/test/specs/xhr/xhr.js +31 -0
- data/test/test.js +10 -0
- data/test/unit/elementmembers.js +31 -0
- data/test/unit/nu.validator.js +34 -0
- data/test/unit/onload.js +1 -3
- data/test/unit/parser.js +106 -98
- data/test/unit/prototypecompat.js +2 -2
- data/test/vendor/jQuery/1.3.2/ChangeLog.txt +98 -0
- data/test/vendor/jQuery/1.3.2/GPL-LICENSE.txt +278 -0
- data/test/vendor/jQuery/1.3.2/MIT-LICENSE.txt +20 -0
- data/test/vendor/jQuery/1.3.2/Makefile +154 -0
- data/test/vendor/jQuery/1.3.2/README +67 -0
- data/test/vendor/jQuery/1.3.2/build/ant-contrib-0.6.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build/build/min.js +11 -0
- data/test/vendor/jQuery/1.3.2/build/build/pack.js +19 -0
- data/test/vendor/jQuery/1.3.2/build/js/Packer.js +209 -0
- data/test/vendor/jQuery/1.3.2/build/js/ParseMaster.js +106 -0
- data/test/vendor/jQuery/1.3.2/build/js/Words.js +62 -0
- data/test/vendor/jQuery/1.3.2/build/js/base2.js +978 -0
- data/test/vendor/jQuery/1.3.2/build/js/jsmin.js +316 -0
- data/test/vendor/jQuery/1.3.2/build/js/json.js +117 -0
- data/test/vendor/jQuery/1.3.2/build/js/pack.js +316 -0
- data/test/vendor/jQuery/1.3.2/build/js/parse.js +105 -0
- data/test/vendor/jQuery/1.3.2/build/js/writeFile.js +19 -0
- data/test/vendor/jQuery/1.3.2/build/js/xml.js +25 -0
- data/test/vendor/jQuery/1.3.2/build/js.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/env.js +1 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/test.js +106 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/testrunner.js +197 -0
- data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.css +65 -0
- data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.js +181 -0
- data/test/vendor/jQuery/1.3.2/build/speed/index.html +72 -0
- data/test/vendor/jQuery/1.3.2/build/speed/jquery-basis.js +3549 -0
- data/test/vendor/jQuery/1.3.2/build/style.xsl +99 -0
- data/test/vendor/jQuery/1.3.2/build/yuicompressor-2.4.2.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build.xml +123 -0
- data/test/vendor/jQuery/1.3.2/dist/jquery.js +4376 -0
- data/test/vendor/jQuery/1.3.2/reminder.txt +3 -0
- data/test/vendor/jQuery/1.3.2/src/ajax.js +541 -0
- data/test/vendor/jQuery/1.3.2/src/core.js +1255 -0
- data/test/vendor/jQuery/1.3.2/src/data.js +145 -0
- data/test/vendor/jQuery/1.3.2/src/dimensions.js +49 -0
- data/test/vendor/jQuery/1.3.2/src/event.js +684 -0
- data/test/vendor/jQuery/1.3.2/src/fx.js +407 -0
- data/test/vendor/jQuery/1.3.2/src/intro.js +13 -0
- data/test/vendor/jQuery/1.3.2/src/offset.js +155 -0
- data/test/vendor/jQuery/1.3.2/src/outro.js +1 -0
- data/test/vendor/jQuery/1.3.2/src/selector.js +1015 -0
- data/test/vendor/jQuery/1.3.2/src/support.js +112 -0
- data/test/vendor/jQuery/1.3.2/test/data/cow.jpg +0 -0
- data/test/vendor/jQuery/1.3.2/test/data/dashboard.xml +11 -0
- data/test/vendor/jQuery/1.3.2/test/data/echoQuery.php +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/iframe.html +8 -0
- data/test/vendor/jQuery/1.3.2/test/data/json.php +9 -0
- data/test/vendor/jQuery/1.3.2/test/data/json_assigned_obj.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/json_obj.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/jsonp.php +10 -0
- data/test/vendor/jQuery/1.3.2/test/data/name.html +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/name.php +29 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/absolute.html +39 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/body.html +24 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/fixed.html +33 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/relative.html +31 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/scroll.html +39 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/static.html +31 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/table.html +43 -0
- data/test/vendor/jQuery/1.3.2/test/data/params_html.php +12 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.html +7 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.js +3 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.php +7 -0
- data/test/vendor/jQuery/1.3.2/test/data/test2.html +5 -0
- data/test/vendor/jQuery/1.3.2/test/data/test3.html +3 -0
- data/test/vendor/jQuery/1.3.2/test/data/testrunner.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/text.php +12 -0
- data/test/vendor/jQuery/1.3.2/test/data/with_fries.xml +25 -0
- data/test/vendor/jQuery/1.3.2/test/index.html +229 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259090275493.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259091671501.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259175319655.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/offset.html +28 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/mootools/1.11/mootools.js +1577 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/prototype/1.6.0.2/prototype.js +4221 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/builder.js +131 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/controls.js +835 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/dragdrop.js +944 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/effects.js +1090 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/scriptaculous.js +51 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/slider.js +278 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/unittest.js +564 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/builder.js +136 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/controls.js +965 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/dragdrop.js +974 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/effects.js +1122 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/scriptaculous.js +58 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/slider.js +275 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/sound.js +55 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/unittest.js +568 -0
- data/test/vendor/jQuery/1.3.2/test/polluted.php +64 -0
- data/test/vendor/jQuery/1.3.2/test/qunit/testrunner.js +780 -0
- data/test/vendor/jQuery/1.3.2/test/qunit/testsuite.css +120 -0
- data/test/vendor/jQuery/1.3.2/test/test.js +41 -0
- data/test/vendor/jQuery/1.3.2/test/unit/ajax.js +856 -0
- data/test/vendor/jQuery/1.3.2/test/unit/core.js +1872 -0
- data/test/vendor/jQuery/1.3.2/test/unit/data.js +160 -0
- data/test/vendor/jQuery/1.3.2/test/unit/dimensions.js +86 -0
- data/test/vendor/jQuery/1.3.2/test/unit/event.js +670 -0
- data/test/vendor/jQuery/1.3.2/test/unit/fx.js +451 -0
- data/test/vendor/jQuery/1.3.2/test/unit/offset.js +173 -0
- data/test/vendor/jQuery/1.3.2/test/unit/selector.js +395 -0
- data/test/vendor/jQuery/1.3.2/test/xhtml.php +5 -0
- data/test/vendor/jQuery/1.3.2/version.txt +1 -0
- metadata +158 -22
- data/lib/envjs/runtime.rb.smp +0 -133
- data/test/envjs-call-load-test.js +0 -5
- data/test/envjs-prototype.js +0 -5
- data/test/qunit/package.json +0 -21
- data/test/qunit/test/index.html +0 -17
- data/test/qunit/test/same.js +0 -1368
- data/test/qunit/test/test.js +0 -136
- data/test/qunit.smp/package.json +0 -21
- data/test/qunit.smp/test/index.html +0 -17
- data/test/qunit.smp/test/same.js +0 -1368
- data/test/qunit.smp/test/test.js +0 -136
- data/test/rhino-call-load-test.js +0 -5
- data/test/rhino-prototype.js +0 -5
- data/test/test-with-envs-jar.js +0 -8
- data/test/test-with-rhino-jar.js +0 -9
@@ -0,0 +1,1015 @@
|
|
1
|
+
/*!
|
2
|
+
* Sizzle CSS Selector Engine - v0.9.3
|
3
|
+
* Copyright 2009, The Dojo Foundation
|
4
|
+
* Released under the MIT, BSD, and GPL Licenses.
|
5
|
+
* More information: http://sizzlejs.com/
|
6
|
+
*/
|
7
|
+
(function(){
|
8
|
+
|
9
|
+
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
|
10
|
+
done = 0,
|
11
|
+
toString = Object.prototype.toString;
|
12
|
+
|
13
|
+
var Sizzle = function(selector, context, results, seed) {
|
14
|
+
results = results || [];
|
15
|
+
context = context || document;
|
16
|
+
|
17
|
+
if ( context.nodeType !== 1 && context.nodeType !== 9 )
|
18
|
+
return [];
|
19
|
+
|
20
|
+
if ( !selector || typeof selector !== "string" ) {
|
21
|
+
return results;
|
22
|
+
}
|
23
|
+
|
24
|
+
var parts = [], m, set, checkSet, check, mode, extra, prune = true;
|
25
|
+
|
26
|
+
// Reset the position of the chunker regexp (start from head)
|
27
|
+
chunker.lastIndex = 0;
|
28
|
+
|
29
|
+
while ( (m = chunker.exec(selector)) !== null ) {
|
30
|
+
parts.push( m[1] );
|
31
|
+
|
32
|
+
if ( m[2] ) {
|
33
|
+
extra = RegExp.rightContext;
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
if ( parts.length > 1 && origPOS.exec( selector ) ) {
|
39
|
+
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
|
40
|
+
set = posProcess( parts[0] + parts[1], context );
|
41
|
+
} else {
|
42
|
+
set = Expr.relative[ parts[0] ] ?
|
43
|
+
[ context ] :
|
44
|
+
Sizzle( parts.shift(), context );
|
45
|
+
|
46
|
+
while ( parts.length ) {
|
47
|
+
selector = parts.shift();
|
48
|
+
|
49
|
+
if ( Expr.relative[ selector ] )
|
50
|
+
selector += parts.shift();
|
51
|
+
|
52
|
+
set = posProcess( selector, set );
|
53
|
+
}
|
54
|
+
}
|
55
|
+
} else {
|
56
|
+
var ret = seed ?
|
57
|
+
{ expr: parts.pop(), set: makeArray(seed) } :
|
58
|
+
Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
|
59
|
+
set = Sizzle.filter( ret.expr, ret.set );
|
60
|
+
|
61
|
+
if ( parts.length > 0 ) {
|
62
|
+
checkSet = makeArray(set);
|
63
|
+
} else {
|
64
|
+
prune = false;
|
65
|
+
}
|
66
|
+
|
67
|
+
while ( parts.length ) {
|
68
|
+
var cur = parts.pop(), pop = cur;
|
69
|
+
|
70
|
+
if ( !Expr.relative[ cur ] ) {
|
71
|
+
cur = "";
|
72
|
+
} else {
|
73
|
+
pop = parts.pop();
|
74
|
+
}
|
75
|
+
|
76
|
+
if ( pop == null ) {
|
77
|
+
pop = context;
|
78
|
+
}
|
79
|
+
|
80
|
+
Expr.relative[ cur ]( checkSet, pop, isXML(context) );
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
if ( !checkSet ) {
|
85
|
+
checkSet = set;
|
86
|
+
}
|
87
|
+
|
88
|
+
if ( !checkSet ) {
|
89
|
+
throw "Syntax error, unrecognized expression: " + (cur || selector);
|
90
|
+
}
|
91
|
+
|
92
|
+
if ( toString.call(checkSet) === "[object Array]" ) {
|
93
|
+
if ( !prune ) {
|
94
|
+
results.push.apply( results, checkSet );
|
95
|
+
} else if ( context.nodeType === 1 ) {
|
96
|
+
for ( var i = 0; checkSet[i] != null; i++ ) {
|
97
|
+
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
|
98
|
+
results.push( set[i] );
|
99
|
+
}
|
100
|
+
}
|
101
|
+
} else {
|
102
|
+
for ( var i = 0; checkSet[i] != null; i++ ) {
|
103
|
+
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
|
104
|
+
results.push( set[i] );
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
} else {
|
109
|
+
makeArray( checkSet, results );
|
110
|
+
}
|
111
|
+
|
112
|
+
if ( extra ) {
|
113
|
+
Sizzle( extra, context, results, seed );
|
114
|
+
|
115
|
+
if ( sortOrder ) {
|
116
|
+
hasDuplicate = false;
|
117
|
+
results.sort(sortOrder);
|
118
|
+
|
119
|
+
if ( hasDuplicate ) {
|
120
|
+
for ( var i = 1; i < results.length; i++ ) {
|
121
|
+
if ( results[i] === results[i-1] ) {
|
122
|
+
results.splice(i--, 1);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
return results;
|
130
|
+
};
|
131
|
+
|
132
|
+
Sizzle.matches = function(expr, set){
|
133
|
+
return Sizzle(expr, null, null, set);
|
134
|
+
};
|
135
|
+
|
136
|
+
Sizzle.find = function(expr, context, isXML){
|
137
|
+
var set, match;
|
138
|
+
|
139
|
+
if ( !expr ) {
|
140
|
+
return [];
|
141
|
+
}
|
142
|
+
|
143
|
+
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
|
144
|
+
var type = Expr.order[i], match;
|
145
|
+
|
146
|
+
if ( (match = Expr.match[ type ].exec( expr )) ) {
|
147
|
+
var left = RegExp.leftContext;
|
148
|
+
|
149
|
+
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
150
|
+
match[1] = (match[1] || "").replace(/\\/g, "");
|
151
|
+
set = Expr.find[ type ]( match, context, isXML );
|
152
|
+
if ( set != null ) {
|
153
|
+
expr = expr.replace( Expr.match[ type ], "" );
|
154
|
+
break;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
if ( !set ) {
|
161
|
+
set = context.getElementsByTagName("*");
|
162
|
+
}
|
163
|
+
|
164
|
+
return {set: set, expr: expr};
|
165
|
+
};
|
166
|
+
|
167
|
+
Sizzle.filter = function(expr, set, inplace, not){
|
168
|
+
var old = expr, result = [], curLoop = set, match, anyFound,
|
169
|
+
isXMLFilter = set && set[0] && isXML(set[0]);
|
170
|
+
|
171
|
+
while ( expr && set.length ) {
|
172
|
+
for ( var type in Expr.filter ) {
|
173
|
+
if ( (match = Expr.match[ type ].exec( expr )) != null ) {
|
174
|
+
var filter = Expr.filter[ type ], found, item;
|
175
|
+
anyFound = false;
|
176
|
+
|
177
|
+
if ( curLoop == result ) {
|
178
|
+
result = [];
|
179
|
+
}
|
180
|
+
|
181
|
+
if ( Expr.preFilter[ type ] ) {
|
182
|
+
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
|
183
|
+
|
184
|
+
if ( !match ) {
|
185
|
+
anyFound = found = true;
|
186
|
+
} else if ( match === true ) {
|
187
|
+
continue;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
if ( match ) {
|
192
|
+
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
|
193
|
+
if ( item ) {
|
194
|
+
found = filter( item, match, i, curLoop );
|
195
|
+
var pass = not ^ !!found;
|
196
|
+
|
197
|
+
if ( inplace && found != null ) {
|
198
|
+
if ( pass ) {
|
199
|
+
anyFound = true;
|
200
|
+
} else {
|
201
|
+
curLoop[i] = false;
|
202
|
+
}
|
203
|
+
} else if ( pass ) {
|
204
|
+
result.push( item );
|
205
|
+
anyFound = true;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
if ( found !== undefined ) {
|
212
|
+
if ( !inplace ) {
|
213
|
+
curLoop = result;
|
214
|
+
}
|
215
|
+
|
216
|
+
expr = expr.replace( Expr.match[ type ], "" );
|
217
|
+
|
218
|
+
if ( !anyFound ) {
|
219
|
+
return [];
|
220
|
+
}
|
221
|
+
|
222
|
+
break;
|
223
|
+
}
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
// Improper expression
|
228
|
+
if ( expr == old ) {
|
229
|
+
if ( anyFound == null ) {
|
230
|
+
throw "Syntax error, unrecognized expression: " + expr;
|
231
|
+
} else {
|
232
|
+
break;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
old = expr;
|
237
|
+
}
|
238
|
+
|
239
|
+
return curLoop;
|
240
|
+
};
|
241
|
+
|
242
|
+
var Expr = Sizzle.selectors = {
|
243
|
+
order: [ "ID", "NAME", "TAG" ],
|
244
|
+
match: {
|
245
|
+
ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
|
246
|
+
CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
|
247
|
+
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
|
248
|
+
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
|
249
|
+
TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
|
250
|
+
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
|
251
|
+
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
|
252
|
+
PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
|
253
|
+
},
|
254
|
+
attrMap: {
|
255
|
+
"class": "className",
|
256
|
+
"for": "htmlFor"
|
257
|
+
},
|
258
|
+
attrHandle: {
|
259
|
+
href: function(elem){
|
260
|
+
return elem.getAttribute("href");
|
261
|
+
}
|
262
|
+
},
|
263
|
+
relative: {
|
264
|
+
"+": function(checkSet, part, isXML){
|
265
|
+
var isPartStr = typeof part === "string",
|
266
|
+
isTag = isPartStr && !/\W/.test(part),
|
267
|
+
isPartStrNotTag = isPartStr && !isTag;
|
268
|
+
|
269
|
+
if ( isTag && !isXML ) {
|
270
|
+
part = part.toUpperCase();
|
271
|
+
}
|
272
|
+
|
273
|
+
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
|
274
|
+
if ( (elem = checkSet[i]) ) {
|
275
|
+
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
|
276
|
+
|
277
|
+
checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
|
278
|
+
elem || false :
|
279
|
+
elem === part;
|
280
|
+
}
|
281
|
+
}
|
282
|
+
|
283
|
+
if ( isPartStrNotTag ) {
|
284
|
+
Sizzle.filter( part, checkSet, true );
|
285
|
+
}
|
286
|
+
},
|
287
|
+
">": function(checkSet, part, isXML){
|
288
|
+
var isPartStr = typeof part === "string";
|
289
|
+
|
290
|
+
if ( isPartStr && !/\W/.test(part) ) {
|
291
|
+
part = isXML ? part : part.toUpperCase();
|
292
|
+
|
293
|
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
294
|
+
var elem = checkSet[i];
|
295
|
+
if ( elem ) {
|
296
|
+
var parent = elem.parentNode;
|
297
|
+
checkSet[i] = parent.nodeName === part ? parent : false;
|
298
|
+
}
|
299
|
+
}
|
300
|
+
} else {
|
301
|
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
302
|
+
var elem = checkSet[i];
|
303
|
+
if ( elem ) {
|
304
|
+
checkSet[i] = isPartStr ?
|
305
|
+
elem.parentNode :
|
306
|
+
elem.parentNode === part;
|
307
|
+
}
|
308
|
+
}
|
309
|
+
|
310
|
+
if ( isPartStr ) {
|
311
|
+
Sizzle.filter( part, checkSet, true );
|
312
|
+
}
|
313
|
+
}
|
314
|
+
},
|
315
|
+
"": function(checkSet, part, isXML){
|
316
|
+
var doneName = done++, checkFn = dirCheck;
|
317
|
+
|
318
|
+
if ( !part.match(/\W/) ) {
|
319
|
+
var nodeCheck = part = isXML ? part : part.toUpperCase();
|
320
|
+
checkFn = dirNodeCheck;
|
321
|
+
}
|
322
|
+
|
323
|
+
checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
|
324
|
+
},
|
325
|
+
"~": function(checkSet, part, isXML){
|
326
|
+
var doneName = done++, checkFn = dirCheck;
|
327
|
+
|
328
|
+
if ( typeof part === "string" && !part.match(/\W/) ) {
|
329
|
+
var nodeCheck = part = isXML ? part : part.toUpperCase();
|
330
|
+
checkFn = dirNodeCheck;
|
331
|
+
}
|
332
|
+
|
333
|
+
checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
|
334
|
+
}
|
335
|
+
},
|
336
|
+
find: {
|
337
|
+
ID: function(match, context, isXML){
|
338
|
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
339
|
+
var m = context.getElementById(match[1]);
|
340
|
+
return m ? [m] : [];
|
341
|
+
}
|
342
|
+
},
|
343
|
+
NAME: function(match, context, isXML){
|
344
|
+
if ( typeof context.getElementsByName !== "undefined" ) {
|
345
|
+
var ret = [], results = context.getElementsByName(match[1]);
|
346
|
+
|
347
|
+
for ( var i = 0, l = results.length; i < l; i++ ) {
|
348
|
+
if ( results[i].getAttribute("name") === match[1] ) {
|
349
|
+
ret.push( results[i] );
|
350
|
+
}
|
351
|
+
}
|
352
|
+
|
353
|
+
return ret.length === 0 ? null : ret;
|
354
|
+
}
|
355
|
+
},
|
356
|
+
TAG: function(match, context){
|
357
|
+
return context.getElementsByTagName(match[1]);
|
358
|
+
}
|
359
|
+
},
|
360
|
+
preFilter: {
|
361
|
+
CLASS: function(match, curLoop, inplace, result, not, isXML){
|
362
|
+
match = " " + match[1].replace(/\\/g, "") + " ";
|
363
|
+
|
364
|
+
if ( isXML ) {
|
365
|
+
return match;
|
366
|
+
}
|
367
|
+
|
368
|
+
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
|
369
|
+
if ( elem ) {
|
370
|
+
if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
|
371
|
+
if ( !inplace )
|
372
|
+
result.push( elem );
|
373
|
+
} else if ( inplace ) {
|
374
|
+
curLoop[i] = false;
|
375
|
+
}
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
return false;
|
380
|
+
},
|
381
|
+
ID: function(match){
|
382
|
+
return match[1].replace(/\\/g, "");
|
383
|
+
},
|
384
|
+
TAG: function(match, curLoop){
|
385
|
+
for ( var i = 0; curLoop[i] === false; i++ ){}
|
386
|
+
return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
|
387
|
+
},
|
388
|
+
CHILD: function(match){
|
389
|
+
if ( match[1] == "nth" ) {
|
390
|
+
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
|
391
|
+
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
|
392
|
+
match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
|
393
|
+
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
|
394
|
+
|
395
|
+
// calculate the numbers (first)n+(last) including if they are negative
|
396
|
+
match[2] = (test[1] + (test[2] || 1)) - 0;
|
397
|
+
match[3] = test[3] - 0;
|
398
|
+
}
|
399
|
+
|
400
|
+
// TODO: Move to normal caching system
|
401
|
+
match[0] = done++;
|
402
|
+
|
403
|
+
return match;
|
404
|
+
},
|
405
|
+
ATTR: function(match, curLoop, inplace, result, not, isXML){
|
406
|
+
var name = match[1].replace(/\\/g, "");
|
407
|
+
|
408
|
+
if ( !isXML && Expr.attrMap[name] ) {
|
409
|
+
match[1] = Expr.attrMap[name];
|
410
|
+
}
|
411
|
+
|
412
|
+
if ( match[2] === "~=" ) {
|
413
|
+
match[4] = " " + match[4] + " ";
|
414
|
+
}
|
415
|
+
|
416
|
+
return match;
|
417
|
+
},
|
418
|
+
PSEUDO: function(match, curLoop, inplace, result, not){
|
419
|
+
if ( match[1] === "not" ) {
|
420
|
+
// If we're dealing with a complex expression, or a simple one
|
421
|
+
if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
|
422
|
+
match[3] = Sizzle(match[3], null, null, curLoop);
|
423
|
+
} else {
|
424
|
+
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
|
425
|
+
if ( !inplace ) {
|
426
|
+
result.push.apply( result, ret );
|
427
|
+
}
|
428
|
+
return false;
|
429
|
+
}
|
430
|
+
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
|
431
|
+
return true;
|
432
|
+
}
|
433
|
+
|
434
|
+
return match;
|
435
|
+
},
|
436
|
+
POS: function(match){
|
437
|
+
match.unshift( true );
|
438
|
+
return match;
|
439
|
+
}
|
440
|
+
},
|
441
|
+
filters: {
|
442
|
+
enabled: function(elem){
|
443
|
+
return elem.disabled === false && elem.type !== "hidden";
|
444
|
+
},
|
445
|
+
disabled: function(elem){
|
446
|
+
return elem.disabled === true;
|
447
|
+
},
|
448
|
+
checked: function(elem){
|
449
|
+
return elem.checked === true;
|
450
|
+
},
|
451
|
+
selected: function(elem){
|
452
|
+
// Accessing this property makes selected-by-default
|
453
|
+
// options in Safari work properly
|
454
|
+
elem.parentNode.selectedIndex;
|
455
|
+
return elem.selected === true;
|
456
|
+
},
|
457
|
+
parent: function(elem){
|
458
|
+
return !!elem.firstChild;
|
459
|
+
},
|
460
|
+
empty: function(elem){
|
461
|
+
return !elem.firstChild;
|
462
|
+
},
|
463
|
+
has: function(elem, i, match){
|
464
|
+
return !!Sizzle( match[3], elem ).length;
|
465
|
+
},
|
466
|
+
header: function(elem){
|
467
|
+
return /h\d/i.test( elem.nodeName );
|
468
|
+
},
|
469
|
+
text: function(elem){
|
470
|
+
return "text" === elem.type;
|
471
|
+
},
|
472
|
+
radio: function(elem){
|
473
|
+
return "radio" === elem.type;
|
474
|
+
},
|
475
|
+
checkbox: function(elem){
|
476
|
+
return "checkbox" === elem.type;
|
477
|
+
},
|
478
|
+
file: function(elem){
|
479
|
+
return "file" === elem.type;
|
480
|
+
},
|
481
|
+
password: function(elem){
|
482
|
+
return "password" === elem.type;
|
483
|
+
},
|
484
|
+
submit: function(elem){
|
485
|
+
return "submit" === elem.type;
|
486
|
+
},
|
487
|
+
image: function(elem){
|
488
|
+
return "image" === elem.type;
|
489
|
+
},
|
490
|
+
reset: function(elem){
|
491
|
+
return "reset" === elem.type;
|
492
|
+
},
|
493
|
+
button: function(elem){
|
494
|
+
return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
|
495
|
+
},
|
496
|
+
input: function(elem){
|
497
|
+
return /input|select|textarea|button/i.test(elem.nodeName);
|
498
|
+
}
|
499
|
+
},
|
500
|
+
setFilters: {
|
501
|
+
first: function(elem, i){
|
502
|
+
return i === 0;
|
503
|
+
},
|
504
|
+
last: function(elem, i, match, array){
|
505
|
+
return i === array.length - 1;
|
506
|
+
},
|
507
|
+
even: function(elem, i){
|
508
|
+
return i % 2 === 0;
|
509
|
+
},
|
510
|
+
odd: function(elem, i){
|
511
|
+
return i % 2 === 1;
|
512
|
+
},
|
513
|
+
lt: function(elem, i, match){
|
514
|
+
return i < match[3] - 0;
|
515
|
+
},
|
516
|
+
gt: function(elem, i, match){
|
517
|
+
return i > match[3] - 0;
|
518
|
+
},
|
519
|
+
nth: function(elem, i, match){
|
520
|
+
return match[3] - 0 == i;
|
521
|
+
},
|
522
|
+
eq: function(elem, i, match){
|
523
|
+
return match[3] - 0 == i;
|
524
|
+
}
|
525
|
+
},
|
526
|
+
filter: {
|
527
|
+
PSEUDO: function(elem, match, i, array){
|
528
|
+
var name = match[1], filter = Expr.filters[ name ];
|
529
|
+
|
530
|
+
if ( filter ) {
|
531
|
+
return filter( elem, i, match, array );
|
532
|
+
} else if ( name === "contains" ) {
|
533
|
+
return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
|
534
|
+
} else if ( name === "not" ) {
|
535
|
+
var not = match[3];
|
536
|
+
|
537
|
+
for ( var i = 0, l = not.length; i < l; i++ ) {
|
538
|
+
if ( not[i] === elem ) {
|
539
|
+
return false;
|
540
|
+
}
|
541
|
+
}
|
542
|
+
|
543
|
+
return true;
|
544
|
+
}
|
545
|
+
},
|
546
|
+
CHILD: function(elem, match){
|
547
|
+
var type = match[1], node = elem;
|
548
|
+
switch (type) {
|
549
|
+
case 'only':
|
550
|
+
case 'first':
|
551
|
+
while (node = node.previousSibling) {
|
552
|
+
if ( node.nodeType === 1 ) return false;
|
553
|
+
}
|
554
|
+
if ( type == 'first') return true;
|
555
|
+
node = elem;
|
556
|
+
case 'last':
|
557
|
+
while (node = node.nextSibling) {
|
558
|
+
if ( node.nodeType === 1 ) return false;
|
559
|
+
}
|
560
|
+
return true;
|
561
|
+
case 'nth':
|
562
|
+
var first = match[2], last = match[3];
|
563
|
+
|
564
|
+
if ( first == 1 && last == 0 ) {
|
565
|
+
return true;
|
566
|
+
}
|
567
|
+
|
568
|
+
var doneName = match[0],
|
569
|
+
parent = elem.parentNode;
|
570
|
+
|
571
|
+
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
|
572
|
+
var count = 0;
|
573
|
+
for ( node = parent.firstChild; node; node = node.nextSibling ) {
|
574
|
+
if ( node.nodeType === 1 ) {
|
575
|
+
node.nodeIndex = ++count;
|
576
|
+
}
|
577
|
+
}
|
578
|
+
parent.sizcache = doneName;
|
579
|
+
}
|
580
|
+
|
581
|
+
var diff = elem.nodeIndex - last;
|
582
|
+
if ( first == 0 ) {
|
583
|
+
return diff == 0;
|
584
|
+
} else {
|
585
|
+
return ( diff % first == 0 && diff / first >= 0 );
|
586
|
+
}
|
587
|
+
}
|
588
|
+
},
|
589
|
+
ID: function(elem, match){
|
590
|
+
return elem.nodeType === 1 && elem.getAttribute("id") === match;
|
591
|
+
},
|
592
|
+
TAG: function(elem, match){
|
593
|
+
return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
|
594
|
+
},
|
595
|
+
CLASS: function(elem, match){
|
596
|
+
return (" " + (elem.className || elem.getAttribute("class")) + " ")
|
597
|
+
.indexOf( match ) > -1;
|
598
|
+
},
|
599
|
+
ATTR: function(elem, match){
|
600
|
+
var name = match[1],
|
601
|
+
result = Expr.attrHandle[ name ] ?
|
602
|
+
Expr.attrHandle[ name ]( elem ) :
|
603
|
+
elem[ name ] != null ?
|
604
|
+
elem[ name ] :
|
605
|
+
elem.getAttribute( name ),
|
606
|
+
value = result + "",
|
607
|
+
type = match[2],
|
608
|
+
check = match[4];
|
609
|
+
|
610
|
+
return result == null ?
|
611
|
+
type === "!=" :
|
612
|
+
type === "=" ?
|
613
|
+
value === check :
|
614
|
+
type === "*=" ?
|
615
|
+
value.indexOf(check) >= 0 :
|
616
|
+
type === "~=" ?
|
617
|
+
(" " + value + " ").indexOf(check) >= 0 :
|
618
|
+
!check ?
|
619
|
+
value && result !== false :
|
620
|
+
type === "!=" ?
|
621
|
+
value != check :
|
622
|
+
type === "^=" ?
|
623
|
+
value.indexOf(check) === 0 :
|
624
|
+
type === "$=" ?
|
625
|
+
value.substr(value.length - check.length) === check :
|
626
|
+
type === "|=" ?
|
627
|
+
value === check || value.substr(0, check.length + 1) === check + "-" :
|
628
|
+
false;
|
629
|
+
},
|
630
|
+
POS: function(elem, match, i, array){
|
631
|
+
var name = match[2], filter = Expr.setFilters[ name ];
|
632
|
+
|
633
|
+
if ( filter ) {
|
634
|
+
return filter( elem, i, match, array );
|
635
|
+
}
|
636
|
+
}
|
637
|
+
}
|
638
|
+
};
|
639
|
+
|
640
|
+
var origPOS = Expr.match.POS;
|
641
|
+
|
642
|
+
for ( var type in Expr.match ) {
|
643
|
+
Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
|
644
|
+
}
|
645
|
+
|
646
|
+
var makeArray = function(array, results) {
|
647
|
+
array = Array.prototype.slice.call( array );
|
648
|
+
|
649
|
+
if ( results ) {
|
650
|
+
results.push.apply( results, array );
|
651
|
+
return results;
|
652
|
+
}
|
653
|
+
|
654
|
+
return array;
|
655
|
+
};
|
656
|
+
|
657
|
+
// Perform a simple check to determine if the browser is capable of
|
658
|
+
// converting a NodeList to an array using builtin methods.
|
659
|
+
try {
|
660
|
+
Array.prototype.slice.call( document.documentElement.childNodes );
|
661
|
+
|
662
|
+
// Provide a fallback method if it does not work
|
663
|
+
} catch(e){
|
664
|
+
makeArray = function(array, results) {
|
665
|
+
var ret = results || [];
|
666
|
+
|
667
|
+
if ( toString.call(array) === "[object Array]" ) {
|
668
|
+
Array.prototype.push.apply( ret, array );
|
669
|
+
} else {
|
670
|
+
if ( typeof array.length === "number" ) {
|
671
|
+
for ( var i = 0, l = array.length; i < l; i++ ) {
|
672
|
+
ret.push( array[i] );
|
673
|
+
}
|
674
|
+
} else {
|
675
|
+
for ( var i = 0; array[i]; i++ ) {
|
676
|
+
ret.push( array[i] );
|
677
|
+
}
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
return ret;
|
682
|
+
};
|
683
|
+
}
|
684
|
+
|
685
|
+
var sortOrder;
|
686
|
+
|
687
|
+
if ( document.documentElement.compareDocumentPosition ) {
|
688
|
+
sortOrder = function( a, b ) {
|
689
|
+
var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
|
690
|
+
if ( ret === 0 ) {
|
691
|
+
hasDuplicate = true;
|
692
|
+
}
|
693
|
+
return ret;
|
694
|
+
};
|
695
|
+
} else if ( "sourceIndex" in document.documentElement ) {
|
696
|
+
sortOrder = function( a, b ) {
|
697
|
+
var ret = a.sourceIndex - b.sourceIndex;
|
698
|
+
if ( ret === 0 ) {
|
699
|
+
hasDuplicate = true;
|
700
|
+
}
|
701
|
+
return ret;
|
702
|
+
};
|
703
|
+
} else if ( document.createRange ) {
|
704
|
+
sortOrder = function( a, b ) {
|
705
|
+
var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
|
706
|
+
aRange.selectNode(a);
|
707
|
+
aRange.collapse(true);
|
708
|
+
bRange.selectNode(b);
|
709
|
+
bRange.collapse(true);
|
710
|
+
var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
|
711
|
+
if ( ret === 0 ) {
|
712
|
+
hasDuplicate = true;
|
713
|
+
}
|
714
|
+
return ret;
|
715
|
+
};
|
716
|
+
}
|
717
|
+
|
718
|
+
// Check to see if the browser returns elements by name when
|
719
|
+
// querying by getElementById (and provide a workaround)
|
720
|
+
(function(){
|
721
|
+
// We're going to inject a fake input element with a specified name
|
722
|
+
var form = document.createElement("form"),
|
723
|
+
id = "script" + (new Date).getTime();
|
724
|
+
form.innerHTML = "<input name='" + id + "'/>";
|
725
|
+
|
726
|
+
// Inject it into the root element, check its status, and remove it quickly
|
727
|
+
var root = document.documentElement;
|
728
|
+
root.insertBefore( form, root.firstChild );
|
729
|
+
|
730
|
+
// The workaround has to do additional checks after a getElementById
|
731
|
+
// Which slows things down for other browsers (hence the branching)
|
732
|
+
if ( !!document.getElementById( id ) ) {
|
733
|
+
Expr.find.ID = function(match, context, isXML){
|
734
|
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
735
|
+
var m = context.getElementById(match[1]);
|
736
|
+
return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
|
737
|
+
}
|
738
|
+
};
|
739
|
+
|
740
|
+
Expr.filter.ID = function(elem, match){
|
741
|
+
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
|
742
|
+
return elem.nodeType === 1 && node && node.nodeValue === match;
|
743
|
+
};
|
744
|
+
}
|
745
|
+
|
746
|
+
root.removeChild( form );
|
747
|
+
})();
|
748
|
+
|
749
|
+
(function(){
|
750
|
+
// Check to see if the browser returns only elements
|
751
|
+
// when doing getElementsByTagName("*")
|
752
|
+
|
753
|
+
// Create a fake element
|
754
|
+
var div = document.createElement("div");
|
755
|
+
div.appendChild( document.createComment("") );
|
756
|
+
|
757
|
+
// Make sure no comments are found
|
758
|
+
if ( div.getElementsByTagName("*").length > 0 ) {
|
759
|
+
Expr.find.TAG = function(match, context){
|
760
|
+
var results = context.getElementsByTagName(match[1]);
|
761
|
+
|
762
|
+
// Filter out possible comments
|
763
|
+
if ( match[1] === "*" ) {
|
764
|
+
var tmp = [];
|
765
|
+
|
766
|
+
for ( var i = 0; results[i]; i++ ) {
|
767
|
+
if ( results[i].nodeType === 1 ) {
|
768
|
+
tmp.push( results[i] );
|
769
|
+
}
|
770
|
+
}
|
771
|
+
|
772
|
+
results = tmp;
|
773
|
+
}
|
774
|
+
|
775
|
+
return results;
|
776
|
+
};
|
777
|
+
}
|
778
|
+
|
779
|
+
// Check to see if an attribute returns normalized href attributes
|
780
|
+
div.innerHTML = "<a href='#'></a>";
|
781
|
+
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
|
782
|
+
div.firstChild.getAttribute("href") !== "#" ) {
|
783
|
+
Expr.attrHandle.href = function(elem){
|
784
|
+
return elem.getAttribute("href", 2);
|
785
|
+
};
|
786
|
+
}
|
787
|
+
})();
|
788
|
+
|
789
|
+
if ( document.querySelectorAll ) (function(){
|
790
|
+
var oldSizzle = Sizzle, div = document.createElement("div");
|
791
|
+
div.innerHTML = "<p class='TEST'></p>";
|
792
|
+
|
793
|
+
// Safari can't handle uppercase or unicode characters when
|
794
|
+
// in quirks mode.
|
795
|
+
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
|
796
|
+
return;
|
797
|
+
}
|
798
|
+
|
799
|
+
Sizzle = function(query, context, extra, seed){
|
800
|
+
context = context || document;
|
801
|
+
|
802
|
+
// Only use querySelectorAll on non-XML documents
|
803
|
+
// (ID selectors don't work in non-HTML documents)
|
804
|
+
if ( !seed && context.nodeType === 9 && !isXML(context) ) {
|
805
|
+
try {
|
806
|
+
return makeArray( context.querySelectorAll(query), extra );
|
807
|
+
} catch(e){}
|
808
|
+
}
|
809
|
+
|
810
|
+
return oldSizzle(query, context, extra, seed);
|
811
|
+
};
|
812
|
+
|
813
|
+
Sizzle.find = oldSizzle.find;
|
814
|
+
Sizzle.filter = oldSizzle.filter;
|
815
|
+
Sizzle.selectors = oldSizzle.selectors;
|
816
|
+
Sizzle.matches = oldSizzle.matches;
|
817
|
+
})();
|
818
|
+
|
819
|
+
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
|
820
|
+
var div = document.createElement("div");
|
821
|
+
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
|
822
|
+
|
823
|
+
// Opera can't find a second classname (in 9.6)
|
824
|
+
if ( div.getElementsByClassName("e").length === 0 )
|
825
|
+
return;
|
826
|
+
|
827
|
+
// Safari caches class attributes, doesn't catch changes (in 3.2)
|
828
|
+
div.lastChild.className = "e";
|
829
|
+
|
830
|
+
if ( div.getElementsByClassName("e").length === 1 )
|
831
|
+
return;
|
832
|
+
|
833
|
+
Expr.order.splice(1, 0, "CLASS");
|
834
|
+
Expr.find.CLASS = function(match, context, isXML) {
|
835
|
+
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
|
836
|
+
return context.getElementsByClassName(match[1]);
|
837
|
+
}
|
838
|
+
};
|
839
|
+
})();
|
840
|
+
|
841
|
+
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
842
|
+
var sibDir = dir == "previousSibling" && !isXML;
|
843
|
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
844
|
+
var elem = checkSet[i];
|
845
|
+
if ( elem ) {
|
846
|
+
if ( sibDir && elem.nodeType === 1 ){
|
847
|
+
elem.sizcache = doneName;
|
848
|
+
elem.sizset = i;
|
849
|
+
}
|
850
|
+
elem = elem[dir];
|
851
|
+
var match = false;
|
852
|
+
|
853
|
+
while ( elem ) {
|
854
|
+
if ( elem.sizcache === doneName ) {
|
855
|
+
match = checkSet[elem.sizset];
|
856
|
+
break;
|
857
|
+
}
|
858
|
+
|
859
|
+
if ( elem.nodeType === 1 && !isXML ){
|
860
|
+
elem.sizcache = doneName;
|
861
|
+
elem.sizset = i;
|
862
|
+
}
|
863
|
+
|
864
|
+
if ( elem.nodeName === cur ) {
|
865
|
+
match = elem;
|
866
|
+
break;
|
867
|
+
}
|
868
|
+
|
869
|
+
elem = elem[dir];
|
870
|
+
}
|
871
|
+
|
872
|
+
checkSet[i] = match;
|
873
|
+
}
|
874
|
+
}
|
875
|
+
}
|
876
|
+
|
877
|
+
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
878
|
+
var sibDir = dir == "previousSibling" && !isXML;
|
879
|
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
880
|
+
var elem = checkSet[i];
|
881
|
+
if ( elem ) {
|
882
|
+
if ( sibDir && elem.nodeType === 1 ) {
|
883
|
+
elem.sizcache = doneName;
|
884
|
+
elem.sizset = i;
|
885
|
+
}
|
886
|
+
elem = elem[dir];
|
887
|
+
var match = false;
|
888
|
+
|
889
|
+
while ( elem ) {
|
890
|
+
if ( elem.sizcache === doneName ) {
|
891
|
+
match = checkSet[elem.sizset];
|
892
|
+
break;
|
893
|
+
}
|
894
|
+
|
895
|
+
if ( elem.nodeType === 1 ) {
|
896
|
+
if ( !isXML ) {
|
897
|
+
elem.sizcache = doneName;
|
898
|
+
elem.sizset = i;
|
899
|
+
}
|
900
|
+
if ( typeof cur !== "string" ) {
|
901
|
+
if ( elem === cur ) {
|
902
|
+
match = true;
|
903
|
+
break;
|
904
|
+
}
|
905
|
+
|
906
|
+
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
|
907
|
+
match = elem;
|
908
|
+
break;
|
909
|
+
}
|
910
|
+
}
|
911
|
+
|
912
|
+
elem = elem[dir];
|
913
|
+
}
|
914
|
+
|
915
|
+
checkSet[i] = match;
|
916
|
+
}
|
917
|
+
}
|
918
|
+
}
|
919
|
+
|
920
|
+
var contains = document.compareDocumentPosition ? function(a, b){
|
921
|
+
return a.compareDocumentPosition(b) & 16;
|
922
|
+
} : function(a, b){
|
923
|
+
return a !== b && (a.contains ? a.contains(b) : true);
|
924
|
+
};
|
925
|
+
|
926
|
+
var isXML = function(elem){
|
927
|
+
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
|
928
|
+
!!elem.ownerDocument && isXML( elem.ownerDocument );
|
929
|
+
};
|
930
|
+
|
931
|
+
var posProcess = function(selector, context){
|
932
|
+
var tmpSet = [], later = "", match,
|
933
|
+
root = context.nodeType ? [context] : context;
|
934
|
+
|
935
|
+
// Position selectors must be done after the filter
|
936
|
+
// And so must :not(positional) so we move all PSEUDOs to the end
|
937
|
+
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
|
938
|
+
later += match[0];
|
939
|
+
selector = selector.replace( Expr.match.PSEUDO, "" );
|
940
|
+
}
|
941
|
+
|
942
|
+
selector = Expr.relative[selector] ? selector + "*" : selector;
|
943
|
+
|
944
|
+
for ( var i = 0, l = root.length; i < l; i++ ) {
|
945
|
+
Sizzle( selector, root[i], tmpSet );
|
946
|
+
}
|
947
|
+
|
948
|
+
return Sizzle.filter( later, tmpSet );
|
949
|
+
};
|
950
|
+
|
951
|
+
// EXPOSE
|
952
|
+
jQuery.find = Sizzle;
|
953
|
+
jQuery.filter = Sizzle.filter;
|
954
|
+
jQuery.expr = Sizzle.selectors;
|
955
|
+
jQuery.expr[":"] = jQuery.expr.filters;
|
956
|
+
|
957
|
+
Sizzle.selectors.filters.hidden = function(elem){
|
958
|
+
return elem.offsetWidth === 0 || elem.offsetHeight === 0;
|
959
|
+
};
|
960
|
+
|
961
|
+
Sizzle.selectors.filters.visible = function(elem){
|
962
|
+
return elem.offsetWidth > 0 || elem.offsetHeight > 0;
|
963
|
+
};
|
964
|
+
|
965
|
+
Sizzle.selectors.filters.animated = function(elem){
|
966
|
+
return jQuery.grep(jQuery.timers, function(fn){
|
967
|
+
return elem === fn.elem;
|
968
|
+
}).length;
|
969
|
+
};
|
970
|
+
|
971
|
+
jQuery.multiFilter = function( expr, elems, not ) {
|
972
|
+
if ( not ) {
|
973
|
+
expr = ":not(" + expr + ")";
|
974
|
+
}
|
975
|
+
|
976
|
+
return Sizzle.matches(expr, elems);
|
977
|
+
};
|
978
|
+
|
979
|
+
jQuery.dir = function( elem, dir ){
|
980
|
+
var matched = [], cur = elem[dir];
|
981
|
+
while ( cur && cur != document ) {
|
982
|
+
if ( cur.nodeType == 1 )
|
983
|
+
matched.push( cur );
|
984
|
+
cur = cur[dir];
|
985
|
+
}
|
986
|
+
return matched;
|
987
|
+
};
|
988
|
+
|
989
|
+
jQuery.nth = function(cur, result, dir, elem){
|
990
|
+
result = result || 1;
|
991
|
+
var num = 0;
|
992
|
+
|
993
|
+
for ( ; cur; cur = cur[dir] )
|
994
|
+
if ( cur.nodeType == 1 && ++num == result )
|
995
|
+
break;
|
996
|
+
|
997
|
+
return cur;
|
998
|
+
};
|
999
|
+
|
1000
|
+
jQuery.sibling = function(n, elem){
|
1001
|
+
var r = [];
|
1002
|
+
|
1003
|
+
for ( ; n; n = n.nextSibling ) {
|
1004
|
+
if ( n.nodeType == 1 && n != elem )
|
1005
|
+
r.push( n );
|
1006
|
+
}
|
1007
|
+
|
1008
|
+
return r;
|
1009
|
+
};
|
1010
|
+
|
1011
|
+
return;
|
1012
|
+
|
1013
|
+
window.Sizzle = Sizzle;
|
1014
|
+
|
1015
|
+
})();
|