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

@ -1,16 +1,21 @@
'use strict';
define({
Execute: function (name, properties) {
var data = { command: name };
define(
[
'Commands/CommandModel',
'Commands/CommandCollection',
'underscore'
], function (CommandModel, CommandCollection, _) {
if (properties) {
$.extend(data, properties);
return{
Execute: function (name, properties) {
var attr = _.extend({name: name.toLocaleLowerCase()}, properties);
var commandModel = new CommandModel(attr);
return commandModel.save().success(function () {
CommandCollection.add(commandModel);
});
}
return $.ajax({
type: 'POST',
url : window.ApiRoot + '/command',
data: JSON.stringify(data)
});
}
});