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,10 +1,3 @@
'use strict';
var Marionette = require('marionette');
define(
[
'marionette'
], function (Marionette) {
return Marionette.ItemView.extend({
template: 'System/Update/EmptyViewTemplate'
});
});
module.exports = Marionette.ItemView.extend({template : 'System/Update/EmptyViewTemplate'});

View File

@@ -1,11 +1,7 @@
'use strict';
define(
[
'backbone',
'System/Update/UpdateModel'
], function (Backbone, UpdateModel) {
return Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/update',
model: UpdateModel
});
});
var Backbone = require('backbone');
var UpdateModel = require('./UpdateModel');
module.exports = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/update',
model : UpdateModel
});

View File

@@ -1,12 +1,8 @@
'use strict';
define(
[
'marionette',
'System/Update/UpdateItemView',
'System/Update/EmptyView'
], function (Marionette, UpdateItemView, EmptyView) {
return Marionette.CollectionView.extend({
itemView : UpdateItemView,
emptyView: EmptyView
});
});
var Marionette = require('marionette');
var UpdateItemView = require('./UpdateItemView');
var EmptyView = require('./EmptyView');
module.exports = Marionette.CollectionView.extend({
itemView : UpdateItemView,
emptyView : EmptyView
});

View File

@@ -1,38 +1,23 @@
'use strict';
var Marionette = require('marionette');
var CommandController = require('../../Commands/CommandController');
define(
[
'marionette',
'Commands/CommandController'
], function (Marionette, CommandController) {
return Marionette.ItemView.extend({
template: 'System/Update/UpdateItemViewTemplate',
events: {
'click .x-install-update': '_installUpdate'
},
initialize: function () {
this.updating = false;
},
_installUpdate: function () {
if (this.updating) {
return;
}
this.updating = true;
var self = this;
var promise = CommandController.Execute('installUpdate', { updatePackage: this.model.toJSON() });
promise.done(function () {
window.setTimeout(function () {
self.updating = false;
}, 5000);
});
}
module.exports = Marionette.ItemView.extend({
template : 'System/Update/UpdateItemViewTemplate',
events : {"click .x-install-update" : '_installUpdate'},
initialize : function(){
this.updating = false;
},
_installUpdate : function(){
if(this.updating) {
return;
}
this.updating = true;
var self = this;
var promise = CommandController.Execute('installUpdate', {updatePackage : this.model.toJSON()});
promise.done(function(){
window.setTimeout(function(){
self.updating = false;
}, 5000);
});
});
}
});

View File

@@ -1,33 +1,21 @@
'use strict';
define(
[
'marionette',
'backgrid',
'System/Update/UpdateCollection',
'System/Update/UpdateCollectionView',
'Shared/LoadingView'
], function (Marionette, Backgrid, UpdateCollection, UpdateCollectionView, LoadingView) {
return Marionette.Layout.extend({
template: 'System/Update/UpdateLayoutTemplate',
var Marionette = require('marionette');
var Backgrid = require('backgrid');
var UpdateCollection = require('./UpdateCollection');
var UpdateCollectionView = require('./UpdateCollectionView');
var LoadingView = require('../../Shared/LoadingView');
regions: {
updates: '#x-updates'
},
initialize: function () {
this.updateCollection = new UpdateCollection();
this.listenTo(this.updateCollection, 'sync', this._showUpdates);
},
onRender: function () {
this.updates.show(new LoadingView());
this.updateCollection.fetch();
},
_showUpdates: function () {
this.updates.show(new UpdateCollectionView({ collection: this.updateCollection }));
}
});
});
module.exports = Marionette.Layout.extend({
template : 'System/Update/UpdateLayoutTemplate',
regions : {updates : '#x-updates'},
initialize : function(){
this.updateCollection = new UpdateCollection();
this.listenTo(this.updateCollection, 'sync', this._showUpdates);
},
onRender : function(){
this.updates.show(new LoadingView());
this.updateCollection.fetch();
},
_showUpdates : function(){
this.updates.show(new UpdateCollectionView({collection : this.updateCollection}));
}
});

View File

@@ -1,9 +1,3 @@
'use strict';
define(
[
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
var Backbone = require('backbone');
});
});
module.exports = Backbone.Model.extend({});