better extension ui

This commit is contained in:
Mo Bitar
2017-01-04 21:53:05 -06:00
parent 24ed04b46f
commit b494a4da4a
9 changed files with 230 additions and 166 deletions

View File

@@ -0,0 +1,23 @@
class Extension extends Item {
constructor(json) {
_.merge(this, json);
this.actions = this.actions.map(function(action){
return new Action(action);
})
}
}
class Action {
constructor(json) {
_.merge(this, json);
var comps = this.type.split(":");
if(comps.length > 0) {
this.repeatable = true;
this.repeatType = comps[0]; // 'watch' or 'poll'
this.repeatVerb = comps[1]; // http verb
this.repeatFrequency = comps[2];
}
}
}