signalr cleanup

This commit is contained in:
kay.one 2013-09-10 23:33:47 -07:00 committed by Keivan Beigi
parent feda4a9b67
commit 25e2c98c45
219 changed files with 2035 additions and 1495 deletions

View file

@ -4,5 +4,30 @@ define(
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
url: window.ApiRoot + '/command',
parse: function (response) {
response.name = response.name.toLocaleLowerCase();
return response;
},
isActive: function () {
return this.get('state') !== 'completed' && this.get('state') !== 'failed';
},
isSameCommand: function (command) {
if (command.name.toLocaleLowerCase() != this.get('name').toLocaleLowerCase()) {
return false;
}
for (var key in command) {
if (key !== 'name' && command[key] !== this.get(key)) {
return false;
}
}
return true;
}
});
});