guff-compass 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +21 -0
- data/.gitignore +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +21 -0
- data/demo/bower_components/jquery/.bower.json +21 -0
- data/demo/bower_components/jquery/.editorconfig +43 -0
- data/demo/bower_components/jquery/.gitattributes +2 -0
- data/demo/bower_components/jquery/.gitignore +14 -0
- data/demo/bower_components/jquery/.gitmodules +6 -0
- data/demo/bower_components/jquery/.jshintrc +17 -0
- data/demo/bower_components/jquery/.mailmap +94 -0
- data/demo/bower_components/jquery/AUTHORS.txt +170 -0
- data/demo/bower_components/jquery/CONTRIBUTING.md +216 -0
- data/demo/bower_components/jquery/Gruntfile.js +594 -0
- data/demo/bower_components/jquery/MIT-LICENSE.txt +21 -0
- data/demo/bower_components/jquery/README.md +398 -0
- data/demo/bower_components/jquery/bower.json +11 -0
- data/demo/bower_components/jquery/build/release-notes.js +59 -0
- data/demo/bower_components/jquery/build/release.js +316 -0
- data/demo/bower_components/jquery/component.json +15 -0
- data/demo/bower_components/jquery/composer.json +35 -0
- data/demo/bower_components/jquery/jquery-migrate.js +511 -0
- data/demo/bower_components/jquery/jquery-migrate.min.js +3 -0
- data/demo/bower_components/jquery/jquery.js +9789 -0
- data/demo/bower_components/jquery/jquery.min.js +6 -0
- data/demo/bower_components/jquery/jquery.min.map +1 -0
- data/demo/bower_components/jquery/package.json +38 -0
- data/demo/bower_components/jquery/speed/benchmark.js +15 -0
- data/demo/bower_components/jquery/speed/benchmarker.css +65 -0
- data/demo/bower_components/jquery/speed/benchmarker.js +181 -0
- data/demo/bower_components/jquery/speed/closest.html +39 -0
- data/demo/bower_components/jquery/speed/css.html +82 -0
- data/demo/bower_components/jquery/speed/event.html +58 -0
- data/demo/bower_components/jquery/speed/filter.html +183 -0
- data/demo/bower_components/jquery/speed/find.html +179 -0
- data/demo/bower_components/jquery/speed/index.html +72 -0
- data/demo/bower_components/jquery/speed/jquery-basis.js +6238 -0
- data/demo/bower_components/jquery/speed/slice.vs.concat.html +47 -0
- data/demo/bower_components/jquery/src/.jshintrc +27 -0
- data/demo/bower_components/jquery/src/ajax.js +855 -0
- data/demo/bower_components/jquery/src/ajax/jsonp.js +80 -0
- data/demo/bower_components/jquery/src/ajax/script.js +86 -0
- data/demo/bower_components/jquery/src/ajax/xhr.js +207 -0
- data/demo/bower_components/jquery/src/attributes.js +659 -0
- data/demo/bower_components/jquery/src/callbacks.js +197 -0
- data/demo/bower_components/jquery/src/core.js +981 -0
- data/demo/bower_components/jquery/src/css.js +661 -0
- data/demo/bower_components/jquery/src/data.js +336 -0
- data/demo/bower_components/jquery/src/deferred.js +141 -0
- data/demo/bower_components/jquery/src/deprecated.js +11 -0
- data/demo/bower_components/jquery/src/dimensions.js +41 -0
- data/demo/bower_components/jquery/src/effects.js +732 -0
- data/demo/bower_components/jquery/src/event-alias.js +32 -0
- data/demo/bower_components/jquery/src/event.js +995 -0
- data/demo/bower_components/jquery/src/exports.js +21 -0
- data/demo/bower_components/jquery/src/intro.js +20 -0
- data/demo/bower_components/jquery/src/manipulation.js +744 -0
- data/demo/bower_components/jquery/src/offset.js +169 -0
- data/demo/bower_components/jquery/src/outro.js +2 -0
- data/demo/bower_components/jquery/src/queue.js +146 -0
- data/demo/bower_components/jquery/src/serialize.js +99 -0
- data/demo/bower_components/jquery/src/sizzle-jquery.js +7 -0
- data/demo/bower_components/jquery/src/support.js +246 -0
- data/demo/bower_components/jquery/src/traversing.js +283 -0
- data/demo/bower_components/jquery/src/wrap.js +66 -0
- data/demo/bower_components/jquery/test/.jshintignore +3 -0
- data/demo/bower_components/jquery/test/.jshintrc +60 -0
- data/demo/bower_components/jquery/test/data/1x1.jpg +0 -0
- data/demo/bower_components/jquery/test/data/ajax/unreleasedXHR.html +25 -0
- data/demo/bower_components/jquery/test/data/atom+xml.php +4 -0
- data/demo/bower_components/jquery/test/data/badcall.js +1 -0
- data/demo/bower_components/jquery/test/data/badjson.js +1 -0
- data/demo/bower_components/jquery/test/data/cleanScript.html +10 -0
- data/demo/bower_components/jquery/test/data/core/cc_on.html +22 -0
- data/demo/bower_components/jquery/test/data/dashboard.xml +11 -0
- data/demo/bower_components/jquery/test/data/dimensions/documentLarge.html +17 -0
- data/demo/bower_components/jquery/test/data/dimensions/documentSmall.html +21 -0
- data/demo/bower_components/jquery/test/data/echoData.php +1 -0
- data/demo/bower_components/jquery/test/data/echoQuery.php +1 -0
- data/demo/bower_components/jquery/test/data/errorWithJSON.php +6 -0
- data/demo/bower_components/jquery/test/data/errorWithText.php +5 -0
- data/demo/bower_components/jquery/test/data/etag.php +21 -0
- data/demo/bower_components/jquery/test/data/evalScript.php +1 -0
- data/demo/bower_components/jquery/test/data/event/focusElem.html +16 -0
- data/demo/bower_components/jquery/test/data/event/longLoadScript.php +4 -0
- data/demo/bower_components/jquery/test/data/event/promiseReady.html +17 -0
- data/demo/bower_components/jquery/test/data/event/syncReady.html +23 -0
- data/demo/bower_components/jquery/test/data/headers.php +18 -0
- data/demo/bower_components/jquery/test/data/if_modified_since.php +20 -0
- data/demo/bower_components/jquery/test/data/iframe.html +8 -0
- data/demo/bower_components/jquery/test/data/jquery-1.9.1.ajax_xhr.min.js +5 -0
- data/demo/bower_components/jquery/test/data/json.php +13 -0
- data/demo/bower_components/jquery/test/data/json_obj.js +1 -0
- data/demo/bower_components/jquery/test/data/jsonp.php +14 -0
- data/demo/bower_components/jquery/test/data/manipulation/iframe-denied.html +36 -0
- data/demo/bower_components/jquery/test/data/name.html +1 -0
- data/demo/bower_components/jquery/test/data/name.php +24 -0
- data/demo/bower_components/jquery/test/data/nocontent.php +5 -0
- data/demo/bower_components/jquery/test/data/offset/absolute.html +41 -0
- data/demo/bower_components/jquery/test/data/offset/body.html +26 -0
- data/demo/bower_components/jquery/test/data/offset/fixed.html +34 -0
- data/demo/bower_components/jquery/test/data/offset/relative.html +31 -0
- data/demo/bower_components/jquery/test/data/offset/scroll.html +39 -0
- data/demo/bower_components/jquery/test/data/offset/static.html +31 -0
- data/demo/bower_components/jquery/test/data/offset/table.html +43 -0
- data/demo/bower_components/jquery/test/data/params_html.php +12 -0
- data/demo/bower_components/jquery/test/data/readywaitasset.js +1 -0
- data/demo/bower_components/jquery/test/data/readywaitloader.js +25 -0
- data/demo/bower_components/jquery/test/data/script.php +11 -0
- data/demo/bower_components/jquery/test/data/selector/html5_selector.html +114 -0
- data/demo/bower_components/jquery/test/data/selector/sizzle_cache.html +21 -0
- data/demo/bower_components/jquery/test/data/statusText.php +5 -0
- data/demo/bower_components/jquery/test/data/support/bodyBackground.html +28 -0
- data/demo/bower_components/jquery/test/data/support/boxSizing.html +19 -0
- data/demo/bower_components/jquery/test/data/support/csp.js +3 -0
- data/demo/bower_components/jquery/test/data/support/csp.php +22 -0
- data/demo/bower_components/jquery/test/data/support/shrinkWrapBlocks.html +23 -0
- data/demo/bower_components/jquery/test/data/support/testElementCrash.html +17 -0
- data/demo/bower_components/jquery/test/data/test.html +7 -0
- data/demo/bower_components/jquery/test/data/test.js +3 -0
- data/demo/bower_components/jquery/test/data/test.php +7 -0
- data/demo/bower_components/jquery/test/data/test2.html +5 -0
- data/demo/bower_components/jquery/test/data/test3.html +3 -0
- data/demo/bower_components/jquery/test/data/testinit.js +264 -0
- data/demo/bower_components/jquery/test/data/testrunner.js +371 -0
- data/demo/bower_components/jquery/test/data/testsuite.css +155 -0
- data/demo/bower_components/jquery/test/data/text.php +12 -0
- data/demo/bower_components/jquery/test/data/ua.txt +272 -0
- data/demo/bower_components/jquery/test/data/with_fries.xml +25 -0
- data/demo/bower_components/jquery/test/data/with_fries_over_jsonp.php +7 -0
- data/demo/bower_components/jquery/test/delegatetest.html +228 -0
- data/demo/bower_components/jquery/test/hovertest.html +158 -0
- data/demo/bower_components/jquery/test/index.html +337 -0
- data/demo/bower_components/jquery/test/jquery.js +5 -0
- data/demo/bower_components/jquery/test/localfile.html +75 -0
- data/demo/bower_components/jquery/test/networkerror.html +84 -0
- data/demo/bower_components/jquery/test/readywait.html +70 -0
- data/demo/bower_components/jquery/test/unit/ajax.js +2016 -0
- data/demo/bower_components/jquery/test/unit/attributes.js +1388 -0
- data/demo/bower_components/jquery/test/unit/callbacks.js +342 -0
- data/demo/bower_components/jquery/test/unit/core.js +1360 -0
- data/demo/bower_components/jquery/test/unit/css.js +1056 -0
- data/demo/bower_components/jquery/test/unit/data.js +645 -0
- data/demo/bower_components/jquery/test/unit/deferred.js +436 -0
- data/demo/bower_components/jquery/test/unit/deprecated.js +8 -0
- data/demo/bower_components/jquery/test/unit/dimensions.js +472 -0
- data/demo/bower_components/jquery/test/unit/effects.js +2242 -0
- data/demo/bower_components/jquery/test/unit/event.js +2755 -0
- data/demo/bower_components/jquery/test/unit/exports.js +7 -0
- data/demo/bower_components/jquery/test/unit/manipulation.js +2120 -0
- data/demo/bower_components/jquery/test/unit/offset.js +559 -0
- data/demo/bower_components/jquery/test/unit/queue.js +314 -0
- data/demo/bower_components/jquery/test/unit/selector.js +172 -0
- data/demo/bower_components/jquery/test/unit/serialize.js +148 -0
- data/demo/bower_components/jquery/test/unit/support.js +370 -0
- data/demo/bower_components/jquery/test/unit/traversing.js +797 -0
- data/demo/bower_components/jquery/test/unit/wrap.js +265 -0
- data/demo/bower_components/jquery/test/xhtml.php +5 -0
- data/demo/index.html +347 -0
- data/demo/styles/main.css +208 -0
- data/demo/styles/main.scss +138 -0
- data/docs/docco.css +506 -0
- data/docs/guff.html +1127 -0
- data/docs/public/fonts/aller-bold.eot +0 -0
- data/docs/public/fonts/aller-bold.ttf +0 -0
- data/docs/public/fonts/aller-bold.woff +0 -0
- data/docs/public/fonts/aller-light.eot +0 -0
- data/docs/public/fonts/aller-light.ttf +0 -0
- data/docs/public/fonts/aller-light.woff +0 -0
- data/docs/public/fonts/novecento-bold.eot +0 -0
- data/docs/public/fonts/novecento-bold.ttf +0 -0
- data/docs/public/fonts/novecento-bold.woff +0 -0
- data/docs/public/stylesheets/normalize.css +375 -0
- data/guff.gemspec +16 -0
- data/guff.scss +514 -0
- data/gulpfile.js +67 -0
- data/lib/guff.rb +4 -0
- data/lib/stylesheets/_guff.scss +514 -0
- data/package.json +19 -0
- data/src/_functions.scss +57 -0
- data/src/_mixins.scss +301 -0
- data/src/_reset.scss +67 -0
- data/src/_settings.scss +22 -0
- data/src/_typography.scss +67 -0
- metadata +259 -0
@@ -0,0 +1,314 @@
|
|
1
|
+
module( "queue", { teardown: moduleTeardown });
|
2
|
+
|
3
|
+
test( "queue() with other types", 14, function() {
|
4
|
+
stop();
|
5
|
+
|
6
|
+
var $div = jQuery({}),
|
7
|
+
counter = 0;
|
8
|
+
|
9
|
+
$div.promise( "foo" ).done(function() {
|
10
|
+
equal( counter, 0, "Deferred for collection with no queue is automatically resolved" );
|
11
|
+
});
|
12
|
+
|
13
|
+
$div
|
14
|
+
.queue("foo",function(){
|
15
|
+
equal( ++counter, 1, "Dequeuing" );
|
16
|
+
jQuery.dequeue(this,"foo");
|
17
|
+
})
|
18
|
+
.queue("foo",function(){
|
19
|
+
equal( ++counter, 2, "Dequeuing" );
|
20
|
+
jQuery(this).dequeue("foo");
|
21
|
+
})
|
22
|
+
.queue("foo",function(){
|
23
|
+
equal( ++counter, 3, "Dequeuing" );
|
24
|
+
})
|
25
|
+
.queue("foo",function(){
|
26
|
+
equal( ++counter, 4, "Dequeuing" );
|
27
|
+
});
|
28
|
+
|
29
|
+
$div.promise("foo").done(function() {
|
30
|
+
equal( counter, 4, "Testing previous call to dequeue in deferred" );
|
31
|
+
start();
|
32
|
+
});
|
33
|
+
|
34
|
+
equal( $div.queue("foo").length, 4, "Testing queue length" );
|
35
|
+
|
36
|
+
equal( $div.queue("foo", undefined).queue("foo").length, 4, ".queue('name',undefined) does nothing but is chainable (#5571)");
|
37
|
+
|
38
|
+
$div.dequeue("foo");
|
39
|
+
|
40
|
+
equal( counter, 3, "Testing previous call to dequeue" );
|
41
|
+
equal( $div.queue("foo").length, 1, "Testing queue length" );
|
42
|
+
|
43
|
+
$div.dequeue("foo");
|
44
|
+
|
45
|
+
equal( counter, 4, "Testing previous call to dequeue" );
|
46
|
+
equal( $div.queue("foo").length, 0, "Testing queue length" );
|
47
|
+
|
48
|
+
$div.dequeue("foo");
|
49
|
+
|
50
|
+
equal( counter, 4, "Testing previous call to dequeue" );
|
51
|
+
equal( $div.queue("foo").length, 0, "Testing queue length" );
|
52
|
+
|
53
|
+
});
|
54
|
+
|
55
|
+
test("queue(name) passes in the next item in the queue as a parameter", function() {
|
56
|
+
expect(2);
|
57
|
+
|
58
|
+
var div = jQuery({}),
|
59
|
+
counter = 0;
|
60
|
+
|
61
|
+
div.queue("foo", function(next) {
|
62
|
+
equal(++counter, 1, "Dequeueing");
|
63
|
+
next();
|
64
|
+
}).queue("foo", function(next) {
|
65
|
+
equal(++counter, 2, "Next was called");
|
66
|
+
next();
|
67
|
+
}).queue("bar", function() {
|
68
|
+
equal(++counter, 3, "Other queues are not triggered by next()");
|
69
|
+
});
|
70
|
+
|
71
|
+
div.dequeue("foo");
|
72
|
+
});
|
73
|
+
|
74
|
+
test("queue() passes in the next item in the queue as a parameter to fx queues", function() {
|
75
|
+
expect(3);
|
76
|
+
stop();
|
77
|
+
|
78
|
+
var div = jQuery({}),
|
79
|
+
counter = 0;
|
80
|
+
|
81
|
+
div.queue(function( next ) {
|
82
|
+
equal(++counter, 1, "Dequeueing");
|
83
|
+
setTimeout(function() { next(); }, 500);
|
84
|
+
}).queue(function(next) {
|
85
|
+
equal(++counter, 2, "Next was called");
|
86
|
+
next();
|
87
|
+
}).queue("bar", function() {
|
88
|
+
equal(++counter, 3, "Other queues are not triggered by next()");
|
89
|
+
});
|
90
|
+
|
91
|
+
jQuery.when( div.promise("fx"), div ).done(function() {
|
92
|
+
equal(counter, 2, "Deferreds resolved");
|
93
|
+
start();
|
94
|
+
});
|
95
|
+
});
|
96
|
+
|
97
|
+
test("callbacks keep their place in the queue", function() {
|
98
|
+
expect(5);
|
99
|
+
stop();
|
100
|
+
var div = jQuery("<div>"),
|
101
|
+
counter = 0;
|
102
|
+
|
103
|
+
div.queue(function( next ) {
|
104
|
+
equal( ++counter, 1, "Queue/callback order: first called" );
|
105
|
+
setTimeout( next, 200 );
|
106
|
+
}).delay( 100 ).queue(function( next ) {
|
107
|
+
equal( ++counter, 2, "Queue/callback order: second called" );
|
108
|
+
jQuery( this ).delay( 100 ).queue(function( next ) {
|
109
|
+
equal( ++counter, 4, "Queue/callback order: fourth called" );
|
110
|
+
next();
|
111
|
+
});
|
112
|
+
next();
|
113
|
+
}).queue(function( next ) {
|
114
|
+
equal( ++counter, 3, "Queue/callback order: third called" );
|
115
|
+
next();
|
116
|
+
});
|
117
|
+
|
118
|
+
div.promise("fx").done(function() {
|
119
|
+
equal(counter, 4, "Deferreds resolved");
|
120
|
+
start();
|
121
|
+
});
|
122
|
+
});
|
123
|
+
|
124
|
+
test("delay()", function() {
|
125
|
+
expect(2);
|
126
|
+
stop();
|
127
|
+
|
128
|
+
var foo = jQuery({}), run = 0;
|
129
|
+
|
130
|
+
foo.delay(100).queue(function(){
|
131
|
+
run = 1;
|
132
|
+
ok( true, "The function was dequeued." );
|
133
|
+
start();
|
134
|
+
});
|
135
|
+
|
136
|
+
equal( run, 0, "The delay delayed the next function from running." );
|
137
|
+
});
|
138
|
+
|
139
|
+
test("clearQueue(name) clears the queue", function() {
|
140
|
+
expect(2);
|
141
|
+
|
142
|
+
stop();
|
143
|
+
|
144
|
+
var div = jQuery({}),
|
145
|
+
counter = 0;
|
146
|
+
|
147
|
+
div.queue("foo", function( next ) {
|
148
|
+
counter++;
|
149
|
+
jQuery(this).clearQueue("foo");
|
150
|
+
next();
|
151
|
+
}).queue("foo", function() {
|
152
|
+
counter++;
|
153
|
+
});
|
154
|
+
|
155
|
+
div.promise("foo").done(function() {
|
156
|
+
ok( true, "dequeue resolves the deferred" );
|
157
|
+
start();
|
158
|
+
});
|
159
|
+
|
160
|
+
div.dequeue("foo");
|
161
|
+
|
162
|
+
equal(counter, 1, "the queue was cleared");
|
163
|
+
});
|
164
|
+
|
165
|
+
test("clearQueue() clears the fx queue", function() {
|
166
|
+
expect(1);
|
167
|
+
|
168
|
+
var div = jQuery({}),
|
169
|
+
counter = 0;
|
170
|
+
|
171
|
+
div.queue(function( next ) {
|
172
|
+
counter++;
|
173
|
+
var self = this;
|
174
|
+
setTimeout(function() { jQuery(self).clearQueue(); next(); }, 50);
|
175
|
+
}).queue(function() {
|
176
|
+
counter++;
|
177
|
+
});
|
178
|
+
|
179
|
+
equal(counter, 1, "the queue was cleared");
|
180
|
+
|
181
|
+
div.removeData();
|
182
|
+
});
|
183
|
+
|
184
|
+
asyncTest( "fn.promise() - called when fx queue is empty", 3, function() {
|
185
|
+
var foo = jQuery( "#foo" ).clone().addBack(),
|
186
|
+
promised = false;
|
187
|
+
|
188
|
+
foo.queue( function( next ) {
|
189
|
+
// called twice!
|
190
|
+
ok( !promised, "Promised hasn't been called" );
|
191
|
+
setTimeout( next, 10 );
|
192
|
+
});
|
193
|
+
foo.promise().done( function() {
|
194
|
+
ok( promised = true, "Promised" );
|
195
|
+
start();
|
196
|
+
});
|
197
|
+
});
|
198
|
+
|
199
|
+
asyncTest( "fn.promise( \"queue\" ) - called whenever last queue function is dequeued", 5, function() {
|
200
|
+
var foo = jQuery( "#foo" ),
|
201
|
+
test;
|
202
|
+
foo.promise( "queue" ).done( function() {
|
203
|
+
strictEqual( test, undefined, "called immediately when queue was already empty" );
|
204
|
+
});
|
205
|
+
test = 1;
|
206
|
+
foo.queue( "queue", function( next ) {
|
207
|
+
strictEqual( test++, 1, "step one" );
|
208
|
+
setTimeout( next, 0 );
|
209
|
+
}).queue( "queue", function( next ) {
|
210
|
+
strictEqual( test++, 2, "step two" );
|
211
|
+
setTimeout( function() {
|
212
|
+
next();
|
213
|
+
strictEqual( test++, 4, "step four" );
|
214
|
+
start();
|
215
|
+
}, 10 );
|
216
|
+
}).promise( "queue" ).done( function() {
|
217
|
+
strictEqual( test++, 3, "step three" );
|
218
|
+
});
|
219
|
+
|
220
|
+
foo.dequeue( "queue" );
|
221
|
+
});
|
222
|
+
|
223
|
+
asyncTest( "fn.promise( \"queue\" ) - waits for animation to complete before resolving", 2, function() {
|
224
|
+
var foo = jQuery( "#foo" ),
|
225
|
+
test = 1;
|
226
|
+
|
227
|
+
foo.animate({
|
228
|
+
top: 100
|
229
|
+
}, {
|
230
|
+
duration: 1,
|
231
|
+
queue: "queue",
|
232
|
+
complete: function() {
|
233
|
+
strictEqual( test++, 1, "step one" );
|
234
|
+
}
|
235
|
+
}).dequeue( "queue" );
|
236
|
+
|
237
|
+
foo.promise( "queue" ).done( function() {
|
238
|
+
strictEqual( test++, 2, "step two" );
|
239
|
+
start();
|
240
|
+
});
|
241
|
+
|
242
|
+
});
|
243
|
+
|
244
|
+
test( ".promise(obj)", function() {
|
245
|
+
expect(2);
|
246
|
+
|
247
|
+
var obj = {},
|
248
|
+
promise = jQuery( "#foo" ).promise( "promise", obj );
|
249
|
+
|
250
|
+
ok( jQuery.isFunction( promise.promise ), ".promise(type, obj) returns a promise" );
|
251
|
+
strictEqual( promise, obj, ".promise(type, obj) returns obj" );
|
252
|
+
});
|
253
|
+
|
254
|
+
|
255
|
+
if ( jQuery.fn.stop ) {
|
256
|
+
test("delay() can be stopped", function() {
|
257
|
+
expect( 3 );
|
258
|
+
stop();
|
259
|
+
|
260
|
+
var done = {};
|
261
|
+
jQuery({})
|
262
|
+
.queue( "alternate", function( next ) {
|
263
|
+
done.alt1 = true;
|
264
|
+
ok( true, "This first function was dequeued" );
|
265
|
+
next();
|
266
|
+
})
|
267
|
+
.delay( 1000, "alternate" )
|
268
|
+
.queue( "alternate", function() {
|
269
|
+
done.alt2 = true;
|
270
|
+
ok( true, "The function was dequeued immediately, the delay was stopped" );
|
271
|
+
})
|
272
|
+
.dequeue( "alternate" )
|
273
|
+
|
274
|
+
// stop( "alternate", false ) will NOT clear the queue, so it should automatically dequeue the next
|
275
|
+
.stop( "alternate", false, false )
|
276
|
+
|
277
|
+
// this test
|
278
|
+
.delay( 1 )
|
279
|
+
.queue(function() {
|
280
|
+
done.default1 = true;
|
281
|
+
ok( false, "This queue should never run" );
|
282
|
+
})
|
283
|
+
|
284
|
+
// stop( clearQueue ) should clear the queue
|
285
|
+
.stop( true, false );
|
286
|
+
|
287
|
+
deepEqual( done, { alt1: true, alt2: true }, "Queue ran the proper functions" );
|
288
|
+
|
289
|
+
setTimeout(function() {
|
290
|
+
start();
|
291
|
+
}, 1500 );
|
292
|
+
});
|
293
|
+
|
294
|
+
asyncTest( "queue stop hooks", 2, function() {
|
295
|
+
var foo = jQuery( "#foo" );
|
296
|
+
|
297
|
+
foo.queue( function( next, hooks ) {
|
298
|
+
hooks.stop = function( gotoEnd ) {
|
299
|
+
equal( !!gotoEnd, false, "Stopped without gotoEnd" );
|
300
|
+
};
|
301
|
+
});
|
302
|
+
foo.stop();
|
303
|
+
|
304
|
+
foo.queue( function( next, hooks ) {
|
305
|
+
hooks.stop = function( gotoEnd ) {
|
306
|
+
equal( gotoEnd, true, "Stopped with gotoEnd" );
|
307
|
+
start();
|
308
|
+
};
|
309
|
+
});
|
310
|
+
|
311
|
+
foo.stop( false, true );
|
312
|
+
});
|
313
|
+
|
314
|
+
} // if ( jQuery.fn.stop )
|
@@ -0,0 +1,172 @@
|
|
1
|
+
module("selector", { teardown: moduleTeardown });
|
2
|
+
|
3
|
+
/**
|
4
|
+
* This test page is for selector tests that require jQuery in order to do the selection
|
5
|
+
*/
|
6
|
+
|
7
|
+
test("element - jQuery only", function() {
|
8
|
+
expect( 7 );
|
9
|
+
|
10
|
+
var fixture = document.getElementById("qunit-fixture");
|
11
|
+
|
12
|
+
deepEqual( jQuery("p", fixture).get(), q("firstp","ap","sndp","en","sap","first"), "Finding elements with a Node context." );
|
13
|
+
deepEqual( jQuery("p", "#qunit-fixture").get(), q("firstp","ap","sndp","en","sap","first"), "Finding elements with a selector context." );
|
14
|
+
deepEqual( jQuery("p", jQuery("#qunit-fixture")).get(), q("firstp","ap","sndp","en","sap","first"), "Finding elements with a jQuery object context." );
|
15
|
+
deepEqual( jQuery("#qunit-fixture").find("p").get(), q("firstp","ap","sndp","en","sap","first"), "Finding elements with a context via .find()." );
|
16
|
+
|
17
|
+
ok( jQuery("#length").length, "<input name=\"length\"> cannot be found under IE, see #945" );
|
18
|
+
ok( jQuery("#lengthtest input").length, "<input name=\"length\"> cannot be found under IE, see #945" );
|
19
|
+
|
20
|
+
// #7533
|
21
|
+
equal( jQuery("<div id=\"A'B~C.D[E]\"><p>foo</p></div>").find("p").length, 1, "Find where context root is a node and has an ID with CSS3 meta characters" );
|
22
|
+
});
|
23
|
+
|
24
|
+
test("class - jQuery only", function() {
|
25
|
+
expect( 4 );
|
26
|
+
|
27
|
+
deepEqual( jQuery(".blog", document.getElementsByTagName("p")).get(), q("mark", "simon"), "Finding elements with a context." );
|
28
|
+
deepEqual( jQuery(".blog", "p").get(), q("mark", "simon"), "Finding elements with a context." );
|
29
|
+
deepEqual( jQuery(".blog", jQuery("p")).get(), q("mark", "simon"), "Finding elements with a context." );
|
30
|
+
deepEqual( jQuery("p").find(".blog").get(), q("mark", "simon"), "Finding elements with a context." );
|
31
|
+
});
|
32
|
+
|
33
|
+
test("attributes - jQuery only", function() {
|
34
|
+
expect( 5 );
|
35
|
+
|
36
|
+
t( "Find elements with a tabindex attribute", "[tabindex]", ["listWithTabIndex", "foodWithNegativeTabIndex", "linkWithTabIndex", "linkWithNegativeTabIndex", "linkWithNoHrefWithTabIndex", "linkWithNoHrefWithNegativeTabIndex"] );
|
37
|
+
|
38
|
+
// #12600
|
39
|
+
ok(
|
40
|
+
jQuery("<select value='12600'><option value='option' selected='selected'></option><option value=''></option></select>")
|
41
|
+
.prop( "value", "option" )
|
42
|
+
.is(":input[value='12600']"),
|
43
|
+
|
44
|
+
":input[value=foo] selects select by attribute"
|
45
|
+
);
|
46
|
+
ok( jQuery("<input type='text' value='12600'/>").prop( "value", "option" ).is(":input[value='12600']"),
|
47
|
+
":input[value=foo] selects text input by attribute"
|
48
|
+
);
|
49
|
+
|
50
|
+
// #11115
|
51
|
+
ok( jQuery("<input type='checkbox' checked='checked'/>").prop( "checked", false ).is("[checked]"),
|
52
|
+
"[checked] selects by attribute (positive)"
|
53
|
+
);
|
54
|
+
ok( !jQuery("<input type='checkbox'/>").prop( "checked", true ).is("[checked]"),
|
55
|
+
"[checked] selects by attribute (negative)"
|
56
|
+
);
|
57
|
+
});
|
58
|
+
|
59
|
+
test("disconnected nodes", function() {
|
60
|
+
expect( 1 );
|
61
|
+
|
62
|
+
var $div = jQuery("<div/>");
|
63
|
+
equal( $div.is("div"), true, "Make sure .is('nodeName') works on disconnected nodes." );
|
64
|
+
});
|
65
|
+
|
66
|
+
test("disconnected nodes - jQuery only", function() {
|
67
|
+
expect( 3 );
|
68
|
+
|
69
|
+
var $opt = jQuery("<option></option>").attr("value", "whipit").appendTo("#qunit-fixture").detach();
|
70
|
+
equal( $opt.val(), "whipit", "option value" );
|
71
|
+
equal( $opt.is(":selected"), false, "unselected option" );
|
72
|
+
$opt.prop("selected", true);
|
73
|
+
equal( $opt.is(":selected"), true, "selected option" );
|
74
|
+
});
|
75
|
+
|
76
|
+
testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQuery, window, document ) {
|
77
|
+
expect( 35 );
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Returns an array of elements with the given IDs
|
81
|
+
* q & t are added here for the iFrame's context
|
82
|
+
*/
|
83
|
+
function q() {
|
84
|
+
var r = [],
|
85
|
+
i = 0;
|
86
|
+
|
87
|
+
for ( ; i < arguments.length; i++ ) {
|
88
|
+
r.push( document.getElementById( arguments[i] ) );
|
89
|
+
}
|
90
|
+
return r;
|
91
|
+
}
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Asserts that a select matches the given IDs
|
95
|
+
* @example t("Check for something", "//[a]", ["foo", "baar"]);
|
96
|
+
* @param {String} a - Assertion name
|
97
|
+
* @param {String} b - Sizzle selector
|
98
|
+
* @param {Array} c - Array of ids to construct what is expected
|
99
|
+
*/
|
100
|
+
function t( a, b, c ) {
|
101
|
+
var f = jQuery(b).get(),
|
102
|
+
s = "",
|
103
|
+
i = 0;
|
104
|
+
|
105
|
+
for ( ; i < f.length; i++ ) {
|
106
|
+
s += (s && ",") + "'" + f[i].id + "'";
|
107
|
+
}
|
108
|
+
|
109
|
+
deepEqual(f, q.apply( q, c ), a + " (" + b + ")");
|
110
|
+
}
|
111
|
+
|
112
|
+
// ====== All known boolean attributes, including html5 booleans ======
|
113
|
+
// autobuffer, autofocus, autoplay, async, checked,
|
114
|
+
// compact, controls, declare, defer, disabled,
|
115
|
+
// formnovalidate, hidden, indeterminate (property only),
|
116
|
+
// ismap, itemscope, loop, multiple, muted, nohref, noresize,
|
117
|
+
// noshade, nowrap, novalidate, open, pubdate, readonly, required,
|
118
|
+
// reversed, scoped, seamless, selected, truespeed, visible (skipping visible attribute, which is on a barprop object)
|
119
|
+
|
120
|
+
t( "Attribute Exists", "[autobuffer]", ["video1"]);
|
121
|
+
t( "Attribute Exists", "[autofocus]", ["text1"]);
|
122
|
+
t( "Attribute Exists", "[autoplay]", ["video1"]);
|
123
|
+
t( "Attribute Exists", "[async]", ["script1"]);
|
124
|
+
t( "Attribute Exists", "[checked]", ["check1"]);
|
125
|
+
t( "Attribute Exists", "[compact]", ["dl"]);
|
126
|
+
t( "Attribute Exists", "[controls]", ["video1"]);
|
127
|
+
t( "Attribute Exists", "[declare]", ["object1"]);
|
128
|
+
t( "Attribute Exists", "[defer]", ["script1"]);
|
129
|
+
t( "Attribute Exists", "[disabled]", ["check1"]);
|
130
|
+
t( "Attribute Exists", "[formnovalidate]", ["form1"]);
|
131
|
+
t( "Attribute Exists", "[hidden]", ["div1"]);
|
132
|
+
t( "Attribute Exists", "[indeterminate]", []);
|
133
|
+
t( "Attribute Exists", "[ismap]", ["img1"]);
|
134
|
+
t( "Attribute Exists", "[itemscope]", ["div1"]);
|
135
|
+
// t( "Attribute Exists", "[loop]", ["video1"]); // IE 6/7 cannot differentiate here. loop is also used on img, input, and marquee tags as well as video/audio. getAttributeNode unfortunately also retrieves the property value.
|
136
|
+
t( "Attribute Exists", "[multiple]", ["select1"]);
|
137
|
+
t( "Attribute Exists", "[muted]", ["audio1"]);
|
138
|
+
// t( "Attribute Exists", "[nohref]", ["area1"]); // IE 6/7 keep this set to false regardless of presence. The attribute node is not retrievable.
|
139
|
+
t( "Attribute Exists", "[noresize]", ["textarea1"]);
|
140
|
+
t( "Attribute Exists", "[noshade]", ["hr1"]);
|
141
|
+
t( "Attribute Exists", "[nowrap]", ["td1", "div1"]);
|
142
|
+
t( "Attribute Exists", "[novalidate]", ["form1"]);
|
143
|
+
t( "Attribute Exists", "[open]", ["details1"]);
|
144
|
+
t( "Attribute Exists", "[pubdate]", ["article1"]);
|
145
|
+
t( "Attribute Exists", "[readonly]", ["text1"]);
|
146
|
+
t( "Attribute Exists", "[required]", ["text1"]);
|
147
|
+
t( "Attribute Exists", "[reversed]", ["ol1"]);
|
148
|
+
t( "Attribute Exists", "[scoped]", ["style1"]);
|
149
|
+
t( "Attribute Exists", "[seamless]", ["iframe1"]);
|
150
|
+
t( "Attribute Exists", "[selected]", ["option1"]);
|
151
|
+
t( "Attribute Exists", "[truespeed]", ["marquee1"]);
|
152
|
+
|
153
|
+
// Enumerated attributes (these are not boolean content attributes)
|
154
|
+
jQuery.expandedEach = jQuery.each;
|
155
|
+
jQuery.expandedEach([ "draggable", "contenteditable", "aria-disabled" ], function( i, val ) {
|
156
|
+
t( "Enumerated attribute", "[" + val + "]", ["div1"]);
|
157
|
+
});
|
158
|
+
t( "Enumerated attribute", "[spellcheck]", ["span1"]);
|
159
|
+
|
160
|
+
// t( "tabindex selector does not retrieve all elements in IE6/7(#8473)", "form, [tabindex]", ["form1", "text1"] ); // sigh, FF12 QSA mistakenly includes video elements even though they have no tabindex attribute (see https://bugzilla.mozilla.org/show_bug.cgi?id=618737)
|
161
|
+
t( "Improperly named form elements do not interfere with form selections (#9570)", "form[name='formName']", ["form1"] );
|
162
|
+
});
|
163
|
+
|
164
|
+
testIframe("selector/sizzle_cache", "Sizzle cache collides with multiple Sizzles on a page", function( jQuery, window, document ) {
|
165
|
+
var $cached = window["$cached"];
|
166
|
+
|
167
|
+
expect(4);
|
168
|
+
notStrictEqual( jQuery, $cached, "Loaded two engines" );
|
169
|
+
deepEqual( $cached(".test a").get(), [ document.getElementById("collision") ], "Select collision anchor with first sizzle" );
|
170
|
+
equal( jQuery(".evil a").length, 0, "Select nothing with second sizzle" );
|
171
|
+
equal( jQuery(".evil a").length, 0, "Select nothing again with second sizzle" );
|
172
|
+
});
|