2013-09-11 09:33:47 +03:00
|
|
|
'use strict';
|
2013-08-31 06:08:19 +03:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'backbone',
|
|
|
|
'Commands/CommandModel',
|
|
|
|
'Mixins/backbone.signalr.mixin'
|
|
|
|
], function (Backbone, CommandModel) {
|
|
|
|
|
|
|
|
var CommandCollection = Backbone.Collection.extend({
|
2013-09-14 10:10:19 +03:00
|
|
|
url : window.NzbDrone.ApiRoot + '/command',
|
2013-09-11 09:33:47 +03:00
|
|
|
model: CommandModel,
|
|
|
|
|
|
|
|
findCommand: function (command) {
|
|
|
|
return this.find(function (model) {
|
|
|
|
return model.isSameCommand(command);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2013-08-31 06:08:19 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
var collection = new CommandCollection().bindSignalR();
|
|
|
|
|
2013-09-11 09:33:47 +03:00
|
|
|
collection.fetch();
|
|
|
|
|
2013-08-31 06:08:19 +03:00
|
|
|
return collection;
|
|
|
|
});
|