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
@@ -1,36 +1,33 @@
'use strict';
var _ = require('underscore');
var AppLayout = require('../../../AppLayout');
var Backbone = require('backbone');
var SchemaCollection = require('../DownloadClientCollection');
var AddCollectionView = require('./DownloadClientAddCollectionView');
define([
'underscore',
'AppLayout',
'backbone',
'Settings/DownloadClient/DownloadClientCollection',
'Settings/DownloadClient/Add/DownloadClientAddCollectionView'
], function (_, AppLayout, Backbone, SchemaCollection, AddCollectionView) {
return ({
open: function (collection) {
var schemaCollection = new SchemaCollection();
var originalUrl = schemaCollection.url;
schemaCollection.url = schemaCollection.url + '/schema';
schemaCollection.fetch();
schemaCollection.url = originalUrl;
var groupedSchemaCollection = new Backbone.Collection();
schemaCollection.on('sync', function() {
var groups = schemaCollection.groupBy(function(model, iterator) { return model.get('protocol'); });
var modelCollection = _.map(groups, function(values, key, list) {
return { 'header': key, collection: values };
});
groupedSchemaCollection.reset(modelCollection);
module.exports = {
open : function(collection){
var schemaCollection = new SchemaCollection();
var originalUrl = schemaCollection.url;
schemaCollection.url = schemaCollection.url + '/schema';
schemaCollection.fetch();
schemaCollection.url = originalUrl;
var groupedSchemaCollection = new Backbone.Collection();
schemaCollection.on('sync', function(){
var groups = schemaCollection.groupBy(function(model, iterator){
return model.get('protocol');
});
var view = new AddCollectionView({ collection: groupedSchemaCollection, targetCollection: collection });
AppLayout.modalRegion.show(view);
}
});
});
var modelCollection = _.map(groups, function(values, key, list){
return {
"header" : key,
collection : values
};
});
groupedSchemaCollection.reset(modelCollection);
});
var view = new AddCollectionView({
collection : groupedSchemaCollection,
targetCollection : collection
});
AppLayout.modalRegion.show(view);
}
};