diff --git a/build/bundle.js b/build/bundle.js index 468839e2..8bea66d0 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -13681,6 +13681,68 @@ HeadlessGit.prototype.sendCommand = function(value) { exports.HeadlessGit = HeadlessGit; +}); + +require.define("/src/js/views/multiView.js",function(require,module,exports,__dirname,__filename,process,global){var GitError = require('../util/errors').GitError; +var _ = require('underscore'); +var Q = require('q'); +// horrible hack to get localStorage Backbone plugin +var Backbone = (!require('../util').isBrowser()) ? require('backbone') : window.Backbone; + +var ModalTerminal = require('../views').ModalTerminal; +var ContainedBase = require('../views').ContainedBase; +var ConfirmCancelView = require('../views').ConfirmCancelView; +var LeftRightView = require('../views').LeftRightView; +var ModalAlert = require('../views').ModalAlert; + +var MultiView = Backbone.View.extend({ + tagName: 'div', + className: 'multiView', + typeToConstructor: { + ModalAlert: ModalAlert + }, + initialize: function(options) { + options = options || {}; + if (!options.childViews) { + options.childViews = [{ + type: 'ModalAlert', + options: { + markdown: 'Woah wtf!!' + } + }, { + type: 'ModalAlert', + options: { + markdown: 'Im second' + } + }]; + } + this.childViewJSONs = options.childViews; + this.childViews = []; + this.render(); + }, + + createChildView: function(viewJSON) { + var type = viewJSON.type; + if (!this.typeToConstructor[type]) { + throw new Error('wut'); + } + var view = new this.typeToConstructor[type](viewJSON.options); + this.childViews.push(view); + view.show(); + }, + + render: function() { + // go through each and render... show the first + _.each(this.childViewJSONs, function(childView) { + this.createChildView(childView); + }, this); + } +}); + +exports.MultiView = MultiView; + + + }); require.define("/src/js/app/index.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); @@ -16167,7 +16229,8 @@ var toGlobalize = { HeadLess: require('../git/headless'), Q: { Q: require('q') }, RebaseView: require('../views/rebaseView'), - Views: require('../views') + Views: require('../views'), + MultiView: require('../views/multiView') }; _.each(toGlobalize, function(module) { @@ -16858,18 +16921,63 @@ require("/src/js/views/index.js"); require.define("/src/js/views/multiView.js",function(require,module,exports,__dirname,__filename,process,global){var GitError = require('../util/errors').GitError; var _ = require('underscore'); -var Backbone = require('backbone'); var Q = require('q'); +// horrible hack to get localStorage Backbone plugin +var Backbone = (!require('../util').isBrowser()) ? require('backbone') : window.Backbone; var ModalTerminal = require('../views').ModalTerminal; var ContainedBase = require('../views').ContainedBase; var ConfirmCancelView = require('../views').ConfirmCancelView; var LeftRightView = require('../views').LeftRightView; +var ModalAlert = require('../views').ModalAlert; var MultiView = Backbone.View.extend({ + tagName: 'div', + className: 'multiView', + typeToConstructor: { + ModalAlert: ModalAlert + }, + initialize: function(options) { + options = options || {}; + if (!options.childViews) { + options.childViews = [{ + type: 'ModalAlert', + options: { + markdown: 'Woah wtf!!' + } + }, { + type: 'ModalAlert', + options: { + markdown: 'Im second' + } + }]; + } + this.childViewJSONs = options.childViews; + this.childViews = []; + this.render(); + }, + + createChildView: function(viewJSON) { + var type = viewJSON.type; + if (!this.typeToConstructor[type]) { + throw new Error('wut'); + } + var view = new this.typeToConstructor[type](viewJSON.options); + this.childViews.push(view); + view.show(); + }, + + render: function() { + // go through each and render... show the first + _.each(this.childViewJSONs, function(childView) { + this.createChildView(childView); + }, this); + } +}); + +exports.MultiView = MultiView; -}) }); require("/src/js/views/multiView.js"); diff --git a/src/index.html b/src/index.html index 5d66e591..c357db2b 100644 --- a/src/index.html +++ b/src/index.html @@ -100,7 +100,7 @@