-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentry.ts
48 lines (44 loc) · 1.54 KB
/
entry.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import FormUtils from "./src/FormUtils";
import Action from "./src/Action";
import ActionPlugin from "./src/ActionPlugin";
import ActionCsrfToken from "./src/ActionCsrfToken";
import ActionDevLoader from "./src/ActionDevLoader";
import ActionMsgbox from "./src/ActionMsgbox";
import ActionGrowler from "./src/ActionGrowl";
import ActionBootstrapHighlight from "./src/ActionBootstrapHighlight";
import BootstrapFormHighlight from "./src/BootstrapFormHighlight";
import AIM from "./src/AIM";
window['AIM'] = AIM;
window['ActionMsgbox'] = ActionMsgbox;
window['FormUtils'] = FormUtils;
window['BootstrapFormHighlight'] = BootstrapFormHighlight;
window['ActionPlugin'] = ActionPlugin;
window['ActionBootstrapHighlight'] = ActionBootstrapHighlight;
window['ActionGrowler'] = ActionGrowler;
window['ActionCsrfToken'] = ActionCsrfToken;
window['Action'] = Action;
(<any>window).submitActionWith = function(f, extendData, arg1 = null, arg2 = null) {
var a = Action.form(f);
return a.submitWith(extendData, arg1, arg2);
};
(<any>window).submitAction = function(f, arg1 = null, arg2 = null) {
var a = Action.form(f);
a.submit(arg1, arg2);
};
(<any>window).runAction = function(actionName:string, args, arg1 = null, arg2 = null) : JQueryDeferred<any> {
var a = new Action;
var funcargs:Array<any> = [actionName];
if (typeof args === "function") {
funcargs.push({});
funcargs.push(args); // the callback
} else {
funcargs.push(args);
}
if (arg1) {
funcargs.push(arg1);
}
if (arg2) {
funcargs.push(arg2);
}
return a.run.apply(a, funcargs);
};