mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-15 21:06:20 -04:00
rjs -> webpack
This commit is contained in:
@@ -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'});
|
||||
@@ -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
|
||||
});
|
||||
@@ -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
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -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}));
|
||||
}
|
||||
});
|
||||
@@ -1,9 +1,3 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
var Backbone = require('backbone');
|
||||
|
||||
});
|
||||
});
|
||||
module.exports = Backbone.Model.extend({});
|
||||
Reference in New Issue
Block a user