1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-28 23:16:32 -04:00

rjs -> webpack

This commit is contained in:
Keivan Beigi
2015-02-02 17:18:45 -08:00
parent 344f3d66ef
commit 428a1439e5
399 changed files with 11591 additions and 16139 deletions
+30 -42
View File
@@ -1,46 +1,34 @@
'use strict';
define(
[
'underscore',
'backbone'
], function (_, Backbone) {
return Backbone.Model.extend({
url: window.NzbDrone.ApiRoot + '/command',
var _ = require('underscore');
var Backbone = require('backbone');
parse: function (response) {
response.name = response.name.toLocaleLowerCase();
return response;
},
isSameCommand: function (command) {
if (command.name.toLocaleLowerCase() !== this.get('name').toLocaleLowerCase()) {
return false;
}
for (var key in command) {
if (key !== 'name') {
if (Array.isArray(command[key])) {
if (_.difference(command[key], this.get(key)).length > 0) {
return false;
}
}
else if (command[key] !== this.get(key)) {
return false;
}
module.exports = Backbone.Model.extend({
url : window.NzbDrone.ApiRoot + '/command',
parse : function(response){
response.name = response.name.toLocaleLowerCase();
return response;
},
isSameCommand : function(command){
if(command.name.toLocaleLowerCase() !== this.get('name').toLocaleLowerCase()) {
return false;
}
for (var key in command) {
if(key !== 'name') {
if(Array.isArray(command[key])) {
if(_.difference(command[key], this.get(key)).length > 0) {
return false;
}
}
return true;
},
isActive: function () {
return this.get('state') !== 'completed' && this.get('state') !== 'failed';
},
isComplete: function () {
return this.get('state') === 'completed';
else if(command[key] !== this.get(key)) {
return false;
}
}
});
});
}
return true;
},
isActive : function(){
return this.get('state') !== 'completed' && this.get('state') !== 'failed';
},
isComplete : function(){
return this.get('state') === 'completed';
}
});