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

View File

@@ -1,38 +1,27 @@
'use strict';
define(
[
'backbone',
'Rename/RenamePreviewModel'
], function (Backbone, RenamePreviewModel) {
return Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/rename',
model: RenamePreviewModel,
var Backbone = require('backbone');
var RenamePreviewModel = require('./RenamePreviewModel');
originalFetch: Backbone.Collection.prototype.fetch,
initialize: function (options) {
if (!options.seriesId) {
throw 'seriesId is required';
}
this.seriesId = options.seriesId;
this.seasonNumber = options.seasonNumber;
},
fetch: function (options) {
if (!this.seriesId) {
throw 'seriesId is required';
}
options = options || {};
options.data = {};
options.data.seriesId = this.seriesId;
if (this.seasonNumber) {
options.data.seasonNumber = this.seasonNumber;
}
return this.originalFetch.call(this, options);
}
});
});
module.exports = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/rename',
model : RenamePreviewModel,
originalFetch : Backbone.Collection.prototype.fetch,
initialize : function(options){
if(!options.seriesId) {
throw 'seriesId is required';
}
this.seriesId = options.seriesId;
this.seasonNumber = options.seasonNumber;
},
fetch : function(options){
if(!this.seriesId) {
throw 'seriesId is required';
}
options = options || {};
options.data = {};
options.data.seriesId = this.seriesId;
if(this.seasonNumber) {
options.data.seasonNumber = this.seasonNumber;
}
return this.originalFetch.call(this, options);
}
});