motoko 1.0.1 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
package/.npmignore DELETED
@@ -1,2 +0,0 @@
1
- .stage
2
- .release.json
package/motoko.js DELETED
@@ -1,57 +0,0 @@
1
- ;(function (context) {
2
- var ajaxPlugin = function ajaxPlugin (iface, sepuku) {
3
- var _xhr = null;
4
-
5
- function handleDestroy () {
6
- iface.write(null, "abort");
7
- sepuku();
8
- }
9
-
10
- function _isActive () {
11
- return _xhr && _xhr.readyState && _xhr.readyState !== 4;
12
- }
13
-
14
- function abort () {
15
- if (_isActive())
16
- _xhr.abort();
17
- }
18
-
19
- function request (_settings) {
20
- iface.write("busy", "condition");
21
-
22
- var settings = {};
23
-
24
- settings.data = _settings.data || _settings.params;
25
- settings.url = _settings.resolvedUrl;
26
- settings.type = _settings.method || _settings.verb || 'GET';
27
- settings.dataType = _settings.accept || _settings.type || _settings.format || "html";
28
- settings.contentType = _settings.contentType || "json";
29
- settings.headers = _settings.headers;
30
- settings.timeout = _settings.timeout || 10000;
31
-
32
- _xhr = jQuery.ajax(settings)
33
- .done(function (resp) {
34
- iface.write("done", "condition");
35
- iface.write(resp);
36
- iface.write(resp, "done");
37
-
38
- }).fail(function (err) {
39
- iface.write("error", "condition");
40
- iface.write(err, "error");
41
- })
42
- }
43
-
44
- iface.on("abort").run(abort);
45
- iface.on("do_request").run(request);
46
- iface.on("destroy").run(handleDestroy);
47
- }
48
-
49
- if (context.seele) {
50
- context.seele.register("ajax", ajaxPlugin);
51
- } else if (context.require) {
52
- // stuff
53
- } else if (context.module && context.module.exports) {
54
- // other stuff
55
- }
56
-
57
- })(window);