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,148 @@
|
|
1
|
+
module("serialize", { teardown: moduleTeardown });
|
2
|
+
|
3
|
+
test("jQuery.param()", function() {
|
4
|
+
expect(22);
|
5
|
+
|
6
|
+
var params, settings;
|
7
|
+
|
8
|
+
equal( !( jQuery.ajaxSettings && jQuery.ajaxSettings.traditional ), true, "traditional flag, falsy by default" );
|
9
|
+
|
10
|
+
params = {"foo":"bar", "baz":42, "quux":"All your base are belong to us"};
|
11
|
+
equal( jQuery.param(params), "foo=bar&baz=42&quux=All+your+base+are+belong+to+us", "simple" );
|
12
|
+
|
13
|
+
params = {"string":"foo","null":null,"undefined":undefined};
|
14
|
+
equal( jQuery.param(params), "string=foo&null=&undefined=", "handle nulls and undefineds properly" );
|
15
|
+
|
16
|
+
params = {"someName": [1, 2, 3], "regularThing": "blah" };
|
17
|
+
equal( jQuery.param(params), "someName%5B%5D=1&someName%5B%5D=2&someName%5B%5D=3®ularThing=blah", "with array" );
|
18
|
+
|
19
|
+
params = {"foo": ["a", "b", "c"]};
|
20
|
+
equal( jQuery.param(params), "foo%5B%5D=a&foo%5B%5D=b&foo%5B%5D=c", "with array of strings" );
|
21
|
+
|
22
|
+
params = {"foo": ["baz", 42, "All your base are belong to us"] };
|
23
|
+
equal( jQuery.param(params), "foo%5B%5D=baz&foo%5B%5D=42&foo%5B%5D=All+your+base+are+belong+to+us", "more array" );
|
24
|
+
|
25
|
+
params = {"foo": { "bar": "baz", "beep": 42, "quux": "All your base are belong to us" } };
|
26
|
+
equal( jQuery.param(params), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All+your+base+are+belong+to+us", "even more arrays" );
|
27
|
+
|
28
|
+
params = { a:[1,2], b:{ c:3, d:[4,5], e:{ x:[6], y:7, z:[8,9] }, f:true, g:false, h:undefined }, i:[10,11], j:true, k:false, l:[undefined,0], m:"cowboy hat?" };
|
29
|
+
equal( decodeURIComponent( jQuery.param(params) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy+hat?", "huge structure" );
|
30
|
+
|
31
|
+
params = { "a": [ 0, [ 1, 2 ], [ 3, [ 4, 5 ], [ 6 ] ], { "b": [ 7, [ 8, 9 ], [ { "c": 10, "d": 11 } ], [ [ 12 ] ], [ [ [ 13 ] ] ], { "e": { "f": { "g": [ 14, [ 15 ] ] } } }, 16 ] }, 17 ] };
|
32
|
+
equal( decodeURIComponent( jQuery.param(params) ), "a[]=0&a[1][]=1&a[1][]=2&a[2][]=3&a[2][1][]=4&a[2][1][]=5&a[2][2][]=6&a[3][b][]=7&a[3][b][1][]=8&a[3][b][1][]=9&a[3][b][2][0][c]=10&a[3][b][2][0][d]=11&a[3][b][3][0][]=12&a[3][b][4][0][0][]=13&a[3][b][5][e][f][g][]=14&a[3][b][5][e][f][g][1][]=15&a[3][b][]=16&a[]=17", "nested arrays" );
|
33
|
+
|
34
|
+
params = { "a":[1,2], "b":{ "c":3, "d":[4,5], "e":{ "x":[6], "y":7, "z":[8,9] }, "f":true, "g":false, "h":undefined }, "i":[10,11], "j":true, "k":false, "l":[undefined,0], "m":"cowboy hat?" };
|
35
|
+
equal( jQuery.param(params,true), "a=1&a=2&b=%5Bobject+Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy+hat%3F", "huge structure, forced traditional" );
|
36
|
+
|
37
|
+
equal( decodeURIComponent( jQuery.param({ "a": [1,2,3], "b[]": [4,5,6], "c[d]": [7,8,9], "e": { "f": [10], "g": [11,12], "h": 13 } }) ), "a[]=1&a[]=2&a[]=3&b[]=4&b[]=5&b[]=6&c[d][]=7&c[d][]=8&c[d][]=9&e[f][]=10&e[g][]=11&e[g][]=12&e[h]=13", "Make sure params are not double-encoded." );
|
38
|
+
|
39
|
+
// #7945
|
40
|
+
equal( jQuery.param({"jquery": "1.4.2"}), "jquery=1.4.2", "Check that object with a jQuery property get serialized correctly" );
|
41
|
+
|
42
|
+
settings = { traditional: true };
|
43
|
+
|
44
|
+
if ( jQuery.ajaxSettings ) {
|
45
|
+
jQuery.ajaxSetup( settings );
|
46
|
+
} else {
|
47
|
+
jQuery.ajaxSettings = settings;
|
48
|
+
}
|
49
|
+
|
50
|
+
params = {"foo":"bar", "baz":42, "quux":"All your base are belong to us"};
|
51
|
+
equal( jQuery.param(params), "foo=bar&baz=42&quux=All+your+base+are+belong+to+us", "simple" );
|
52
|
+
|
53
|
+
params = {"someName": [1, 2, 3], "regularThing": "blah" };
|
54
|
+
equal( jQuery.param(params), "someName=1&someName=2&someName=3®ularThing=blah", "with array" );
|
55
|
+
|
56
|
+
params = {"foo": ["a", "b", "c"]};
|
57
|
+
equal( jQuery.param(params), "foo=a&foo=b&foo=c", "with array of strings" );
|
58
|
+
|
59
|
+
params = {"foo[]":["baz", 42, "All your base are belong to us"]};
|
60
|
+
equal( jQuery.param(params), "foo%5B%5D=baz&foo%5B%5D=42&foo%5B%5D=All+your+base+are+belong+to+us", "more array" );
|
61
|
+
|
62
|
+
params = {"foo[bar]":"baz", "foo[beep]":42, "foo[quux]":"All your base are belong to us"};
|
63
|
+
equal( jQuery.param(params), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All+your+base+are+belong+to+us", "even more arrays" );
|
64
|
+
|
65
|
+
params = { a:[1,2], b:{ c:3, d:[4,5], e:{ x:[6], y:7, z:[8,9] }, f:true, g:false, h:undefined }, i:[10,11], j:true, k:false, l:[undefined,0], m:"cowboy hat?" };
|
66
|
+
equal( jQuery.param(params), "a=1&a=2&b=%5Bobject+Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy+hat%3F", "huge structure" );
|
67
|
+
|
68
|
+
params = { "a": [ 0, [ 1, 2 ], [ 3, [ 4, 5 ], [ 6 ] ], { "b": [ 7, [ 8, 9 ], [ { "c": 10, d: 11 } ], [ [ 12 ] ], [ [ [ 13 ] ] ], { "e": { "f": { "g": [ 14, [ 15 ] ] } } }, 16 ] }, 17 ] };
|
69
|
+
equal( jQuery.param(params), "a=0&a=1%2C2&a=3%2C4%2C5%2C6&a=%5Bobject+Object%5D&a=17", "nested arrays (not possible when jQuery.param.traditional == true)" );
|
70
|
+
|
71
|
+
params = { a:[1,2], b:{ c:3, d:[4,5], e:{ x:[6], y:7, z:[8,9] }, f:true, g:false, h:undefined }, i:[10,11], j:true, k:false, l:[undefined,0], m:"cowboy hat?" };
|
72
|
+
equal( decodeURIComponent( jQuery.param(params,false) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy+hat?", "huge structure, forced not traditional" );
|
73
|
+
|
74
|
+
params = { "param1": null };
|
75
|
+
equal( jQuery.param(params,false), "param1=", "Make sure that null params aren't traversed." );
|
76
|
+
|
77
|
+
params = {"test": {"length": 3, "foo": "bar"} };
|
78
|
+
equal( jQuery.param( params, false ), "test%5Blength%5D=3&test%5Bfoo%5D=bar", "Sub-object with a length property" );
|
79
|
+
|
80
|
+
if ( jQuery.ajaxSettings === settings ) {
|
81
|
+
delete jQuery.ajaxSettings;
|
82
|
+
} else {
|
83
|
+
jQuery.ajaxSetup({ traditional: false });
|
84
|
+
}
|
85
|
+
});
|
86
|
+
|
87
|
+
test("jQuery.param() Constructed prop values", function() {
|
88
|
+
expect( 4 );
|
89
|
+
|
90
|
+
/** @constructor */
|
91
|
+
function Record() {
|
92
|
+
this["prop"] = "val";
|
93
|
+
}
|
94
|
+
|
95
|
+
var MyString = String,
|
96
|
+
MyNumber = Number,
|
97
|
+
params = { "test": new MyString("foo") };
|
98
|
+
|
99
|
+
equal( jQuery.param( params, false ), "test=foo", "Do not mistake new String() for a plain object" );
|
100
|
+
|
101
|
+
params = { "test": new MyNumber(5) };
|
102
|
+
equal( jQuery.param( params, false ), "test=5", "Do not mistake new Number() for a plain object" );
|
103
|
+
|
104
|
+
params = { "test": new Date() };
|
105
|
+
ok( jQuery.param( params, false ), "(Non empty string returned) Do not mistake new Date() for a plain object" );
|
106
|
+
|
107
|
+
// should allow non-native constructed objects
|
108
|
+
params = { "test": new Record() };
|
109
|
+
equal( jQuery.param( params, false ), jQuery.param({ "test": { "prop": "val" } }), "Allow non-native constructed objects" );
|
110
|
+
});
|
111
|
+
|
112
|
+
test("serialize()", function() {
|
113
|
+
expect(5);
|
114
|
+
|
115
|
+
// Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
|
116
|
+
jQuery("#search").after(
|
117
|
+
"<input type='email' id='html5email' name='email' value='dave@jquery.com' />" +
|
118
|
+
"<input type='number' id='html5number' name='number' value='43' />" +
|
119
|
+
"<input type='file' name='fileupload' />"
|
120
|
+
);
|
121
|
+
|
122
|
+
equal( jQuery("#form").serialize(),
|
123
|
+
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3",
|
124
|
+
"Check form serialization as query string");
|
125
|
+
|
126
|
+
equal( jQuery("input,select,textarea,button", "#form").serialize(),
|
127
|
+
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3",
|
128
|
+
"Check input serialization as query string");
|
129
|
+
|
130
|
+
equal( jQuery("#testForm").serialize(),
|
131
|
+
"T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
|
132
|
+
"Check form serialization as query string");
|
133
|
+
|
134
|
+
equal( jQuery("input,select,textarea,button", "#testForm").serialize(),
|
135
|
+
"T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
|
136
|
+
"Check input serialization as query string");
|
137
|
+
|
138
|
+
equal( jQuery("#form, #testForm").serialize(),
|
139
|
+
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
|
140
|
+
"Multiple form serialization as query string");
|
141
|
+
|
142
|
+
/* Temporarily disabled. Opera 10 has problems with form serialization.
|
143
|
+
equal( jQuery("#form, #testForm :input").serialize(),
|
144
|
+
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
|
145
|
+
"Mixed form/input serialization as query string");
|
146
|
+
*/
|
147
|
+
jQuery("#html5email, #html5number").remove();
|
148
|
+
});
|
@@ -0,0 +1,370 @@
|
|
1
|
+
module("support", { teardown: moduleTeardown });
|
2
|
+
|
3
|
+
test( "zoom of doom (#13089)", function() {
|
4
|
+
expect( 1 );
|
5
|
+
|
6
|
+
if ( jQuery.support.inlineBlockNeedsLayout ) {
|
7
|
+
ok( document.body.style.zoom, "Added a zoom to the body (#11048, #12869)" );
|
8
|
+
} else {
|
9
|
+
ok( !document.body.style.zoom, "No zoom added to the body" );
|
10
|
+
}
|
11
|
+
});
|
12
|
+
if ( jQuery.css ) {
|
13
|
+
testIframeWithCallback( "body background is not lost if set prior to loading jQuery (#9239)", "support/bodyBackground.html", function( color, support ) {
|
14
|
+
expect( 2 );
|
15
|
+
var okValue = {
|
16
|
+
"#000000": true,
|
17
|
+
"rgb(0, 0, 0)": true
|
18
|
+
};
|
19
|
+
ok( okValue[ color ], "color was not reset (" + color + ")" );
|
20
|
+
|
21
|
+
deepEqual( jQuery.extend( {}, support ), jQuery.support, "Same support properties" );
|
22
|
+
});
|
23
|
+
}
|
24
|
+
|
25
|
+
testIframeWithCallback( "A non-1 zoom on body doesn't cause WebKit to fail box-sizing test", "support/boxSizing.html", function( boxSizing ) {
|
26
|
+
expect( 1 );
|
27
|
+
equal( boxSizing, jQuery.support.boxSizing, "box-sizing properly detected on page with non-1 body zoom" );
|
28
|
+
});
|
29
|
+
|
30
|
+
testIframeWithCallback( "A background on the testElement does not cause IE8 to crash (#9823)", "support/testElementCrash.html", function() {
|
31
|
+
expect( 1 );
|
32
|
+
ok( true, "IE8 does not crash" );
|
33
|
+
});
|
34
|
+
|
35
|
+
testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlocks", "support/shrinkWrapBlocks.html", function( shrinkWrapBlocks ) {
|
36
|
+
expect( 1 );
|
37
|
+
strictEqual( shrinkWrapBlocks, jQuery.support.shrinkWrapBlocks, "jQuery.support.shrinkWrapBlocks properties are the same" );
|
38
|
+
});
|
39
|
+
|
40
|
+
(function() {
|
41
|
+
var expected,
|
42
|
+
userAgent = window.navigator.userAgent;
|
43
|
+
|
44
|
+
// These tests do not have to stay
|
45
|
+
// They are here to help with upcoming support changes for 1.8
|
46
|
+
if ( /chrome/i.test( userAgent ) ) {
|
47
|
+
expected = {
|
48
|
+
"leadingWhitespace":true,
|
49
|
+
"tbody":true,
|
50
|
+
"htmlSerialize":true,
|
51
|
+
"style":true,
|
52
|
+
"hrefNormalized":true,
|
53
|
+
"opacity":true,
|
54
|
+
"cssFloat":true,
|
55
|
+
"checkOn":true,
|
56
|
+
"optSelected":true,
|
57
|
+
"getSetAttribute":true,
|
58
|
+
"enctype":true,
|
59
|
+
"html5Clone":true,
|
60
|
+
"submitBubbles":true,
|
61
|
+
"changeBubbles":true,
|
62
|
+
"focusinBubbles":false,
|
63
|
+
"deleteExpando":true,
|
64
|
+
"noCloneEvent":true,
|
65
|
+
"inlineBlockNeedsLayout":false,
|
66
|
+
"shrinkWrapBlocks":false,
|
67
|
+
"reliableMarginRight":true,
|
68
|
+
"noCloneChecked":true,
|
69
|
+
"optDisabled":true,
|
70
|
+
"radioValue":true,
|
71
|
+
"checkClone":true,
|
72
|
+
"appendChecked":true,
|
73
|
+
"reliableHiddenOffsets":true,
|
74
|
+
"ajax":true,
|
75
|
+
"cors":true,
|
76
|
+
"clearCloneStyle": true,
|
77
|
+
"ownLast": false
|
78
|
+
};
|
79
|
+
} else if ( /opera.*version\/12\.1/i.test( userAgent ) ) {
|
80
|
+
expected = {
|
81
|
+
"leadingWhitespace":true,
|
82
|
+
"tbody":true,
|
83
|
+
"htmlSerialize":true,
|
84
|
+
"style":true,
|
85
|
+
"hrefNormalized":true,
|
86
|
+
"opacity":true,
|
87
|
+
"cssFloat":true,
|
88
|
+
"checkOn":true,
|
89
|
+
"optSelected":true,
|
90
|
+
"getSetAttribute":true,
|
91
|
+
"enctype":true,
|
92
|
+
"html5Clone":true,
|
93
|
+
"submitBubbles":true,
|
94
|
+
"changeBubbles":true,
|
95
|
+
"focusinBubbles":false,
|
96
|
+
"deleteExpando":true,
|
97
|
+
"noCloneEvent":true,
|
98
|
+
"inlineBlockNeedsLayout":false,
|
99
|
+
"shrinkWrapBlocks":false,
|
100
|
+
"reliableMarginRight":true,
|
101
|
+
"noCloneChecked":true,
|
102
|
+
"optDisabled":true,
|
103
|
+
"radioValue":false,
|
104
|
+
"checkClone":true,
|
105
|
+
"appendChecked":true,
|
106
|
+
"reliableHiddenOffsets":true,
|
107
|
+
"ajax":true,
|
108
|
+
"cors":true,
|
109
|
+
"clearCloneStyle": true,
|
110
|
+
"ownLast": false
|
111
|
+
};
|
112
|
+
} else if ( /msie 10\.0/i.test( userAgent ) ) {
|
113
|
+
expected = {
|
114
|
+
"leadingWhitespace":true,
|
115
|
+
"tbody":true,
|
116
|
+
"htmlSerialize":true,
|
117
|
+
"style":true,
|
118
|
+
"hrefNormalized":true,
|
119
|
+
"opacity":true,
|
120
|
+
"cssFloat":true,
|
121
|
+
"checkOn":true,
|
122
|
+
"optSelected":false,
|
123
|
+
"getSetAttribute":true,
|
124
|
+
"enctype":true,
|
125
|
+
"html5Clone":true,
|
126
|
+
"submitBubbles":true,
|
127
|
+
"changeBubbles":true,
|
128
|
+
"focusinBubbles":true,
|
129
|
+
"deleteExpando":true,
|
130
|
+
"noCloneEvent":true,
|
131
|
+
"inlineBlockNeedsLayout":false,
|
132
|
+
"shrinkWrapBlocks":false,
|
133
|
+
"reliableMarginRight":true,
|
134
|
+
"noCloneChecked":false,
|
135
|
+
"optDisabled":true,
|
136
|
+
"radioValue":false,
|
137
|
+
"checkClone":true,
|
138
|
+
"appendChecked":true,
|
139
|
+
"reliableHiddenOffsets":true,
|
140
|
+
"ajax":true,
|
141
|
+
"cors":true,
|
142
|
+
"clearCloneStyle": false,
|
143
|
+
"ownLast": false
|
144
|
+
};
|
145
|
+
} else if ( /msie 9\.0/i.test( userAgent ) ) {
|
146
|
+
expected = {
|
147
|
+
"leadingWhitespace":true,
|
148
|
+
"tbody":true,
|
149
|
+
"htmlSerialize":true,
|
150
|
+
"style":true,
|
151
|
+
"hrefNormalized":true,
|
152
|
+
"opacity":true,
|
153
|
+
"cssFloat":true,
|
154
|
+
"checkOn":true,
|
155
|
+
"optSelected":false,
|
156
|
+
"getSetAttribute":true,
|
157
|
+
"enctype":true,
|
158
|
+
"html5Clone":true,
|
159
|
+
"submitBubbles":true,
|
160
|
+
"changeBubbles":true,
|
161
|
+
"focusinBubbles":true,
|
162
|
+
"deleteExpando":true,
|
163
|
+
"noCloneEvent":true,
|
164
|
+
"inlineBlockNeedsLayout":false,
|
165
|
+
"shrinkWrapBlocks":false,
|
166
|
+
"reliableMarginRight":true,
|
167
|
+
"noCloneChecked":false,
|
168
|
+
"optDisabled":true,
|
169
|
+
"radioValue":false,
|
170
|
+
"checkClone":true,
|
171
|
+
"appendChecked":true,
|
172
|
+
"reliableHiddenOffsets":true,
|
173
|
+
"ajax":true,
|
174
|
+
"cors":false,
|
175
|
+
"clearCloneStyle": false,
|
176
|
+
"ownLast": false
|
177
|
+
};
|
178
|
+
} else if ( /msie 8\.0/i.test( userAgent ) ) {
|
179
|
+
expected = {
|
180
|
+
"leadingWhitespace":false,
|
181
|
+
"tbody":true,
|
182
|
+
"htmlSerialize":false,
|
183
|
+
"style":false,
|
184
|
+
"hrefNormalized":true,
|
185
|
+
"opacity":false,
|
186
|
+
"cssFloat":false,
|
187
|
+
"checkOn":true,
|
188
|
+
"optSelected":false,
|
189
|
+
"getSetAttribute":true,
|
190
|
+
"enctype":true,
|
191
|
+
"html5Clone":false,
|
192
|
+
"submitBubbles":false,
|
193
|
+
"changeBubbles":false,
|
194
|
+
"focusinBubbles":true,
|
195
|
+
"deleteExpando":false,
|
196
|
+
"noCloneEvent":false,
|
197
|
+
"inlineBlockNeedsLayout":false,
|
198
|
+
"shrinkWrapBlocks":false,
|
199
|
+
"reliableMarginRight":true,
|
200
|
+
"noCloneChecked":false,
|
201
|
+
"optDisabled":true,
|
202
|
+
"radioValue":false,
|
203
|
+
"checkClone":true,
|
204
|
+
"appendChecked":true,
|
205
|
+
"reliableHiddenOffsets":false,
|
206
|
+
"ajax":true,
|
207
|
+
"cors":false,
|
208
|
+
"clearCloneStyle": true,
|
209
|
+
"ownLast": true
|
210
|
+
};
|
211
|
+
} else if ( /msie 7\.0/i.test( userAgent ) ) {
|
212
|
+
expected = {
|
213
|
+
"ajax": true,
|
214
|
+
"appendChecked": false,
|
215
|
+
"changeBubbles": false,
|
216
|
+
"checkClone": false,
|
217
|
+
"checkOn": true,
|
218
|
+
"cors": false,
|
219
|
+
"cssFloat": false,
|
220
|
+
"deleteExpando": false,
|
221
|
+
"enctype": true,
|
222
|
+
"focusinBubbles": true,
|
223
|
+
"getSetAttribute": false,
|
224
|
+
"hrefNormalized": false,
|
225
|
+
"html5Clone": false,
|
226
|
+
"htmlSerialize": false,
|
227
|
+
"inlineBlockNeedsLayout": true,
|
228
|
+
"leadingWhitespace": false,
|
229
|
+
"noCloneChecked": false,
|
230
|
+
"noCloneEvent": false,
|
231
|
+
"opacity": false,
|
232
|
+
"optDisabled": true,
|
233
|
+
"optSelected": false,
|
234
|
+
"radioValue": false,
|
235
|
+
"reliableHiddenOffsets": false,
|
236
|
+
"reliableMarginRight": true,
|
237
|
+
"shrinkWrapBlocks": false,
|
238
|
+
"submitBubbles": false,
|
239
|
+
"tbody": false,
|
240
|
+
"style": false,
|
241
|
+
"clearCloneStyle": true,
|
242
|
+
"ownLast": true
|
243
|
+
};
|
244
|
+
} else if ( /msie 6\.0/i.test( userAgent ) ) {
|
245
|
+
expected = {
|
246
|
+
"leadingWhitespace":false,
|
247
|
+
"tbody":false,
|
248
|
+
"htmlSerialize":false,
|
249
|
+
"style":false,
|
250
|
+
"hrefNormalized":false,
|
251
|
+
"opacity":false,
|
252
|
+
"cssFloat":false,
|
253
|
+
"checkOn":true,
|
254
|
+
"optSelected":false,
|
255
|
+
"getSetAttribute":false,
|
256
|
+
"enctype":true,
|
257
|
+
"html5Clone":false,
|
258
|
+
"submitBubbles":false,
|
259
|
+
"changeBubbles":false,
|
260
|
+
"focusinBubbles":true,
|
261
|
+
"deleteExpando":false,
|
262
|
+
"noCloneEvent":false,
|
263
|
+
"inlineBlockNeedsLayout":true,
|
264
|
+
"shrinkWrapBlocks":true,
|
265
|
+
"reliableMarginRight":true,
|
266
|
+
"noCloneChecked":false,
|
267
|
+
"optDisabled":true,
|
268
|
+
"radioValue":false,
|
269
|
+
"checkClone":false,
|
270
|
+
"appendChecked":false,
|
271
|
+
"reliableHiddenOffsets":false,
|
272
|
+
"ajax":true,
|
273
|
+
"cors":false,
|
274
|
+
"clearCloneStyle": true,
|
275
|
+
"ownLast": true
|
276
|
+
};
|
277
|
+
} else if ( /5\.1\.1 safari/i.test( userAgent ) ) {
|
278
|
+
expected = {
|
279
|
+
"leadingWhitespace":true,
|
280
|
+
"tbody":true,
|
281
|
+
"htmlSerialize":true,
|
282
|
+
"style":true,
|
283
|
+
"hrefNormalized":true,
|
284
|
+
"opacity":true,
|
285
|
+
"cssFloat":true,
|
286
|
+
"checkOn":false,
|
287
|
+
"optSelected":true,
|
288
|
+
"getSetAttribute":true,
|
289
|
+
"enctype":true,
|
290
|
+
"html5Clone":true,
|
291
|
+
"submitBubbles":true,
|
292
|
+
"changeBubbles":true,
|
293
|
+
"focusinBubbles":false,
|
294
|
+
"deleteExpando":true,
|
295
|
+
"noCloneEvent":true,
|
296
|
+
"inlineBlockNeedsLayout":false,
|
297
|
+
"shrinkWrapBlocks":false,
|
298
|
+
"reliableMarginRight":true,
|
299
|
+
"noCloneChecked":true,
|
300
|
+
"optDisabled":true,
|
301
|
+
"radioValue":true,
|
302
|
+
"checkClone":false,
|
303
|
+
"appendChecked":false,
|
304
|
+
"reliableHiddenOffsets":true,
|
305
|
+
"ajax":true,
|
306
|
+
"cors":true,
|
307
|
+
"clearCloneStyle": true,
|
308
|
+
"ownLast": false
|
309
|
+
};
|
310
|
+
} else if ( /firefox/i.test( userAgent ) ) {
|
311
|
+
expected = {
|
312
|
+
"leadingWhitespace":true,
|
313
|
+
"tbody":true,
|
314
|
+
"htmlSerialize":true,
|
315
|
+
"style":true,
|
316
|
+
"hrefNormalized":true,
|
317
|
+
"opacity":true,
|
318
|
+
"cssFloat":true,
|
319
|
+
"checkOn":true,
|
320
|
+
"optSelected":true,
|
321
|
+
"getSetAttribute":true,
|
322
|
+
"enctype":true,
|
323
|
+
"html5Clone":true,
|
324
|
+
"submitBubbles":true,
|
325
|
+
"changeBubbles":true,
|
326
|
+
"focusinBubbles":false,
|
327
|
+
"deleteExpando":true,
|
328
|
+
"noCloneEvent":true,
|
329
|
+
"inlineBlockNeedsLayout":false,
|
330
|
+
"shrinkWrapBlocks":false,
|
331
|
+
"reliableMarginRight":true,
|
332
|
+
"noCloneChecked":true,
|
333
|
+
"optDisabled":true,
|
334
|
+
"radioValue":true,
|
335
|
+
"checkClone":true,
|
336
|
+
"appendChecked":true,
|
337
|
+
"reliableHiddenOffsets":true,
|
338
|
+
"ajax":true,
|
339
|
+
"cors":true,
|
340
|
+
"clearCloneStyle": true,
|
341
|
+
"ownLast": false
|
342
|
+
};
|
343
|
+
}
|
344
|
+
|
345
|
+
if ( expected ) {
|
346
|
+
test("Verify that the support tests resolve as expected per browser", function() {
|
347
|
+
expect( 30 );
|
348
|
+
|
349
|
+
for ( var i in expected ) {
|
350
|
+
if ( jQuery.ajax || i !== "ajax" && i !== "cors" ) {
|
351
|
+
equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);
|
352
|
+
} else {
|
353
|
+
ok( true, "no ajax; skipping jQuery.support['" + i + "']" );
|
354
|
+
}
|
355
|
+
}
|
356
|
+
});
|
357
|
+
}
|
358
|
+
|
359
|
+
})();
|
360
|
+
|
361
|
+
// Support: Safari 5.1
|
362
|
+
// Shameless browser-sniff, but Safari 5.1 mishandles CSP
|
363
|
+
if ( !( typeof navigator !== "undefined" &&
|
364
|
+
(/ AppleWebKit\/\d.*? Version\/(\d+)/.exec(navigator.userAgent) || [])[1] < 6 ) ) {
|
365
|
+
|
366
|
+
testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions", "support/csp.php", function( support ) {
|
367
|
+
expect( 1 );
|
368
|
+
deepEqual( jQuery.extend( {}, support ), jQuery.support, "No violations of CSP polices" );
|
369
|
+
});
|
370
|
+
}
|