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,11 +1,7 @@
'use strict';
define([
'backbone',
'Settings/DownloadClient/RemotePathMapping/RemotePathMappingModel'
], function (Backbone, RemotePathMappingModel) {
var Backbone = require('backbone');
var RemotePathMappingModel = require('./RemotePathMappingModel');
return Backbone.Collection.extend({
model : RemotePathMappingModel,
url : window.NzbDrone.ApiRoot + '/remotePathMapping'
});
});
module.exports = Backbone.Collection.extend({
model : RemotePathMappingModel,
url : window.NzbDrone.ApiRoot + '/remotePathMapping'
});

View File

@@ -1,28 +1,22 @@
'use strict';
define([
'AppLayout',
'marionette',
'Settings/DownloadClient/RemotePathMapping/RemotePathMappingItemView',
'Settings/DownloadClient/RemotePathMapping/RemotePathMappingEditView',
'Settings/DownloadClient/RemotePathMapping/RemotePathMappingModel',
'bootstrap'
], function (AppLayout, Marionette, RemotePathMappingItemView, EditView, RemotePathMappingModel) {
var AppLayout = require('../../../AppLayout');
var Marionette = require('marionette');
var RemotePathMappingItemView = require('./RemotePathMappingItemView');
var EditView = require('./RemotePathMappingEditView');
var RemotePathMappingModel = require('./RemotePathMappingModel');
require('bootstrap');
return Marionette.CompositeView.extend({
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingCollectionViewTemplate',
itemViewContainer : '.x-rows',
itemView : RemotePathMappingItemView,
events: {
'click .x-add' : '_addMapping'
},
_addMapping: function() {
var model = new RemotePathMappingModel();
model.collection = this.collection;
var view = new EditView({ model: model, targetCollection: this.collection});
AppLayout.modalRegion.show(view);
}
});
});
module.exports = Marionette.CompositeView.extend({
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingCollectionViewTemplate',
itemViewContainer : '.x-rows',
itemView : RemotePathMappingItemView,
events : {"click .x-add" : '_addMapping'},
_addMapping : function(){
var model = new RemotePathMappingModel();
model.collection = this.collection;
var view = new EditView({
model : model,
targetCollection : this.collection
});
AppLayout.modalRegion.show(view);
}
});

View File

@@ -1,23 +1,15 @@
'use strict';
var vent = require('../../../vent');
var Marionette = require('marionette');
define([
'vent',
'marionette'
], function (vent, Marionette) {
return Marionette.ItemView.extend({
template: 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingDeleteViewTemplate',
events: {
'click .x-confirm-delete': '_delete'
},
_delete: function () {
this.model.destroy({
wait : true,
success: function () {
vent.trigger(vent.Commands.CloseModalCommand);
}
});
}
});
});
module.exports = Marionette.ItemView.extend({
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingDeleteViewTemplate',
events : {"click .x-confirm-delete" : '_delete'},
_delete : function(){
this.model.destroy({
wait : true,
success : function(){
vent.trigger(vent.Commands.CloseModalCommand);
}
});
}
});

View File

@@ -1,51 +1,39 @@
'use strict';
define([
'underscore',
'vent',
'AppLayout',
'marionette',
'Settings/DownloadClient/RemotePathMapping/RemotePathMappingDeleteView',
'Commands/CommandController',
'Mixins/AsModelBoundView',
'Mixins/AsValidatedView',
'Mixins/AsEditModalView',
'Mixins/FileBrowser',
'bootstrap'
], function (_, vent, AppLayout, Marionette, DeleteView, CommandController, AsModelBoundView, AsValidatedView, AsEditModalView) {
var _ = require('underscore');
var vent = require('../../../vent');
var AppLayout = require('../../../AppLayout');
var Marionette = require('marionette');
var DeleteView = require('./RemotePathMappingDeleteView');
var CommandController = require('../../../Commands/CommandController');
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
var AsValidatedView = require('../../../Mixins/AsValidatedView');
var AsEditModalView = require('../../../Mixins/AsEditModalView');
require('../../../Mixins/FileBrowser');
require('bootstrap');
module.exports = (function(){
var view = Marionette.ItemView.extend({
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingEditViewTemplate',
ui : {
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingEditViewTemplate',
ui : {
path : '.x-path',
modalBody : '.modal-body'
},
_deleteView: DeleteView,
initialize : function (options) {
_deleteView : DeleteView,
initialize : function(options){
this.targetCollection = options.targetCollection;
},
onShow : function () {
//Hack to deal with modals not overflowing
if (this.ui.path.length > 0) {
onShow : function(){
if(this.ui.path.length > 0) {
this.ui.modalBody.addClass('modal-overflow');
}
this.ui.path.fileBrowser();
},
_onAfterSave : function () {
this.targetCollection.add(this.model, { merge : true });
_onAfterSave : function(){
this.targetCollection.add(this.model, {merge : true});
vent.trigger(vent.Commands.CloseModalCommand);
}
});
AsModelBoundView.call(view);
AsValidatedView.call(view);
AsEditModalView.call(view);
return view;
});
}).call(this);

View File

@@ -1,26 +1,19 @@
'use strict';
var AppLayout = require('../../../AppLayout');
var Marionette = require('marionette');
var EditView = require('./RemotePathMappingEditView');
define([
'AppLayout',
'marionette',
'Settings/DownloadClient/RemotePathMapping/RemotePathMappingEditView'
], function (AppLayout, Marionette, EditView) {
return Marionette.ItemView.extend({
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingItemViewTemplate',
className : 'row',
events: {
'click .x-edit' : '_editMapping'
},
initialize: function () {
this.listenTo(this.model, 'sync', this.render);
},
_editMapping: function() {
var view = new EditView({ model: this.model, targetCollection: this.model.collection});
AppLayout.modalRegion.show(view);
}
});
});
module.exports = Marionette.ItemView.extend({
template : 'Settings/DownloadClient/RemotePathMapping/RemotePathMappingItemViewTemplate',
className : 'row',
events : {"click .x-edit" : '_editMapping'},
initialize : function(){
this.listenTo(this.model, 'sync', this.render);
},
_editMapping : function(){
var view = new EditView({
model : this.model,
targetCollection : this.model.collection
});
AppLayout.modalRegion.show(view);
}
});

View File

@@ -1,10 +1,4 @@
'use strict';
var $ = require('jquery');
var DeepModel = require('backbone.deepmodel');
define([
'jquery',
'backbone.deepmodel'
], function ($, DeepModel) {
return DeepModel.DeepModel.extend({
});
});
module.exports = DeepModel.DeepModel.extend({});