-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodapi.js
47 lines (40 loc) · 887 Bytes
/
modapi.js
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
function ModApi(context){
}
ModApi.prototype.focus = function(value){
if(typeof value == 'undefined'){
//all good
}
else{
//this.globals.binds[this.globals.focusBind] = value;
}
//return this.globals.binds[this.globals.focusBind];
}
ModApi.prototype.$focus = function($tag){
if(typeof $tag == 'undefined'){
//all good
}
else{
//this.globals.tags[this.globals.focusTag] = $tag;
}
//return this.globals.tags[this.globals.focusTag];
};
ModApi.prototype.args = function(){
if(typeof arguments[0] === 'string'){
var arg = '';
//get from hash of names
return arg;
}
else if(typeof arguments[0] === 'number'){
var arg = '';
//get by index in array
return arg;
}
else if (typeof arguments[0] === 'function'){
//run function for each argument
for(var i in args){
arguments[0](args[i]);
}
}
return null;
}
module.exports = ModApi;