wpa_cli_web 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.bowerrc +3 -0
- data/lib/wpa_cli_web.rb +19 -31
- data/lib/wpa_cli_web/public/bower_components/house-style/.bower.json +14 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/.bowerrc +3 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/.gitignore +2 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/Gemfile +6 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/Gruntfile.js +99 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/Guardfile +19 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/bower.json +7 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/LICENSE.md +19 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/README.md +49 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/bower.json +23 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/normalize.css +396 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/house-style.css +860 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/house-style.min.css +1 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/base/base.css +37 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/button/button.css +26 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/grid.css +151 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/grid.png +0 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/images.html +208 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/index.html +141 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/loading/index.html +22 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/loading/loading.css +41 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/loading/spinner.svg +11 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/masthead/bbc-blocks-white.png +0 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/masthead/index.html +20 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/masthead/masthead.css +23 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/panel/panel.css +71 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/project-header/index.html +22 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/project-header/project-header.css +37 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/table/index.html +26 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/table/table.css +6 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/modules/transitions/transitions.css +11 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/package.json +21 -0
- data/lib/wpa_cli_web/public/bower_components/house-style/vendor/prefixfree.min.js +5 -0
- data/lib/wpa_cli_web/public/bower_components/normalize-css/.bower.json +21 -0
- data/lib/wpa_cli_web/public/bower_components/normalize-css/LICENSE.md +19 -0
- data/lib/wpa_cli_web/public/bower_components/normalize-css/README.md +49 -0
- data/lib/wpa_cli_web/public/bower_components/normalize-css/bower.json +12 -0
- data/lib/wpa_cli_web/public/bower_components/normalize-css/normalize.css +396 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/.bower.json +14 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/.gitignore +3 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/.travis.yml +10 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/LICENSE +7 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/Makefile +6 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/README.md +167 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/config/smoosh.json +35 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/integration/ender.js +1033 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/integration/integration.html +26 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/mobile/ender.js +62 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/mobile/package.json +14 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/mobile/qwery-mobile.js +79 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/mobile/qwery-mobile.min.js +7 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/mobile/src/mobile.js +72 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/package.json +25 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/package.json +17 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/qwery-pseudos.js +106 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/qwery-pseudos.min.js +7 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/src/pseudos.js +99 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/qwery.js +369 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/qwery.min.js +7 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/src/copyright.js +6 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/src/ender.js +62 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/src/qwery.js +362 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/tests/W3C-Selector-tests.html +1372 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/tests/benchmarks.html +220 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/tests/index.html +132 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/tests/mobile.html +58 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/tests/phantom.js +43 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/tests/test-env.js +25 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/tests/tests.js +533 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/vendor/nw.js +1680 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/vendor/sink.css +79 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/vendor/sink.js +181 -0
- data/lib/wpa_cli_web/public/bower_components/qwery/vendor/sizzle.js +1400 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/.bower.json +14 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/.gitignore +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/.jshintrc +61 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/Makefile +8 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/README.md +308 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/build.json +74 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/make/tests.js +89 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/package.json +27 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/reqwest.js +565 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/reqwest.min.js +7 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/src/copyright.js +6 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/src/ender.js +26 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/src/reqwest.js +559 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/ender.js +117 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/badfixtures.xml +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.html +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.js +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.json +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.xml +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp.jsonp +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp2.jsonp +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp3.jsonp +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp_multi.jsonp +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp_multi_b.jsonp +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp_multi_c.jsonp +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_with_prefix.json +1 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/invalidJSON.json +5 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/tests.html +105 -0
- data/lib/wpa_cli_web/public/bower_components/reqwest/tests/tests.js +1723 -0
- data/lib/wpa_cli_web/views/access_points.erb +5 -0
- data/lib/wpa_cli_web/views/access_points_list.erb +19 -0
- data/lib/wpa_cli_web/views/layout.erb +141 -0
- data/lib/wpa_cli_web/views/networks_edit.erb +15 -0
- data/lib/wpa_cli_web/views/restart.erb +7 -0
- data/lib/wpa_cli_web/views/restarting.erb +14 -0
- data/wpa_cli_web.gemspec +1 -1
- metadata +111 -2
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"name": "reqwest",
|
3
|
+
"homepage": "https://github.com/ded/reqwest",
|
4
|
+
"version": "0.8.3",
|
5
|
+
"_release": "0.8.3",
|
6
|
+
"_resolution": {
|
7
|
+
"type": "version",
|
8
|
+
"tag": "0.8.3",
|
9
|
+
"commit": "3b5402a5c7ff77ef47dc62ee6bef94ea34d69800"
|
10
|
+
},
|
11
|
+
"_source": "git://github.com/ded/reqwest.git",
|
12
|
+
"_target": "~0.8.3",
|
13
|
+
"_direct": true
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
node_modules
|
@@ -0,0 +1,61 @@
|
|
1
|
+
{
|
2
|
+
"predef": [ "define", "ActiveXObject" ]
|
3
|
+
, "bitwise": true
|
4
|
+
, "camelcase": false
|
5
|
+
, "curly": false
|
6
|
+
, "eqeqeq": false
|
7
|
+
, "forin": false
|
8
|
+
, "immed": false
|
9
|
+
, "latedef": false
|
10
|
+
, "newcap": true
|
11
|
+
, "noarg": true
|
12
|
+
, "noempty": true
|
13
|
+
, "nonew": true
|
14
|
+
, "plusplus": false
|
15
|
+
, "quotmark": true
|
16
|
+
, "regexp": false
|
17
|
+
, "undef": true
|
18
|
+
, "unused": true
|
19
|
+
, "strict": false
|
20
|
+
, "trailing": true
|
21
|
+
, "maxlen": 120
|
22
|
+
, "asi": true
|
23
|
+
, "boss": true
|
24
|
+
, "debug": true
|
25
|
+
, "eqnull": true
|
26
|
+
, "es5": true
|
27
|
+
, "esnext": true
|
28
|
+
, "evil": true
|
29
|
+
, "expr": true
|
30
|
+
, "funcscope": false
|
31
|
+
, "globalstrict": false
|
32
|
+
, "iterator": false
|
33
|
+
, "lastsemic": true
|
34
|
+
, "laxbreak": true
|
35
|
+
, "laxcomma": true
|
36
|
+
, "loopfunc": true
|
37
|
+
, "multistr": false
|
38
|
+
, "onecase": false
|
39
|
+
, "proto": false
|
40
|
+
, "regexdash": false
|
41
|
+
, "scripturl": true
|
42
|
+
, "smarttabs": false
|
43
|
+
, "shadow": false
|
44
|
+
, "sub": true
|
45
|
+
, "supernew": false
|
46
|
+
, "validthis": true
|
47
|
+
, "browser": true
|
48
|
+
, "couch": false
|
49
|
+
, "devel": false
|
50
|
+
, "dojo": false
|
51
|
+
, "mootools": false
|
52
|
+
, "node": true
|
53
|
+
, "nonstandard": true
|
54
|
+
, "prototypejs": false
|
55
|
+
, "rhino": false
|
56
|
+
, "worker": true
|
57
|
+
, "wsh": false
|
58
|
+
, "nomen": false
|
59
|
+
, "onevar": true
|
60
|
+
, "passfail": false
|
61
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
.PHONY: boosh test
|
2
|
+
|
3
|
+
boosh:
|
4
|
+
@node -e "var json = require('./build');json.JSHINT_OPTS=JSON.parse(require('fs').readFileSync('./.jshintrc'));require('fs').writeFileSync('./build.json', JSON.stringify(json, null, 2))"
|
5
|
+
@node_modules/smoosh/bin/smoosh make build.json
|
6
|
+
|
7
|
+
test:
|
8
|
+
npm test
|
@@ -0,0 +1,308 @@
|
|
1
|
+
# It's AJAX
|
2
|
+
|
3
|
+
All over again. Includes support for xmlHttpRequest, JSONP, CORS, and CommonJS Promises A.
|
4
|
+
|
5
|
+
The happs
|
6
|
+
---------
|
7
|
+
|
8
|
+
``` sh
|
9
|
+
$ git clone git://github.com/ded/reqwest.git reqwest
|
10
|
+
$ cd !$
|
11
|
+
$ npm install
|
12
|
+
$ make
|
13
|
+
```
|
14
|
+
|
15
|
+
API
|
16
|
+
---------
|
17
|
+
|
18
|
+
``` js
|
19
|
+
reqwest('path/to/html', function (resp) {
|
20
|
+
qwery('#content').html(resp)
|
21
|
+
})
|
22
|
+
```
|
23
|
+
|
24
|
+
``` js
|
25
|
+
reqwest({
|
26
|
+
url: 'path/to/html'
|
27
|
+
, method: 'post'
|
28
|
+
, data: { foo: 'bar', baz: 100 }
|
29
|
+
, success: function (resp) {
|
30
|
+
qwery('#content').html(resp)
|
31
|
+
}
|
32
|
+
})
|
33
|
+
```
|
34
|
+
|
35
|
+
``` js
|
36
|
+
reqwest({
|
37
|
+
url: 'path/to/html'
|
38
|
+
, method: 'get'
|
39
|
+
, data: { [ name: 'foo', value: 'bar' ], [ name: 'baz', value: 100 ] }
|
40
|
+
, success: function (resp) {
|
41
|
+
qwery('#content').html(resp)
|
42
|
+
}
|
43
|
+
})
|
44
|
+
```
|
45
|
+
|
46
|
+
``` js
|
47
|
+
reqwest({
|
48
|
+
url: 'path/to/json'
|
49
|
+
, type: 'json'
|
50
|
+
, method: 'post'
|
51
|
+
, error: function (err) { }
|
52
|
+
, success: function (resp) {
|
53
|
+
qwery('#content').html(resp.content)
|
54
|
+
}
|
55
|
+
})
|
56
|
+
```
|
57
|
+
|
58
|
+
``` js
|
59
|
+
reqwest({
|
60
|
+
url: 'path/to/json'
|
61
|
+
, type: 'json'
|
62
|
+
, method: 'post'
|
63
|
+
, contentType: 'application/json'
|
64
|
+
, headers: {
|
65
|
+
'X-My-Custom-Header': 'SomethingImportant'
|
66
|
+
}
|
67
|
+
, error: function (err) { }
|
68
|
+
, success: function (resp) {
|
69
|
+
qwery('#content').html(resp.content)
|
70
|
+
}
|
71
|
+
})
|
72
|
+
```
|
73
|
+
|
74
|
+
``` js
|
75
|
+
|
76
|
+
// Uses XMLHttpRequest2 credentialled requests (cookies, HTTP basic auth) if supported
|
77
|
+
|
78
|
+
reqwest({
|
79
|
+
url: 'path/to/json'
|
80
|
+
, type: 'json'
|
81
|
+
, method: 'post'
|
82
|
+
, contentType: 'application/json'
|
83
|
+
, crossOrigin: true
|
84
|
+
, withCredentials: true
|
85
|
+
, error: function (err) { }
|
86
|
+
, success: function (resp) {
|
87
|
+
qwery('#content').html(resp.content)
|
88
|
+
}
|
89
|
+
})
|
90
|
+
```
|
91
|
+
|
92
|
+
``` js
|
93
|
+
reqwest({
|
94
|
+
url: 'path/to/data.jsonp?callback=?'
|
95
|
+
, type: 'jsonp'
|
96
|
+
, success: function (resp) {
|
97
|
+
qwery('#content').html(resp.content)
|
98
|
+
}
|
99
|
+
})
|
100
|
+
```
|
101
|
+
|
102
|
+
``` js
|
103
|
+
reqwest({
|
104
|
+
url: 'path/to/data.jsonp?foo=bar'
|
105
|
+
, type: 'jsonp'
|
106
|
+
, jsonpCallback: 'foo'
|
107
|
+
, jsonpCallbackName: 'bar'
|
108
|
+
, success: function (resp) {
|
109
|
+
qwery('#content').html(resp.content)
|
110
|
+
}
|
111
|
+
})
|
112
|
+
```
|
113
|
+
|
114
|
+
``` js
|
115
|
+
reqwest({
|
116
|
+
url: 'path/to/data.jsonp?foo=bar'
|
117
|
+
, type: 'jsonp'
|
118
|
+
, jsonpCallback: 'foo'
|
119
|
+
, success: function (resp) {
|
120
|
+
qwery('#content').html(resp.content)
|
121
|
+
}
|
122
|
+
, complete: function (resp) {
|
123
|
+
qwery('#hide-this').hide()
|
124
|
+
}
|
125
|
+
})
|
126
|
+
```
|
127
|
+
|
128
|
+
## Promises
|
129
|
+
|
130
|
+
``` js
|
131
|
+
reqwest({
|
132
|
+
url: 'path/to/data.jsonp?foo=bar'
|
133
|
+
, type: 'jsonp'
|
134
|
+
, jsonpCallback: 'foo'
|
135
|
+
})
|
136
|
+
.then(function (resp) {
|
137
|
+
qwery('#content').html(resp.content)
|
138
|
+
}, function (err, msg) {
|
139
|
+
qwery('#errors').html(msg)
|
140
|
+
})
|
141
|
+
.always(function (resp) {
|
142
|
+
qwery('#hide-this').hide()
|
143
|
+
})
|
144
|
+
```
|
145
|
+
|
146
|
+
``` js
|
147
|
+
reqwest({
|
148
|
+
url: 'path/to/data.jsonp?foo=bar'
|
149
|
+
, type: 'jsonp'
|
150
|
+
, jsonpCallback: 'foo'
|
151
|
+
})
|
152
|
+
.then(function (resp) {
|
153
|
+
qwery('#content').html(resp.content)
|
154
|
+
})
|
155
|
+
.fail(function (err, msg) {
|
156
|
+
qwery('#errors').html(msg)
|
157
|
+
})
|
158
|
+
.always(function (resp) {
|
159
|
+
qwery('#hide-this').hide()
|
160
|
+
})
|
161
|
+
```
|
162
|
+
|
163
|
+
``` js
|
164
|
+
var r = reqwest({
|
165
|
+
url: 'path/to/data.jsonp?foo=bar'
|
166
|
+
, type: 'jsonp'
|
167
|
+
, jsonpCallback: 'foo'
|
168
|
+
, success: function () {
|
169
|
+
setTimeout(function () {
|
170
|
+
r
|
171
|
+
.then(function (resp) {
|
172
|
+
qwery('#content').html(resp.content)
|
173
|
+
}, function (err) { })
|
174
|
+
.always(function (resp) {
|
175
|
+
qwery('#hide-this').hide()
|
176
|
+
})
|
177
|
+
}, 15)
|
178
|
+
}
|
179
|
+
})
|
180
|
+
```
|
181
|
+
|
182
|
+
|
183
|
+
The Tests
|
184
|
+
---------
|
185
|
+
$ npm test
|
186
|
+
|
187
|
+
Browser support
|
188
|
+
---------------
|
189
|
+
* IE6+
|
190
|
+
* Chrome 1+
|
191
|
+
* Safari 3+
|
192
|
+
* Firefox 1+
|
193
|
+
* Opera
|
194
|
+
|
195
|
+
Ender Support
|
196
|
+
-------------
|
197
|
+
Reqwest can be used as an [Ender](http://ender.no.de) module. Add it to your existing build as such:
|
198
|
+
|
199
|
+
$ ender add reqwest
|
200
|
+
|
201
|
+
Use it as such:
|
202
|
+
|
203
|
+
``` js
|
204
|
+
$.ajax({ ... })
|
205
|
+
```
|
206
|
+
|
207
|
+
Serialize things:
|
208
|
+
|
209
|
+
``` js
|
210
|
+
$(form).serialize() // returns query string -> x=y&...
|
211
|
+
$(form).serialize({type:'array'}) // returns array name/value pairs -> [ { name: x, value: y}, ... ]
|
212
|
+
$(form).serialize({type:'map'}) // returns an object representation -> { x: y, ... }
|
213
|
+
$(form).serializeArray()
|
214
|
+
$.toQueryString({
|
215
|
+
foo: 'bar'
|
216
|
+
, baz: 'thunk'
|
217
|
+
}) // returns query string -> foo=bar&baz=thunk
|
218
|
+
```
|
219
|
+
|
220
|
+
Or, get a bit fancy:
|
221
|
+
|
222
|
+
``` js
|
223
|
+
$('#myform input[name=myradios]').serialize({type:'map'})['myradios'] // get the selected value
|
224
|
+
$('input[type=text],#specialthing').serialize() // turn any arbitrary set of form elements into a query string
|
225
|
+
```
|
226
|
+
|
227
|
+
ajaxSetup
|
228
|
+
---------
|
229
|
+
|
230
|
+
Use the `request.ajaxSetup` to predefine a data filter on all requests. See the example below that demonstrates JSON hijacking prevention:
|
231
|
+
|
232
|
+
``` js
|
233
|
+
$.ajaxSetup({
|
234
|
+
dataFilter: function (response, type) {
|
235
|
+
if (type == 'json') return response.substring('])}while(1);</x>'.length)
|
236
|
+
else return response
|
237
|
+
}
|
238
|
+
})
|
239
|
+
```
|
240
|
+
|
241
|
+
RequireJs and Jam
|
242
|
+
------------------
|
243
|
+
Reqwest can also be used with RequireJs and can be installed via jam
|
244
|
+
|
245
|
+
```
|
246
|
+
jam install reqwest
|
247
|
+
```
|
248
|
+
|
249
|
+
```js
|
250
|
+
define(function(require){
|
251
|
+
var reqwest = require('reqwest');
|
252
|
+
});
|
253
|
+
```
|
254
|
+
|
255
|
+
|
256
|
+
jQuery and Zepto Compatibility
|
257
|
+
------------------------------
|
258
|
+
There are some differences between the *Reqwest way* and the
|
259
|
+
*jQuery/Zepto way*.
|
260
|
+
|
261
|
+
### method ###
|
262
|
+
jQuery/Zepto use `type` to specify the request method while Reqwest uses
|
263
|
+
`method` and reserves `type` for the response data type.
|
264
|
+
|
265
|
+
### dataType ###
|
266
|
+
When using jQuery/Zepto you use the `dataType` option to specify the type
|
267
|
+
of data to expect from the server, Reqwest uses `type`. jQuery also can
|
268
|
+
also take a space-separated list of data types to specify the request,
|
269
|
+
response and response-conversion types but Reqwest uses the `type`
|
270
|
+
parameter to infer the response type and leaves conversion up to you.
|
271
|
+
|
272
|
+
### JSONP ###
|
273
|
+
Reqwest also takes optional `jsonpCallback` and `jsonpCallbackName`
|
274
|
+
options to specify the callback query-string key and the callback function
|
275
|
+
name respectively while jQuery uses `jsonp` and `jsonpCallback` for
|
276
|
+
these same options.
|
277
|
+
|
278
|
+
|
279
|
+
But fear not! If you must work the jQuery/Zepto way then Reqwest has
|
280
|
+
a wrapper that will remap these options for you:
|
281
|
+
|
282
|
+
```js
|
283
|
+
reqwest.compat({
|
284
|
+
url: 'path/to/data.jsonp?foo=bar'
|
285
|
+
, dataType: 'jsonp'
|
286
|
+
, jsonp: 'foo'
|
287
|
+
, jsonpCallback: 'bar'
|
288
|
+
, success: function (resp) {
|
289
|
+
qwery('#content').html(resp.content)
|
290
|
+
}
|
291
|
+
})
|
292
|
+
|
293
|
+
// or from Ender:
|
294
|
+
|
295
|
+
$.ajax.compat({
|
296
|
+
...
|
297
|
+
})
|
298
|
+
```
|
299
|
+
|
300
|
+
If you want to install jQuery/Zepto compatibility mode as the default
|
301
|
+
then simply place this snippet at the top of your code:
|
302
|
+
|
303
|
+
```js
|
304
|
+
$.ajax.compat && $.ender({ ajax: $.ajax.compat });
|
305
|
+
```
|
306
|
+
|
307
|
+
|
308
|
+
**Happy Ajaxing!**
|
@@ -0,0 +1,74 @@
|
|
1
|
+
{
|
2
|
+
"YO": "This file is built by the Makefile, your edits may not be saved on build",
|
3
|
+
"JAVASCRIPT": {
|
4
|
+
"DIST_DIR": "./",
|
5
|
+
"reqwest": [
|
6
|
+
"src/copyright.js",
|
7
|
+
"src/reqwest.js"
|
8
|
+
]
|
9
|
+
},
|
10
|
+
"JSHINT_OPTS": {
|
11
|
+
"predef": [
|
12
|
+
"define",
|
13
|
+
"ActiveXObject"
|
14
|
+
],
|
15
|
+
"bitwise": true,
|
16
|
+
"camelcase": false,
|
17
|
+
"curly": false,
|
18
|
+
"eqeqeq": false,
|
19
|
+
"forin": false,
|
20
|
+
"immed": false,
|
21
|
+
"latedef": false,
|
22
|
+
"newcap": true,
|
23
|
+
"noarg": true,
|
24
|
+
"noempty": true,
|
25
|
+
"nonew": true,
|
26
|
+
"plusplus": false,
|
27
|
+
"quotmark": true,
|
28
|
+
"regexp": false,
|
29
|
+
"undef": true,
|
30
|
+
"unused": true,
|
31
|
+
"strict": false,
|
32
|
+
"trailing": true,
|
33
|
+
"maxlen": 120,
|
34
|
+
"asi": true,
|
35
|
+
"boss": true,
|
36
|
+
"debug": true,
|
37
|
+
"eqnull": true,
|
38
|
+
"es5": true,
|
39
|
+
"esnext": true,
|
40
|
+
"evil": true,
|
41
|
+
"expr": true,
|
42
|
+
"funcscope": false,
|
43
|
+
"globalstrict": false,
|
44
|
+
"iterator": false,
|
45
|
+
"lastsemic": true,
|
46
|
+
"laxbreak": true,
|
47
|
+
"laxcomma": true,
|
48
|
+
"loopfunc": true,
|
49
|
+
"multistr": false,
|
50
|
+
"onecase": false,
|
51
|
+
"proto": false,
|
52
|
+
"regexdash": false,
|
53
|
+
"scripturl": true,
|
54
|
+
"smarttabs": false,
|
55
|
+
"shadow": false,
|
56
|
+
"sub": true,
|
57
|
+
"supernew": false,
|
58
|
+
"validthis": true,
|
59
|
+
"browser": true,
|
60
|
+
"couch": false,
|
61
|
+
"devel": false,
|
62
|
+
"dojo": false,
|
63
|
+
"mootools": false,
|
64
|
+
"node": true,
|
65
|
+
"nonstandard": true,
|
66
|
+
"prototypejs": false,
|
67
|
+
"rhino": false,
|
68
|
+
"worker": true,
|
69
|
+
"wsh": false,
|
70
|
+
"nomen": false,
|
71
|
+
"onevar": true,
|
72
|
+
"passfail": false
|
73
|
+
}
|
74
|
+
}
|