From bff26b01a8f67cae3056288bd978033517f925fe Mon Sep 17 00:00:00 2001 From: Sam Saccone Date: Tue, 22 Jul 2014 22:47:05 -0400 Subject: [PATCH] Bump and build v2.1.0 --- bower.json | 2 +- changelog.md | 60 +++++ component.json | 2 +- lib/backbone.marionette.js | 338 ++++++++++++++++++++-------- lib/backbone.marionette.map | 2 +- lib/backbone.marionette.min.js | 6 +- lib/core/backbone.marionette.js | 338 ++++++++++++++++++++-------- lib/core/backbone.marionette.map | 2 +- lib/core/backbone.marionette.min.js | 2 +- package.json | 2 +- upgradeGuide.md | 2 +- 11 files changed, 568 insertions(+), 188 deletions(-) diff --git a/bower.json b/bower.json index 53066adc2e..2fbeb8e264 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,7 @@ "description": "Make your Backbone.js apps dance with a composite application architecture!", "homepage": "http://marionettejs.org", "main": "./lib/core/backbone.marionette.js", - "version": "2.0.3", + "version": "2.1.0", "keywords": [ "backbone", "framework", diff --git a/changelog.md b/changelog.md index 385c95d2f1..9a5ea64af9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,63 @@ +### v2.1.0-pre [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v2.0.3...v2.1.0) + +* Features + + * Marionette.Object + * A base class which other classes can extend from. Marionette.Object incorporates many backbone conventions and utilities like `initialize` and `Backbone.Events`. It is a user friendly class to base your classes on to get Backbone conventions on any generic class. + + * Add a `el` reference to the views `el` from within a `behavior` instance. + + * `ItemView`s can now have no template by setting `template: false` + + * Application objects can now configure their default message channel. + * This will allow you to configure multiple applications to exist at the same time within an apps without their event bus colliding. + + * Application objects now have the `getOption` method. + + * Regions now have a `hasView` method to determine if there is a view within a given region. + + * Views no longer use toJSON directly on models. instead they call into the new overridable methods `serializeModel` and `serializeCollection` where are called via `serializeData` + + * Return chainable objects from more methods to be consistent + + * Application: emptyRegions + * Application: removeRegion + * CollectionView renderChildView + + * Controller new + * LayoutView destroy + + * Region reset + * Region attachView + * Region empty + + * RegionManager destroy + * RegionMananger emptyRegions (now returns regions) + * RegionMananger removeRegions (now returns regions) + * RegionMananger removeRegion (now returns region) + * View destroy + * View undelegateEvents + * View delegateEvents + + * RegionManager `addRegions` now accepts a function that returns a region definition in addition to a region definition object + * This extends to Marionette.Application’s and CompositeView’s `regions` properties + + * Added CollectionView `resortView` + * Override this method on a subclass of CollectionView to provide custom logic for rendering after sorting the collection. + + * View instance is now passed as a third argument to `Marionette.Renderer.render` + + * Add `getRegionMananger` to Application + +* Fixes + + * CollectionView now maintains proper order when adding a mode + * Fix component.js path + * Prevent AppRouter from erroring when appRoutes are passed into the router constructor as an option. + * UI hash keys now only allow documented syntax, enforcing `@ui.stuff` instead of `@uistuff` + +### v2.1.0-pre [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v2.0.3...v2.1.0-pre) + ### v2.0.3 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v2.0.2...v2.0.3) * Bug Fixes diff --git a/component.json b/component.json index eeb664c68d..a51bd7bf9e 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "backbone.marionette", "description": "Make your Backbone.js apps dance!", - "version": "2.0.3", + "version": "2.1.0", "repo": "marionettejs/backbone.marionette", "main": "lib/core/backbone.marionette.js", "keywords": [ diff --git a/lib/backbone.marionette.js b/lib/backbone.marionette.js index 852a4a48a6..5ab61c7e06 100644 --- a/lib/backbone.marionette.js +++ b/lib/backbone.marionette.js @@ -1,6 +1,6 @@ // MarionetteJS (Backbone.Marionette) // ---------------------------------- -// v2.0.3 +// v2.1.0 // // Copyright (c)2014 Derick Bailey, Muted Solutions, LLC. // Distributed under MIT license @@ -489,7 +489,7 @@ var Marionette = Backbone.Marionette = {}; - Marionette.VERSION = '2.0.3'; + Marionette.VERSION = '2.1.0'; Marionette.noConflict = function() { root.Marionette = previousMarionette; @@ -550,9 +550,8 @@ // Pass in a mapping of events => functions or function names // and return a mapping of events => functions Marionette.normalizeMethods = function(hash) { - var normalizedHash = {}, method; - _.each(hash, function(fn, name) { - method = fn; + var normalizedHash = {}; + _.each(hash, function(method, name) { if (!_.isFunction(method)) { method = this[method]; } @@ -574,7 +573,7 @@ } _.each(_.keys(hash), function(v) { - var pattern = /@ui.[a-zA-Z_$0-9]*/g; + var pattern = /@ui\.[a-zA-Z_$0-9]*/g; if (v.match(pattern)) { hash[v.replace(pattern, function(r) { return ui[r.slice(4)]; @@ -678,7 +677,7 @@ } function isInDOM(view) { - return documentElement.contains(view.el); + return Backbone.$.contains(documentElement, view.el); } // Export public API @@ -870,12 +869,13 @@ // Ensure it can trigger events with Backbone.Events _.extend(Marionette.Controller.prototype, Backbone.Events, { destroy: function() { - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); this.triggerMethod.apply(this, ['before:destroy'].concat(args)); this.triggerMethod.apply(this, ['destroy'].concat(args)); this.stopListening(); this.off(); + return this; }, // import the `triggerMethod` to trigger events with corresponding @@ -887,6 +887,51 @@ }); + // Marionette Object + // --------------------- + // + // A Base Class that other Classes should descend from. + // Object borrows many conventions and utilities from Backbone. + Marionette.Object = function(options) { + + this.options = _.extend({}, _.result(this, 'options'), options); + + this.initialize(this.options); + }; + + Marionette.Object.extend = Marionette.extend; + + // Object Methods + // -------------- + + _.extend(Marionette.Object.prototype, { + + //this is a noop method intended to be overridden by classes that extend from this base + initialize: function() {}, + + destroy: function() { + this.triggerMethod('before:destroy'); + this.triggerMethod('destroy'); + this.stopListening(); + }, + + // Import the `triggerMethod` to trigger events with corresponding + // methods if the method exists + triggerMethod: Marionette.triggerMethod, + + // Proxy `getOption` to enable getting options from this or this.options by name. + getOption: Marionette.proxyGetOption, + + // Proxy `unbindEntityEvents` to enable binding view's events from another entity. + bindEntityEvents: Marionette.proxyBindEntityEvents, + + // Proxy `unbindEntityEvents` to enable unbinding view's events from another entity. + unbindEntityEvents: Marionette.proxyUnbindEntityEvents + }); + + // Ensure it can trigger events with Backbone.Events + _.extend(Marionette.Object.prototype, Backbone.Events); + /* jshint maxcomplexity: 10, maxstatements: 29 */ // Region @@ -909,7 +954,7 @@ this.$el = this.getEl(this.el); if (this.initialize) { - var args = Array.prototype.slice.apply(arguments); + var args = slice.apply(arguments); this.initialize.apply(this, args); } }; @@ -934,53 +979,41 @@ // } // ``` // - buildRegion: function(regionConfig, defaultRegionClass) { - var regionIsString = _.isString(regionConfig); - var regionSelectorIsString = _.isString(regionConfig.selector); - var regionClassIsUndefined = _.isUndefined(regionConfig.regionClass); - var regionIsClass = _.isFunction(regionConfig); - - if (!regionIsClass && !regionIsString && !regionSelectorIsString) { - throwError('Region must be specified as a Region class,' + - 'a selector string or an object with selector property'); + buildRegion: function(regionConfig, DefaultRegionClass) { + if (_.isString(regionConfig)) { + return this._buildRegionFromSelector(regionConfig, DefaultRegionClass); } - var selector, RegionClass; - - // get the selector for the region - - if (regionIsString) { - selector = regionConfig; + if (regionConfig.selector || regionConfig.el || regionConfig.regionClass) { + return this._buildRegionFromObject(regionConfig, DefaultRegionClass); } - if (regionConfig.selector) { - selector = regionConfig.selector; - delete regionConfig.selector; + if (_.isFunction(regionConfig)) { + return this._buildRegionFromRegionClass(regionConfig); } - // get the class for the region - - if (regionIsClass) { - RegionClass = regionConfig; - } + throwError('Improper region configuration type. Please refer ' + + 'to http://marionettejs.com/docs/marionette.region.html#region-configuration-types'); + }, - if (!regionIsClass && regionClassIsUndefined) { - RegionClass = defaultRegionClass; - } + // Build the region from a string selector like '#foo-region' + _buildRegionFromSelector: function(selector, DefaultRegionClass) { + return new DefaultRegionClass({ el: selector }); + }, - if (regionConfig.regionClass) { - RegionClass = regionConfig.regionClass; - delete regionConfig.regionClass; - } + // Build the region from a configuration object + // ```js + // { selector: '#foo', regionClass: FooRegion } + // ``` + _buildRegionFromObject: function(regionConfig, DefaultRegionClass) { + var RegionClass = regionConfig.regionClass || DefaultRegionClass; + var options = _.omit(regionConfig, 'selector', 'regionClass'); - if (regionIsString || regionIsClass) { - regionConfig = {}; + if (regionConfig.selector && !options.el) { + options.el = regionConfig.selector; } - regionConfig.el = selector; - - // build the region instance - var region = new RegionClass(regionConfig); + var region = new RegionClass(options); // override the `getEl` function if we have a parentEl // this must be overridden to ensure the selector is found @@ -1002,6 +1035,11 @@ } return region; + }, + + // Build the region directly from a given `RegionClass` + _buildRegionFromRegionClass: function(RegionClass) { + return new RegionClass(); } }); @@ -1125,6 +1163,7 @@ // Remove region pointer to the currentView delete this.currentView; + return this; }, // call 'destroy' or 'remove', depending on which is found @@ -1145,6 +1184,14 @@ // of the region. attachView: function(view) { this.currentView = view; + return this; + }, + + // Checks whether a view is currently present within + // the region. Returns `true` if there is and `false` if + // no view is present. + hasView: function() { + return !!this.currentView; }, // Reset the region by destroying any existing view and @@ -1159,6 +1206,7 @@ } delete this.$el; + return this; }, // Proxy `getOption` to enable getting options from this or this.options by name. @@ -1184,10 +1232,15 @@ Marionette.Controller.call(this, options); }, - // Add multiple regions using an object literal, where + // Add multiple regions using an object literal or a + // function that returns an object literal, where // each key becomes the region name, and each value is // the region definition. addRegions: function(regionDefinitions, defaults) { + if (_.isFunction(regionDefinitions)) { + regionDefinitions = regionDefinitions.apply(this, arguments); + } + var regions = {}; _.each(regionDefinitions, function(definition, name) { @@ -1246,29 +1299,37 @@ removeRegion: function(name) { var region = this._regions[name]; this._remove(name, region); + + return region; }, // Empty all regions in the region manager, and // remove them removeRegions: function() { + var regions = this.getRegions(); _.each(this._regions, function(region, name) { this._remove(name, region); }, this); + + return regions; }, // Empty all regions in the region manager, but // leave them attached emptyRegions: function() { - _.each(this._regions, function(region) { + var regions = this.getRegions(); + _.each(regions, function(region) { region.empty(); }, this); + + return regions; }, // Destroy all regions and shut down the region // manager entirely destroy: function() { this.removeRegions(); - Marionette.Controller.prototype.destroy.apply(this, arguments); + return Marionette.Controller.prototype.destroy.apply(this, arguments); }, // internal method to store regions @@ -1459,6 +1520,12 @@ return this.getOption('template'); }, + // Serialize a model by returning its attributes. Clones + // the attributes to allow modification. + serializeModel: function(model){ + return model.toJSON.apply(model, slice.call(arguments, 1)); + }, + // Mix in template helper methods. Looks for a // `templateHelpers` attribute, which can either be an // object literal, or a function that returns an object @@ -1534,6 +1601,7 @@ this._delegateDOMEvents(events); this.bindEntityEvents(this.model, this.getOption('modelEvents')); this.bindEntityEvents(this.collection, this.getOption('collectionEvents')); + return this; }, // internal method to delegate DOM events and triggers @@ -1559,10 +1627,11 @@ // Overriding Backbone.View's undelegateEvents to handle unbinding // the `triggers`, `modelEvents`, and `collectionEvents` config undelegateEvents: function() { - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); Backbone.View.prototype.undelegateEvents.apply(this, args); this.unbindEntityEvents(this.model, this.getOption('modelEvents')); this.unbindEntityEvents(this.collection, this.getOption('collectionEvents')); + return this; }, // Internal method, handles the `show` event. @@ -1584,7 +1653,7 @@ destroy: function() { if (this.isDestroyed) { return; } - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); this.triggerMethod.apply(this, ['before:destroy'].concat(args)); @@ -1599,6 +1668,7 @@ // remove the view from the DOM this.remove(); + return this; }, // This method binds the elements specified in the "ui" hash inside the view's code with @@ -1672,24 +1742,30 @@ }, // Serialize the model or collection for the view. If a model is - // found, `.toJSON()` is called. If a collection is found, `.toJSON()` - // is also called, but is used to populate an `items` array in the - // resulting data. If both are found, defaults to the model. - // You can override the `serializeData` method in your own view - // definition, to provide custom serialization for your view's data. - serializeData: function() { + // found, the view's `serializeModel` is called. If a collection is found, + // each model in the collection is serialized by calling + // the view's `serializeCollection` and put into an `items` array in + // the resulting data. If both are found, defaults to the model. + // You can override the `serializeData` method in your own view definition, + // to provide custom serialization for your view's data. + serializeData: function(){ var data = {}; if (this.model) { - data = this.model.toJSON(); + data = _.partial(this.serializeModel, this.model).apply(this, arguments); } else if (this.collection) { - data = {items: this.collection.toJSON()}; + data = { items: _.partial(this.serializeCollection, this.collection).apply(this, arguments) }; } return data; }, + // Serialize a collection by serializing each of its models. + serializeCollection: function(collection){ + return collection.toJSON.apply(collection, slice.call(arguments, 1)); + }, + // Render the view, defaulting to underscore.js templates. // You can override this in your view definition to provide // a very specific rendering for your view. In general, though, @@ -1700,15 +1776,38 @@ this.triggerMethod('before:render', this); + this._renderTemplate(); + this.bindUIElements(); + + this.triggerMethod('render', this); + + return this; + }, + + // Internal method to render the template with the serialized data + // and template helpers via the `Marionette.Renderer` object. + // Throws an `UndefinedTemplateError` error if the template is + // any falsely value but literal `false`. + _renderTemplate: function() { + var template = this.getTemplate(); + + // Allow template-less item views + if (template === false) { + return; + } + + if (!template) { + throwError('Cannot render the template since it is null or undefined.', + 'UndefinedTemplateError'); + } + + // Add in entity data and template helpers var data = this.serializeData(); data = this.mixinTemplateHelpers(data); - var template = this.getTemplate(); - var html = Marionette.Renderer.render(template, data); + // Render and add to el + var html = Marionette.Renderer.render(template, data, this); this.attachElContent(html); - this.bindUIElements(); - - this.triggerMethod('render', this); return this; }, @@ -1736,7 +1835,7 @@ destroy: function() { if (this.isDestroyed) { return; } - Marionette.View.prototype.destroy.apply(this, arguments); + return Marionette.View.prototype.destroy.apply(this, arguments); } }); @@ -1824,7 +1923,7 @@ }, // Handle a child added to the collection - _onCollectionAdd: function(child, collection, options) { + _onCollectionAdd: function(child) { this.destroyEmptyView(); var ChildView = this.getChildView(child); var index = this.collection.indexOf(child); @@ -1860,17 +1959,25 @@ return this; }, + // Render view after sorting. Override this method to + // change how the view renders after a `sort` on the collection. + // An example of this would be to only `renderChildren` in a `CompositeView` + // rather than the full view. + resortView: function() { + this.render(); + }, + // Internal method. This checks for any changes in the order of the collection. // If the index of any view doesn't match, it will render. - _sortViews: function(){ + _sortViews: function() { // check for any changes in sort order of views var orderChanged = this.collection.find(function(item, index){ var view = this.children.findByModel(item); - return view && view._index !== index; + return !view || view._index !== index; }, this); if (orderChanged) { - this.render(); + this.resortView(); } }, @@ -1968,9 +2075,12 @@ } }, - // Retrieve the childView class, either from `this.options.childView` + // Retrieve the `childView` class, either from `this.options.childView` // or from the `childView` in the object definition. The "options" // takes precedence. + // This method receives the model that will be passed to the instance + // created from this `childView`. Overriding methods may use the child + // to determine what `childView` class to return. getChildView: function(child) { var childView = this.getOption('childView'); @@ -2058,6 +2168,7 @@ renderChildView: function(view, index) { view.render(); this.attachHtml(this, view, index); + return view; }, // Build a `childView` for a model in the collection. @@ -2086,6 +2197,7 @@ this._updateIndices(view, false); } + return view; }, // check if the collection is empty @@ -2165,14 +2277,16 @@ this.destroyChildren(); this.triggerMethod('destroy:collection'); - Marionette.View.prototype.destroy.apply(this, arguments); + return Marionette.View.prototype.destroy.apply(this, arguments); }, // Destroy the child views that this collection view // is holding on to, if any destroyChildren: function() { + var childViews = this.children.map(_.identity); this.children.each(this.removeChildView, this); this.checkEmpty(); + return childViews; }, // Set up the child view event forwarding. Uses a "childview:" @@ -2183,7 +2297,7 @@ // Forward all child view events through the parent, // prepending "childview:" to the event name this.listenTo(view, 'all', function() { - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); var rootEvent = args[0]; var childEvents = this.normalizeMethods(_.result(this, 'childEvents')); @@ -2260,8 +2374,8 @@ serializeData: function() { var data = {}; - if (this.model) { - data = this.model.toJSON(); + if (this.model){ + data = _.partial(this.serializeModel, this.model).apply(this, arguments); } return data; @@ -2277,7 +2391,7 @@ this.triggerMethod('before:render', this); - this._renderRoot(); + this._renderTemplate(); this._renderChildren(); this.triggerMethod('render', this); @@ -2292,7 +2406,7 @@ // Render the root template that the children // views are appended to - _renderRoot: function() { + _renderTemplate: function() { var data = {}; data = this.serializeData(); data = this.mixinTemplateHelpers(data); @@ -2300,7 +2414,7 @@ this.triggerMethod('before:render:template'); var template = this.getTemplate(); - var html = Marionette.Renderer.render(template, data); + var html = Marionette.Renderer.render(template, data, this); this.attachElContent(html); // the ui bindings is done here and not at the end of render since they @@ -2427,10 +2541,10 @@ // Handle destroying regions, and then destroy the view itself. destroy: function() { - if (this.isDestroyed) { return; } + if (this.isDestroyed) { return this; } this.regionManager.destroy(); - Marionette.ItemView.prototype.destroy.apply(this, arguments); + return Marionette.ItemView.prototype.destroy.apply(this, arguments); }, // Add a single region, by name, to the layoutView @@ -2638,7 +2752,10 @@ // is not set until after setElement is called. _.each(behaviors, function(b) { b.$el = this.$el; + b.el = this.el; }, this); + + return this; }, destroy: function(destroy, behaviors) { @@ -2650,6 +2767,7 @@ // This unbinds event listeners // that behaviors have registerd for. _.invoke(behaviors, 'destroy', args); + return this; }, bindUIElements: function(bindUIElements, behaviors) { @@ -2679,6 +2797,8 @@ Marionette.bindEntityEvents(b, this.model, Marionette.getOption(b, 'modelEvents')); Marionette.bindEntityEvents(b, this.collection, Marionette.getOption(b, 'collectionEvents')); }, this); + + return this; }, undelegateEvents: function(undelegateEvents, behaviors) { @@ -2689,6 +2809,8 @@ Marionette.unbindEntityEvents(b, this.model, Marionette.getOption(b, 'modelEvents')); Marionette.unbindEntityEvents(b, this.collection, Marionette.getOption(b, 'collectionEvents')); }, this); + + return this; }, behaviorEvents: function(behaviorEvents, behaviors) { @@ -2834,7 +2956,7 @@ // method call, if it exists _processOnRoute: function(routeName, routeArgs) { // find the path that matched - var routePath = _.invert(this.appRoutes)[routeName]; + var routePath = _.invert(this.getOption('appRoutes'))[routeName]; // make sure an onRoute is there, and call it if (_.isFunction(this.onRoute)) { @@ -2880,15 +3002,11 @@ // Stores and starts up `Region` objects, includes an // event aggregator as `app.vent` Marionette.Application = function(options) { - this._initRegionManager(); + this._initializeRegions(options); this._initCallbacks = new Marionette.Callbacks(); - var globalCh = Backbone.Wreqr.radio.channel('global'); - this.vent = globalCh.vent; - this.commands = globalCh.commands; - this.reqres = globalCh.reqres; this.submodules = {}; - _.extend(this, options); + this._initChannel(); }; _.extend(Marionette.Application.prototype, Backbone.Events, { @@ -2928,14 +3046,14 @@ // Empty all regions in the app, without removing them emptyRegions: function() { - this._regionManager.emptyRegions(); + return this._regionManager.emptyRegions(); }, // Removes a region from your app, by name // Accepts the regions name // removeRegion('myRegion') removeRegion: function(region) { - this._regionManager.removeRegion(region); + return this._regionManager.removeRegion(region); }, // Provides alternative access to regions @@ -2965,9 +3083,39 @@ return ModuleClass.create.apply(ModuleClass, args); }, + // Enable easy overriding of the default `RegionManager` + // for customized region interactions and business-specific + // view logic for better control over single regions. + getRegionManager: function() { + return new Marionette.RegionManager(); + }, + + // Internal method to initialize the regions that have been defined in a + // `regions` attribute on the application instance + _initializeRegions: function(options) { + var regions = _.isFunction(this.regions) ? this.regions(options) : this.regions || {}; + + this._initRegionManager(); + + // Enable users to define `regions` in instance options. + var optionRegions = Marionette.getOption(options, 'regions'); + + // Enable region options to be a function + if (_.isFunction(optionRegions)) { + optionRegions = optionRegions.call(this, options); + } + + // Overwrite current regions with those passed in options + _.extend(regions, optionRegions); + + this.addRegions(regions); + + return this; + }, + // Internal method to set up the region manager _initRegionManager: function() { - this._regionManager = new Marionette.RegionManager(); + this._regionManager = this.getRegionManager(); this.listenTo(this._regionManager, 'before:add:region', function(name) { this.triggerMethod('before:add:region', name); @@ -2988,9 +3136,21 @@ }); }, + // Internal method to setup the Wreqr.radio channel + _initChannel: function() { + this.channelName = _.result(this, 'channelName') || 'global'; + this.channel = _.result(this, 'channel') || Backbone.Wreqr.radio.channel(this.channelName); + this.vent = _.result(this, 'vent') || this.channel.vent; + this.commands = _.result(this, 'commands') || this.channel.commands; + this.reqres = _.result(this, 'reqres') || this.channel.reqres; + }, + // import the `triggerMethod` to trigger events with corresponding // methods if the method exists - triggerMethod: Marionette.triggerMethod + triggerMethod: Marionette.triggerMethod, + + // Proxy `getOption` to enable getting options from this or this.options by name. + getOption: Marionette.proxyGetOption }); // Copy the `extend` function used by Backbone's classes diff --git a/lib/backbone.marionette.map b/lib/backbone.marionette.map index 144456d3c7..f083e1da14 100644 --- a/lib/backbone.marionette.map +++ b/lib/backbone.marionette.map @@ -1 +1 @@ -{"version":3,"file":"lib/backbone.marionette.min.js","sources":["?"],"names":["root","factory","define","amd","Backbone","_","Marionette","exports","require","module","this","throwError","message","name","error","Error","previousChildViewContainer","ChildViewContainer","Container","views","_views","_indexByModel","_indexByCustom","_updateLength","each","add","extend","prototype","view","customIndex","viewCid","cid","model","findByModel","findByModelCid","modelCid","findByCid","findByCustom","index","findByIndex","values","remove","any","key","call","method","apply","tail","arguments","args","isFunction","length","size","methods","concat","toArray","VERSION","noConflict","previousWreqr","Wreqr","Handlers","options","_wreqrHandlers","initialize","Model","Events","setHandlers","handlers","handler","context","isObject","callback","setHandler","config","trigger","hasHandler","getHandler","Array","slice","removeHandler","removeAllHandlers","CommandStorage","_commands","getCommands","commandName","commands","command","instances","addCommand","push","clearCommands","Commands","storageType","constructor","_initializeStorage","on","_executeCommands","execute","storage","StorageType","RequestResponse","request","EventAggregator","EA","Channel","channelName","vent","reqres","reset","off","stopListening","connectEvents","hash","_connect","connectCommands","connectRequests","type","fn","eventName","bind","radio","Radio","_channels","_proxyMethods","channel","_getChannel","system","messageSystems","proxyMethod","messageSystem","previousMarionette","Deferred","$","getOption","target","optionName","value","undefined","proxyGetOption","normalizeMethods","normalizedHash","normalizeUIKeys","ui","keys","v","pattern","match","replace","r","actAsCollection","object","listProperty","list","result","triggerMethod","getEventName","prefix","toUpperCase","splitter","event","methodName","MonitorDOMRefresh","documentElement","handleShow","_isShown","triggerDOMRefresh","handleRender","_isRendered","isInDOM","contains","el","listenTo","document","bindFromStrings","entity","evt","methodNames","split","bindToFunction","unbindFromStrings","unbindToFunction","iterateEvents","bindings","functionCallback","stringCallback","bindEntityEvents","unbindEntityEvents","proxyBindEntityEvents","proxyUnbindEntityEvents","Callbacks","_deferred","_callbacks","contextOverride","promise","cb","ctx","then","run","resolve","callbacks","Controller","destroy","Region","$el","getEl","buildRegion","regionConfig","defaultRegionClass","regionIsString","isString","regionSelectorIsString","selector","regionClassIsUndefined","isUndefined","regionClass","regionIsClass","RegionClass","region","parentEl","find","show","_ensureElement","showOptions","isDifferentView","currentView","preventDestroy","forceShow","isChangingView","_shouldDestroyView","empty","_shouldShowView","once","render","attachHtml","innerHTML","appendChild","_destroyView","isDestroyed","attachView","RegionManager","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","hasSelector","_store","get","getRegions","clone","removeRegion","_remove","removeRegions","emptyRegions","_setLength","TemplateCache","templateId","templateCaches","cachedTemplate","load","clear","i","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","events","behaviors","Behaviors","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","uiBindings","configureTriggers","triggers","triggerEvents","hasOptions","e","prevent","preventDefault","stop","stopPropagation","shouldPrevent","shouldStop","collection","delegateEvents","_delegateDOMEvents","combinedEvents","behaviorEvents","undelegateEvents","_ensureViewIsIntact","err","unbindUIElements","bindUIElements","_uiBindings","ItemView","serializeData","toJSON","items","attachElContent","CollectionView","childViewEventPrefix","initOptions","sort","_initChildViewStorage","_initialEvents","initRenderBuffer","elBuffer","createDocumentFragment","_bufferedChildren","startBuffering","isBuffering","endBuffering","_triggerBeforeShowBufferedChildren","attachBuffer","_triggerShowBufferedChildren","invoke","child","_onCollectionAdd","_onCollectionRemove","_sortViews","destroyEmptyView","ChildView","getChildView","indexOf","addChild","children","removeChildView","checkEmpty","_renderChildren","orderChanged","item","_index","destroyChildren","isEmpty","showEmptyView","showCollection","EmptyView","getEmptyView","_showingEmptyView","addEmptyView","emptyViewOptions","buildChildView","renderChildView","childView","childViewOptions","_updateIndices","_addChildView","increment","laterView","proxyChildEvents","ChildViewClass","collectionView","buffer","append","_insertBefore","_insertAfter","findPosition","before","rootEvent","childEvents","splice","CompositeView","isRendered","resetChildViewContainer","_renderRoot","compositeView","$container","getChildViewContainer","containerView","$childViewContainer","container","childViewContainer","charAt","substr","LayoutView","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","getRegion","that","_initRegionManager","regionOptions","getRegionManager","Behavior","parseBehaviors","wrap","setElement","b","_behaviorsEvents","viewUI","_events","behaviorUI","whitespace","join","eventKey","behaviorsLookup","getBehaviorClass","behaviorClass","chain","map","BehaviorClass","behavior","nestedBehaviors","flatten","partial","AppRouter","Router","appRoutes","controller","_getController","processAppRoutes","_processOnRoute","appRoute","route","_addAppRoute","routeName","routeArgs","routePath","invert","onRoute","routeNames","reverse","Application","_initCallbacks","globalCh","submodules","addInitializer","initializer","start","_regionManager","moduleNames","moduleDefinition","ModuleClass","Module","getClass","unshift","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","addDefinition","customArgs","_runModuleDefinition","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","moduleClass","_getDefine","_getStartWithParent","_addStartWithParent","swp","startWithParentIsConfigured"],"mappings":";;;;;;;;;;;;;;;;;;;;CAmBC,SAASA,EAAMC,GAEd,GAAsB,kBAAXC,SAAyBA,OAAOC,IACzCD,QAAQ,WAAY,cAAe,SAASE,EAAUC,GACpD,MAAQL,GAAKM,WAAaL,EAAQD,EAAMI,EAAUC,SAE/C,IAAuB,mBAAZE,SAAyB,CACzC,GAAIH,GAAWI,QAAQ,YACnBH,EAAIG,QAAQ,aAChBC,QAAOF,QAAUN,EAAQD,EAAMI,EAAUC,OAEzCL,GAAKM,WAAaL,EAAQD,EAAMA,EAAKI,SAAUJ,EAAKK,IAGtDK,KAAM,SAASV,EAAMI,EAAUC,GAC/B,YA6dA,SAASM,GAAWC,EAASC,GAC3B,GAAIC,GAAQ,GAAIC,OAAMH,EAEtB,MADAE,GAAMD,KAAOA,GAAQ,QACfC,GAtdR,SAAUV,EAAUC,GAElB,GAAIW,GAA6BZ,EAASa,kBA8H1C,OAxHAb,GAASa,mBAAqB,SAASb,EAAUC,GAG/C,GAAIa,GAAY,SAASC,GACvBT,KAAKU,UACLV,KAAKW,iBACLX,KAAKY,kBACLZ,KAAKa,gBACLlB,EAAEmB,KAAKL,EAAOT,KAAKe,IAAKf,MAI1BL,GAAEqB,OAAOR,EAAUS,WAKjBF,IAAK,SAASG,EAAMC,GAClB,GAAIC,GAAUF,EAAKG,GAYnB,OAVArB,MAAKU,OAAOU,GAAWF,E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Aczb,GAGjCA,GASTsb,SAAU,SAASH,GACjB,GAAIC,GAAcvb,EAAWwb,MAE7B,OAAKF,GAMDA,EAAiBja,oBAAqBka,GACjCD,EAGFA,EAAiBuB,aAAetB,EAT9BA,GAeXoB,qBAAsB,SAASF,EAActc,EAAQyc,EAAKja,GACxD,GAAIoE,GAAK3G,KAAK0c,WAAWF,GACrBb,EAAkB3b,KAAK2c,oBAAoBH,EAAKzc,EAEhD4G,IACF5G,EAAOkc,cAActV,EAAIpE,GAG3BvC,KAAK4c,oBAAoBP,EAActc,EAAQ4b,IAGjDgB,oBAAqB,SAASH,EAAKzc,GACjC,GAAI8c,EAEJ,OAAIld,GAAE6C,WAAWga,IAASA,EAAIvb,oBAAqBrB,GAAWwb,QAC5DyB,EAAM9c,EAAOoF,YAAYlE,UAAU0a,gBAC5Bhc,EAAEgN,YAAYkQ,IAAO,EAAOA,GAGjCld,EAAEiE,SAAS4Y,IACbK,EAAML,EAAIb,gBACHhc,EAAEgN,YAAYkQ,IAAO,EAAOA,IAG9B,GAGTH,WAAY,SAASF,GACnB,OAAI7c,EAAE6C,WAAWga,IAAUA,EAAIvb,oBAAqBrB,GAAWwb,OAI3Dzb,EAAEiE,SAAS4Y,GACNA,EAAIhd,OAGN,KAPEgd,GAUXI,oBAAqB,SAASP,EAActc,EAAQ4b,GAClD5b,EAAO4b,gBAAkB5b,EAAO4b,iBAAmBA,EAE9C5b,EAAO4b,kBAAqB5b,EAAO+c,8BAIxC/c,EAAO+c,6BAA8B,EAErCT,EAAaxB,eAAe,SAAS1X,GAC/BpD,EAAO4b,iBACT5b,EAAOgb,MAAM5X,SAOdvD"} \ No newline at end of file +{"version":3,"file":"lib/backbone.marionette.min.js","sources":["?"],"names":["root","factory","define","amd","Backbone","_","Marionette","exports","require","module","this","throwError","message","name","error","Error","previousChildViewContainer","ChildViewContainer","Container","views","_views","_indexByModel","_indexByCustom","_updateLength","each","add","extend","prototype","view","customIndex","viewCid","cid","model","findByModel","findByModelCid","modelCid","findByCid","findByCustom","index","findByIndex","values","remove","any","key","call","method","apply","tail","arguments","args","isFunction","length","size","methods","concat","toArray","VERSION","noConflict","previousWreqr","Wreqr","Handlers","options","_wreqrHandlers","initialize","Model","Events","setHandlers","handlers","handler","context","isObject","callback","setHandler","config","trigger","hasHandler","getHandler","Array","slice","removeHandler","removeAllHandlers","CommandStorage","_commands","getCommands","commandName","commands","command","instances","addCommand","push","clearCommands","Commands","storageType","constructor","_initializeStorage","on","_executeCommands","execute","storage","StorageType","RequestResponse","request","EventAggregator","EA","Channel","channelName","vent","reqres","reset","off","stopListening","connectEvents","hash","_connect","connectCommands","connectRequests","type","fn","eventName","bind","radio","Radio","_channels","_proxyMethods","channel","_getChannel","system","messageSystems","proxyMethod","messageSystem","previousMarionette","Deferred","$","getOption","target","optionName","value","undefined","proxyGetOption","normalizeMethods","normalizedHash","normalizeUIKeys","ui","keys","v","pattern","match","replace","r","actAsCollection","object","listProperty","list","result","triggerMethod","getEventName","prefix","toUpperCase","splitter","event","methodName","MonitorDOMRefresh","documentElement","handleShow","_isShown","triggerDOMRefresh","handleRender","_isRendered","isInDOM","contains","el","listenTo","document","bindFromStrings","entity","evt","methodNames","split","bindToFunction","unbindFromStrings","unbindToFunction","iterateEvents","bindings","functionCallback","stringCallback","bindEntityEvents","unbindEntityEvents","proxyBindEntityEvents","proxyUnbindEntityEvents","Callbacks","_deferred","_callbacks","contextOverride","promise","cb","ctx","then","run","resolve","callbacks","Controller","destroy","Object","Region","$el","getEl","buildRegion","regionConfig","DefaultRegionClass","isString","_buildRegionFromSelector","selector","regionClass","_buildRegionFromObject","_buildRegionFromRegionClass","RegionClass","omit","region","parentEl","find","show","_ensureElement","showOptions","isDifferentView","currentView","preventDestroy","forceShow","isChangingView","_shouldDestroyView","empty","_shouldShowView","once","render","attachHtml","innerHTML","appendChild","_destroyView","isDestroyed","attachView","hasView","RegionManager","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","hasSelector","_store","get","getRegions","clone","removeRegion","_remove","removeRegions","emptyRegions","_setLength","TemplateCache","templateId","templateCaches","cachedTemplate","load","clear","i","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","events","behaviors","Behaviors","onShowCalled","getTemplate","serializeModel","toJSON","mixinTemplateHelpers","templateHelpers","uiBindings","configureTriggers","triggers","triggerEvents","hasOptions","e","prevent","preventDefault","stop","stopPropagation","shouldPrevent","shouldStop","collection","delegateEvents","_delegateDOMEvents","combinedEvents","behaviorEvents","undelegateEvents","_ensureViewIsIntact","err","unbindUIElements","bindUIElements","_uiBindings","ItemView","serializeData","partial","items","serializeCollection","_renderTemplate","attachElContent","CollectionView","childViewEventPrefix","initOptions","sort","isUndefined","_initChildViewStorage","_initialEvents","initRenderBuffer","elBuffer","createDocumentFragment","_bufferedChildren","startBuffering","isBuffering","endBuffering","_triggerBeforeShowBufferedChildren","attachBuffer","_triggerShowBufferedChildren","invoke","child","_onCollectionAdd","_onCollectionRemove","_sortViews","destroyEmptyView","ChildView","getChildView","indexOf","addChild","children","removeChildView","checkEmpty","_renderChildren","resortView","orderChanged","item","_index","destroyChildren","isEmpty","showEmptyView","showCollection","EmptyView","getEmptyView","_showingEmptyView","addEmptyView","emptyViewOptions","buildChildView","renderChildView","childView","childViewOptions","_updateIndices","_addChildView","increment","laterView","proxyChildEvents","ChildViewClass","collectionView","buffer","append","_insertBefore","_insertAfter","findPosition","before","childViews","map","identity","rootEvent","childEvents","splice","CompositeView","isRendered","resetChildViewContainer","compositeView","$container","getChildViewContainer","containerView","$childViewContainer","container","childViewContainer","charAt","substr","LayoutView","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","getRegion","that","_initRegionManager","regionOptions","getRegionManager","Behavior","parseBehaviors","wrap","setElement","b","_behaviorsEvents","viewUI","_events","behaviorUI","whitespace","join","eventKey","behaviorsLookup","getBehaviorClass","behaviorClass","chain","BehaviorClass","behavior","nestedBehaviors","flatten","AppRouter","Router","appRoutes","controller","_getController","processAppRoutes","_processOnRoute","appRoute","route","_addAppRoute","routeName","routeArgs","routePath","invert","onRoute","routeNames","reverse","Application","_initCallbacks","submodules","_initChannel","addInitializer","initializer","start","_regionManager","moduleNames","moduleDefinition","ModuleClass","Module","getClass","unshift","create","optionRegions","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","addDefinition","customArgs","_runModuleDefinition","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","moduleClass","_getDefine","_getStartWithParent","_addStartWithParent","swp","startWithParentIsConfigured"],"mappings":";;;;;;;;;;;;;;;;;;;;CAmBC,SAASA,EAAMC,GAEd,GAAsB,kBAAXC,SAAyBA,OAAOC,IACzCD,QAAQ,WAAY,cAAe,SAASE,EAAUC,GACpD,MAAQL,GAAKM,WAAaL,EAAQD,EAAMI,EAAUC,SAE/C,IAAuB,mBAAZE,SAAyB,CACzC,GAAIH,GAAWI,QAAQ,YACnBH,EAAIG,QAAQ,aAChBC,QAAOF,QAAUN,EAAQD,EAAMI,EAAUC,OAEzCL,GAAKM,WAAaL,EAAQD,EAAMA,EAAKI,SAAUJ,EAAKK,IAGtDK,KAAM,SAASV,EAAMI,EAAUC,GAC/B,YA6dA,SAASM,GAAWC,EAASC,GAC3B,GAAIC,GAAQ,GAAIC,OAAMH,EAEtB,MADAE,GAAMD,KAAOA,GAAQ,QACfC,GAtdR,SAAUV,EAAUC,GAElB,GAAIW,GAA6BZ,EAASa,kBA8H1C,OAxHAb,GAASa,mBAAqB,SAASb,EAAUC,GAG/C,GAAIa,GAAY,SAASC,GACvBT,KAAKU,UACLV,KAAKW,iBACLX,KAAKY,kBACLZ,KAAKa,gBACLlB,EAAEmB,KAAKL,EAAOT,KAAKe,IAAKf,MAI1BL,GAAEqB,OAAOR,EAAUS,WAKjBF,IAAK,SAASG,EAAMC,GAClB,GAAIC,GAAUF,EAAKG,GAYnB,OAVArB,MAAKU,OAAOU,GAAWF,EA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BAAoBP,EAAc9c,EAAQoc,IAGjDgB,oBAAqB,SAASH,EAAKjd,GACjC,GAAIsd,EAEJ,OAAI1d,GAAE6C,WAAWwa,IAASA,EAAI/b,oBAAqBrB,GAAW+b,QAC5D0B,EAAMtd,EAAOoF,YAAYlE,UAAUkb,gBAC5Bxc,EAAE0T,YAAYgK,IAAO,EAAOA,GAGjC1d,EAAEiE,SAASoZ,IACbK,EAAML,EAAIb,gBACHxc,EAAE0T,YAAYgK,IAAO,EAAOA,IAG9B,GAGTH,WAAY,SAASF,GACnB,OAAIrd,EAAE6C,WAAWwa,IAAUA,EAAI/b,oBAAqBrB,GAAW+b,OAI3Dhc,EAAEiE,SAASoZ,GACNA,EAAIxd,OAGN,KAPEwd,GAUXI,oBAAqB,SAASP,EAAc9c,EAAQoc,GAClDpc,EAAOoc,gBAAkBpc,EAAOoc,iBAAmBA,EAE9Cpc,EAAOoc,kBAAqBpc,EAAOud,8BAIxCvd,EAAOud,6BAA8B,EAErCT,EAAazB,eAAe,SAASjY,GAC/BpD,EAAOoc,iBACTpc,EAAOub,MAAMnY,SAOdvD"} \ No newline at end of file diff --git a/lib/backbone.marionette.min.js b/lib/backbone.marionette.min.js index 244efe529c..874319c569 100644 --- a/lib/backbone.marionette.min.js +++ b/lib/backbone.marionette.min.js @@ -1,6 +1,6 @@ // MarionetteJS (Backbone.Marionette) // ---------------------------------- -// v2.0.3 +// v2.1.0 // // Copyright (c)2014 Derick Bailey, Muted Solutions, LLC. // Distributed under MIT license @@ -18,6 +18,6 @@ -!function(a,b){if("function"==typeof define&&define.amd)define(["backbone","underscore"],function(c,d){return a.Marionette=b(a,c,d)});else if("undefined"!=typeof exports){var c=require("backbone"),d=require("underscore");module.exports=b(a,c,d)}else a.Marionette=b(a,a.Backbone,a._)}(this,function(a,b,c){"use strict";function d(a,b){var c=new Error(a);throw c.name=b||"Error",c}!function(a,b){var c=a.ChildViewContainer;return a.ChildViewContainer=function(a,b){var c=function(a){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),b.each(a,this.add,this)};b.extend(c.prototype,{add:function(a,b){var c=a.cid;return this._views[c]=a,a.model&&(this._indexByModel[a.model.cid]=c),b&&(this._indexByCustom[b]=c),this._updateLength(),this},findByModel:function(a){return this.findByModelCid(a.cid)},findByModelCid:function(a){var b=this._indexByModel[a];return this.findByCid(b)},findByCustom:function(a){var b=this._indexByCustom[a];return this.findByCid(b)},findByIndex:function(a){return b.values(this._views)[a]},findByCid:function(a){return this._views[a]},remove:function(a){var c=a.cid;return a.model&&delete this._indexByModel[a.model.cid],b.any(this._indexByCustom,function(a,b){return a===c?(delete this._indexByCustom[b],!0):void 0},this),delete this._views[c],this._updateLength(),this},call:function(a){this.apply(a,b.tail(arguments))},apply:function(a,c){b.each(this._views,function(d){b.isFunction(d[a])&&d[a].apply(d,c||[])})},_updateLength:function(){this.length=b.size(this._views)}});var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return b.each(d,function(a){c.prototype[a]=function(){var c=b.values(this._views),d=[c].concat(b.toArray(arguments));return b[a].apply(b,d)}}),c}(a,b),a.ChildViewContainer.VERSION="0.1.4",a.ChildViewContainer.noConflict=function(){return a.ChildViewContainer=c,this},a.ChildViewContainer}(b,c),function(a,b){var c=a.Wreqr,d=a.Wreqr={};return a.Wreqr.VERSION="1.3.1",a.Wreqr.noConflict=function(){return a.Wreqr=c,this},d.Handlers=function(a,b){var c=function(a){this.options=a,this._wreqrHandlers={},b.isFunction(this.initialize)&&this.initialize(a)};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events,{setHandlers:function(a){b.each(a,function(a,c){var d=null;b.isObject(a)&&!b.isFunction(a)&&(d=a.context,a=a.callback),this.setHandler(c,a,d)},this)},setHandler:function(a,b,c){var d={callback:b,context:c};this._wreqrHandlers[a]=d,this.trigger("handler:add",a,b,c)},hasHandler:function(a){return!!this._wreqrHandlers[a]},getHandler:function(a){var b=this._wreqrHandlers[a];if(b)return function(){var a=Array.prototype.slice.apply(arguments);return b.callback.apply(b.context,a)}},removeHandler:function(a){delete this._wreqrHandlers[a]},removeAllHandlers:function(){this._wreqrHandlers={}}}),c}(a,b),d.CommandStorage=function(){var c=function(a){this.options=a,this._commands={},b.isFunction(this.initialize)&&this.initialize(a)};return b.extend(c.prototype,a.Events,{getCommands:function(a){var b=this._commands[a];return b||(b={command:a,instances:[]},this._commands[a]=b),b},addCommand:function(a,b){var c=this.getCommands(a);c.instances.push(b)},clearCommands:function(a){var b=this.getCommands(a);b.instances=[]}}),c}(),d.Commands=function(a){return a.Handlers.extend({storageType:a.CommandStorage,constructor:function(b){this.options=b||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var c=Array.prototype.slice.call(arguments);a.Handlers.prototype.constructor.apply(this,c)},execute:function(a,b){a=arguments[0],b=Array.prototype.slice.call(arguments,1),this.hasHandler(a)?this.getHandler(a).apply(this,b):this.storage.addCommand(a,b)},_executeCommands:function(a,c,d){var e=this.storage.getCommands(a);b.each(e.instances,function(a){c.apply(d,a)}),this.storage.clearCommands(a)},_initializeStorage:function(a){var c,d=a.storageType||this.storageType;c=b.isFunction(d)?new d:d,this.storage=c}})}(d),d.RequestResponse=function(a){return a.Handlers.extend({request:function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);return this.hasHandler(a)?this.getHandler(a).apply(this,b):void 0}})}(d),d.EventAggregator=function(a,b){var c=function(){};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events),c}(a,b),d.Channel=function(){var c=function(b){this.vent=new a.Wreqr.EventAggregator,this.reqres=new a.Wreqr.RequestResponse,this.commands=new a.Wreqr.Commands,this.channelName=b};return b.extend(c.prototype,{reset:function(){return this.vent.off(),this.vent.stopListening(),this.reqres.removeAllHandlers(),this.commands.removeAllHandlers(),this},connectEvents:function(a,b){return this._connect("vent",a,b),this},connectCommands:function(a,b){return this._connect("commands",a,b),this},connectRequests:function(a,b){return this._connect("reqres",a,b),this},_connect:function(a,c,d){if(c){d=d||this;var e="vent"===a?"on":"setHandler";b.each(c,function(c,f){this[a][e](f,b.bind(c,d))},this)}}}),c}(d),d.radio=function(a){var c=function(){this._channels={},this.vent={},this.commands={},this.reqres={},this._proxyMethods()};b.extend(c.prototype,{channel:function(a){if(!a)throw new Error("Channel must receive a name");return this._getChannel(a)},_getChannel:function(b){var c=this._channels[b];return c||(c=new a.Channel(b),this._channels[b]=c),c},_proxyMethods:function(){b.each(["vent","commands","reqres"],function(a){b.each(d[a],function(b){this[a][b]=e(this,a,b)},this)},this)}});var d={vent:["on","off","trigger","once","stopListening","listenTo","listenToOnce"],commands:["execute","setHandler","setHandlers","removeHandler","removeAllHandlers"],reqres:["request","setHandler","setHandlers","removeHandler","removeAllHandlers"]},e=function(a,b,c){return function(d){var e=a._getChannel(d)[b],f=Array.prototype.slice.call(arguments,1);return e[c].apply(e,f)}};return new c}(d),a.Wreqr}(b,c);var e=a.Marionette,f=b.Marionette={};f.VERSION="2.0.3",f.noConflict=function(){return a.Marionette=e,this},b.Marionette=f,f.Deferred=b.$.Deferred;var g=Array.prototype.slice;return f.extend=b.Model.extend,f.getOption=function(a,b){if(a&&b){var c;return c=a.options&&void 0!==a.options[b]?a.options[b]:a[b]}},f.proxyGetOption=function(a){return f.getOption(this,a)},f.normalizeMethods=function(a){var b,d={};return c.each(a,function(a,e){b=a,c.isFunction(b)||(b=this[b]),b&&(d[e]=b)},this),d},f.normalizeUIKeys=function(a,b){return"undefined"!=typeof a?(c.each(c.keys(a),function(c){var d=/@ui.[a-zA-Z_$0-9]*/g;c.match(d)&&(a[c.replace(d,function(a){return b[a.slice(4)]})]=a[c],delete a[c])}),a):void 0},f.actAsCollection=function(a,b){var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];c.each(d,function(d){a[d]=function(){var a=c.values(c.result(this,b)),e=[a].concat(c.toArray(arguments));return c[d].apply(c,e)}})},f.triggerMethod=function(){function a(a,b,c){return c.toUpperCase()}var b=/(^|:)(\w)/gi,d=function(d){var e,f="on"+d.replace(b,a),g=this[f];return c.isFunction(g)&&(e=g.apply(this,c.tail(arguments))),c.isFunction(this.trigger)&&this.trigger.apply(this,arguments),e};return d}(),f.MonitorDOMRefresh=function(a){function b(a){a._isShown=!0,e(a)}function d(a){a._isRendered=!0,e(a)}function e(a){a._isShown&&a._isRendered&&f(a)&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}function f(b){return a.contains(b.el)}return function(a){a.listenTo(a,"show",function(){b(a)}),a.listenTo(a,"render",function(){d(a)})}}(document.documentElement),function(a){function b(a,b,e,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||d('Method "'+c+'" was configured as an event handler, but does not exist.'),a.listenTo(b,e,f)})}function e(a,b,c,d){a.listenTo(b,c,d)}function f(a,b,d,e){var f=e.split(/\s+/);c.each(f,function(c){var e=a[c];a.stopListening(b,d,e)})}function g(a,b,c,d){a.stopListening(b,c,d)}function h(a,b,d,e,f){b&&d&&(c.isFunction(d)&&(d=d.call(a)),c.each(d,function(d,g){c.isFunction(d)?e(a,b,g,d):f(a,b,g,d)}))}a.bindEntityEvents=function(a,c,d){h(a,c,d,e,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)},a.proxyBindEntityEvents=function(b,c){return a.bindEntityEvents(this,b,c)},a.proxyUnbindEntityEvents=function(b,c){return a.unbindEntityEvents(this,b,c)}}(f),f.Callbacks=function(){this._deferred=f.Deferred(),this._callbacks=[]},c.extend(f.Callbacks.prototype,{add:function(a,b){var d=c.result(this._deferred,"promise");this._callbacks.push({cb:a,ctx:b}),d.then(function(c){b&&(c.context=b),a.call(c.context,c.options)})},run:function(a,b){this._deferred.resolve({options:a,context:b})},reset:function(){var a=this._callbacks;this._deferred=f.Deferred(),this._callbacks=[],c.each(a,function(a){this.add(a.cb,a.ctx)},this)}}),f.Controller=function(a){this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},f.Controller.extend=f.extend,c.extend(f.Controller.prototype,b.Events,{destroy:function(){var a=Array.prototype.slice.call(arguments);this.triggerMethod.apply(this,["before:destroy"].concat(a)),this.triggerMethod.apply(this,["destroy"].concat(a)),this.stopListening(),this.off()},triggerMethod:f.triggerMethod,getOption:f.proxyGetOption}),f.Region=function(a){if(this.options=a||{},this.el=this.getOption("el"),this.el=this.el instanceof b.$?this.el[0]:this.el,this.el||d('An "el" must be specified for a region.',"NoElError"),this.$el=this.getEl(this.el),this.initialize){var c=Array.prototype.slice.apply(arguments);this.initialize.apply(this,c)}},c.extend(f.Region,{buildRegion:function(a,e){var f=c.isString(a),g=c.isString(a.selector),h=c.isUndefined(a.regionClass),i=c.isFunction(a);i||f||g||d("Region must be specified as a Region class,a selector string or an object with selector property");var j,k;f&&(j=a),a.selector&&(j=a.selector,delete a.selector),i&&(k=a),!i&&h&&(k=e),a.regionClass&&(k=a.regionClass,delete a.regionClass),(f||i)&&(a={}),a.el=j;var l=new k(a);return a.parentEl&&(l.getEl=function(d){if(c.isObject(d))return b.$(d);var e=a.parentEl;return c.isFunction(e)&&(e=e()),e.find(d)}),l}}),c.extend(f.Region.prototype,b.Events,{show:function(a,b){this._ensureElement();var d=b||{},e=a!==this.currentView,f=!!d.preventDestroy,g=!!d.forceShow,h=!!this.currentView,i=!f&&e;i&&this.empty();var j=e||g;return j?(a.once("destroy",c.bind(this.empty,this)),a.render(),h&&this.triggerMethod("before:swap",a),this.triggerMethod("before:show",a),c.isFunction(a.triggerMethod)?a.triggerMethod("before:show"):this.triggerMethod.call(a,"before:show"),this.attachHtml(a),this.currentView=a,h&&this.triggerMethod("swap",a),this.triggerMethod("show",a),c.isFunction(a.triggerMethod)?a.triggerMethod("show"):this.triggerMethod.call(a,"show"),this):this},_ensureElement:function(){c.isObject(this.el)||(this.$el=this.getEl(this.el),this.el=this.$el[0]),this.$el&&0!==this.$el.length||d('An "el" '+this.$el.selector+" must exist in DOM")},getEl:function(a){return b.$(a)},attachHtml:function(a){this.el.innerHTML="",this.el.appendChild(a.el)},empty:function(){var a=this.currentView;a&&(this.triggerMethod("before:empty",a),this._destroyView(),this.triggerMethod("empty",a),delete this.currentView)},_destroyView:function(){var a=this.currentView;a.destroy&&!a.isDestroyed?a.destroy():a.remove&&a.remove()},attachView:function(a){this.currentView=a},reset:function(){this.empty(),this.$el&&(this.el=this.$el.selector),delete this.$el},getOption:f.proxyGetOption,triggerMethod:f.triggerMethod}),f.Region.extend=f.extend,f.RegionManager=function(a){var b=a.Controller.extend({constructor:function(b){this._regions={},a.Controller.call(this,b)},addRegions:function(a,b){var d={};return c.each(a,function(a,e){c.isString(a)&&(a={selector:a}),a.selector&&(a=c.defaults({},a,b));var f=this.addRegion(e,a);d[e]=f},this),d},addRegion:function(b,d){var e,f=c.isObject(d),g=c.isString(d),h=!!d.selector;return e=g||f&&h?a.Region.buildRegion(d,a.Region):c.isFunction(d)?a.Region.buildRegion(d,a.Region):d,this.triggerMethod("before:add:region",b,e),this._store(b,e),this.triggerMethod("add:region",b,e),e},get:function(a){return this._regions[a]},getRegions:function(){return c.clone(this._regions)},removeRegion:function(a){var b=this._regions[a];this._remove(a,b)},removeRegions:function(){c.each(this._regions,function(a,b){this._remove(b,a)},this)},emptyRegions:function(){c.each(this._regions,function(a){a.empty()},this)},destroy:function(){this.removeRegions(),a.Controller.prototype.destroy.apply(this,arguments)},_store:function(a,b){this._regions[a]=b,this._setLength()},_remove:function(a,b){this.triggerMethod("before:remove:region",a,b),b.empty(),b.stopListening(),delete this._regions[a],this._setLength(),this.triggerMethod("remove:region",a,b)},_setLength:function(){this.length=c.size(this._regions)}});return a.actAsCollection(b.prototype,"_regions"),b}(f),f.TemplateCache=function(a){this.templateId=a},c.extend(f.TemplateCache,{templateCaches:{},get:function(a){var b=this.templateCaches[a];return b||(b=new f.TemplateCache(a),this.templateCaches[a]=b),b.load()},clear:function(){var a,b=g.call(arguments),c=b.length;if(c>0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(f.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var c=b.$(a).html();return c&&0!==c.length||d('Could not find template: "'+a+'"',"NoTemplateError"),c},compileTemplate:function(a){return c.template(a)}}),f.Renderer={render:function(a,b){a||d("Cannot render the template since its false, null or undefined.","TemplateNotFoundError");var c;return(c="function"==typeof a?a:f.TemplateCache.get(a))(b)}},f.View=b.View.extend({constructor:function(a){c.bindAll(this,"render"),this.options=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),c.isObject(this.behaviors)&&new f.Behaviors(this),b.View.apply(this,arguments),f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled)},getTemplate:function(){return this.getOption("template")},mixinTemplateHelpers:function(a){a=a||{};var b=this.getOption("templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},normalizeUIKeys:function(a){var b=c.result(this,"ui"),d=c.result(this,"_uiBindings");return f.normalizeUIKeys(a,d||b)},configureTriggers:function(){if(this.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),this.bindEntityEvents(this.model,this.getOption("modelEvents")),this.bindEntityEvents(this.collection,this.getOption("collectionEvents"))},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this)),a=this.normalizeUIKeys(a);var d={},e=c.result(this,"behaviorEvents")||{},f=this.configureTriggers();c.extend(d,e,a,f),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=Array.prototype.slice.call(arguments);b.View.prototype.undelegateEvents.apply(this,a),this.unbindEntityEvents(this.model,this.getOption("modelEvents")),this.unbindEntityEvents(this.collection,this.getOption("collectionEvents"))},onShowCalled:function(){},_ensureViewIsIntact:function(){if(this.isDestroyed){var a=new Error("Cannot use a view thats already been destroyed.");throw a.name="ViewDestroyedError",a}},destroy:function(){if(!this.isDestroyed){var a=Array.prototype.slice.call(arguments);this.triggerMethod.apply(this,["before:destroy"].concat(a)),this.isDestroyed=!0,this.triggerMethod.apply(this,["destroy"].concat(a)),this.unbindUIElements(),this.remove()}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)},triggerMethod:f.triggerMethod,normalizeMethods:f.normalizeMethods,getOption:f.proxyGetOption,bindEntityEvents:f.proxyBindEntityEvents,unbindEntityEvents:f.proxyUnbindEntityEvents}),f.ItemView=f.View.extend({constructor:function(){f.View.apply(this,arguments)},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this._ensureViewIsIntact(),this.triggerMethod("before:render",this);var a=this.serializeData();a=this.mixinTemplateHelpers(a);var b=this.getTemplate(),c=f.Renderer.render(b,a);return this.attachElContent(c),this.bindUIElements(),this.triggerMethod("render",this),this},attachElContent:function(a){return this.$el.html(a),this},destroy:function(){this.isDestroyed||f.View.prototype.destroy.apply(this,arguments)}}),f.CollectionView=f.View.extend({childViewEventPrefix:"childview",constructor:function(a){var b=a||{};this.sort=c.isUndefined(b.sort)?!0:b.sort,this._initChildViewStorage(),f.View.apply(this,arguments),this._initialEvents(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this._triggerBeforeShowBufferedChildren(),this.attachBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerBeforeShowBufferedChildren:function(){this._isShown&&c.invoke(this._bufferedChildren,"triggerMethod","before:show")},_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this.render),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(a){this.destroyEmptyView();var b=this.getChildView(a),c=this.collection.indexOf(a);this.addChild(a,b,c)},_onCollectionRemove:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},onShowCalled:function(){this.children.each(function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")})},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderChildren(),this.triggerMethod("render",this),this},_sortViews:function(){var a=this.collection.find(function(a,b){var c=this.children.findByModel(a);return c&&c._index!==b},this);a&&this.render()},_renderChildren:function(){this.destroyEmptyView(),this.destroyChildren(),this.isEmpty(this.collection)?this.showEmptyView():(this.triggerMethod("before:render:collection",this),this.startBuffering(),this.showCollection(),this.endBuffering(),this.triggerMethod("render:collection",this))},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getChildView(b),this.addChild(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this.triggerMethod("before:render:empty"),this._showingEmptyView=!0;var c=new b.Model;this.addEmptyView(c,a),this.triggerMethod("render:empty")}},destroyEmptyView:function(){this._showingEmptyView&&(this.destroyChildren(),delete this._showingEmptyView)},getEmptyView:function(){return this.getOption("emptyView")},addEmptyView:function(a,b){var d=this.getOption("emptyViewOptions")||this.getOption("childViewOptions");c.isFunction(d)&&(d=d.call(this));var e=this.buildChildView(a,b,d);this._isShown&&this.triggerMethod.call(e,"before:show"),this.children.add(e),this.renderChildView(e,-1),this._isShown&&this.triggerMethod.call(e,"show")},getChildView:function(){var a=this.getOption("childView");return a||d('A "childView" must be specified',"NoChildViewError"),a},addChild:function(a,b,d){var e=this.getOption("childViewOptions");c.isFunction(e)&&(e=e.call(this,a,d));var f=this.buildChildView(a,b,e);return this._updateIndices(f,!0,d),this._addChildView(f,d),f},_updateIndices:function(a,b,c){this.sort&&(b?(a._index=c,this.children.each(function(b){b._index>=a._index&&b._index++})):this.children.each(function(b){b._index>=a._index&&b._index--}))},_addChildView:function(a,b){this.proxyChildEvents(a),this.triggerMethod("before:add:child",a),this.children.add(a),this.renderChildView(a,b),this._isShown&&!this.isBuffering&&(c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")),this.triggerMethod("add:child",a)},renderChildView:function(a,b){a.render(),this.attachHtml(this,a,b)},buildChildView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeChildView:function(a){a&&(this.triggerMethod("before:remove:child",a),a.destroy?a.destroy():a.remove&&a.remove(),this.stopListening(a),this.children.remove(a),this.triggerMethod("remove:child",a),this._updateIndices(a,!1))},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},attachBuffer:function(a,b){a.$el.append(b)},attachHtml:function(a,b,c){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b)):a._insertBefore(b,c)||a._insertAfter(b)},_insertBefore:function(a,b){var c,d=this.sort&&b0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(f.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var c=b.$(a).html();return c&&0!==c.length||d('Could not find template: "'+a+'"',"NoTemplateError"),c},compileTemplate:function(a){return c.template(a)}}),f.Renderer={render:function(a,b){a||d("Cannot render the template since its false, null or undefined.","TemplateNotFoundError");var c;return(c="function"==typeof a?a:f.TemplateCache.get(a))(b)}},f.View=b.View.extend({constructor:function(a){c.bindAll(this,"render"),this.options=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),c.isObject(this.behaviors)&&new f.Behaviors(this),b.View.apply(this,arguments),f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled)},getTemplate:function(){return this.getOption("template")},serializeModel:function(a){return a.toJSON.apply(a,g.call(arguments,1))},mixinTemplateHelpers:function(a){a=a||{};var b=this.getOption("templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},normalizeUIKeys:function(a){var b=c.result(this,"ui"),d=c.result(this,"_uiBindings");return f.normalizeUIKeys(a,d||b)},configureTriggers:function(){if(this.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){return this._delegateDOMEvents(a),this.bindEntityEvents(this.model,this.getOption("modelEvents")),this.bindEntityEvents(this.collection,this.getOption("collectionEvents")),this},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this)),a=this.normalizeUIKeys(a);var d={},e=c.result(this,"behaviorEvents")||{},f=this.configureTriggers();c.extend(d,e,a,f),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=g.call(arguments);return b.View.prototype.undelegateEvents.apply(this,a),this.unbindEntityEvents(this.model,this.getOption("modelEvents")),this.unbindEntityEvents(this.collection,this.getOption("collectionEvents")),this},onShowCalled:function(){},_ensureViewIsIntact:function(){if(this.isDestroyed){var a=new Error("Cannot use a view thats already been destroyed.");throw a.name="ViewDestroyedError",a}},destroy:function(){if(!this.isDestroyed){var a=g.call(arguments);return this.triggerMethod.apply(this,["before:destroy"].concat(a)),this.isDestroyed=!0,this.triggerMethod.apply(this,["destroy"].concat(a)),this.unbindUIElements(),this.remove(),this}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)},triggerMethod:f.triggerMethod,normalizeMethods:f.normalizeMethods,getOption:f.proxyGetOption,bindEntityEvents:f.proxyBindEntityEvents,unbindEntityEvents:f.proxyUnbindEntityEvents}),f.ItemView=f.View.extend({constructor:function(){f.View.apply(this,arguments)},serializeData:function(){var a={};return this.model?a=c.partial(this.serializeModel,this.model).apply(this,arguments):this.collection&&(a={items:c.partial(this.serializeCollection,this.collection).apply(this,arguments)}),a},serializeCollection:function(a){return a.toJSON.apply(a,g.call(arguments,1))},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderTemplate(),this.bindUIElements(),this.triggerMethod("render",this),this},_renderTemplate:function(){var a=this.getTemplate();if(a!==!1){a||d("Cannot render the template since it is null or undefined.","UndefinedTemplateError");var b=this.serializeData();b=this.mixinTemplateHelpers(b);var c=f.Renderer.render(a,b,this);return this.attachElContent(c),this}},attachElContent:function(a){return this.$el.html(a),this},destroy:function(){return this.isDestroyed?void 0:f.View.prototype.destroy.apply(this,arguments)}}),f.CollectionView=f.View.extend({childViewEventPrefix:"childview",constructor:function(a){var b=a||{};this.sort=c.isUndefined(b.sort)?!0:b.sort,this._initChildViewStorage(),f.View.apply(this,arguments),this._initialEvents(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this._triggerBeforeShowBufferedChildren(),this.attachBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerBeforeShowBufferedChildren:function(){this._isShown&&c.invoke(this._bufferedChildren,"triggerMethod","before:show")},_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this.render),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(a){this.destroyEmptyView();var b=this.getChildView(a),c=this.collection.indexOf(a);this.addChild(a,b,c)},_onCollectionRemove:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},onShowCalled:function(){this.children.each(function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")})},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderChildren(),this.triggerMethod("render",this),this},resortView:function(){this.render()},_sortViews:function(){var a=this.collection.find(function(a,b){var c=this.children.findByModel(a);return!c||c._index!==b},this);a&&this.resortView()},_renderChildren:function(){this.destroyEmptyView(),this.destroyChildren(),this.isEmpty(this.collection)?this.showEmptyView():(this.triggerMethod("before:render:collection",this),this.startBuffering(),this.showCollection(),this.endBuffering(),this.triggerMethod("render:collection",this))},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getChildView(b),this.addChild(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this.triggerMethod("before:render:empty"),this._showingEmptyView=!0;var c=new b.Model;this.addEmptyView(c,a),this.triggerMethod("render:empty")}},destroyEmptyView:function(){this._showingEmptyView&&(this.destroyChildren(),delete this._showingEmptyView)},getEmptyView:function(){return this.getOption("emptyView")},addEmptyView:function(a,b){var d=this.getOption("emptyViewOptions")||this.getOption("childViewOptions");c.isFunction(d)&&(d=d.call(this));var e=this.buildChildView(a,b,d);this._isShown&&this.triggerMethod.call(e,"before:show"),this.children.add(e),this.renderChildView(e,-1),this._isShown&&this.triggerMethod.call(e,"show")},getChildView:function(){var a=this.getOption("childView");return a||d('A "childView" must be specified',"NoChildViewError"),a},addChild:function(a,b,d){var e=this.getOption("childViewOptions");c.isFunction(e)&&(e=e.call(this,a,d));var f=this.buildChildView(a,b,e);return this._updateIndices(f,!0,d),this._addChildView(f,d),f},_updateIndices:function(a,b,c){this.sort&&(b?(a._index=c,this.children.each(function(b){b._index>=a._index&&b._index++})):this.children.each(function(b){b._index>=a._index&&b._index--}))},_addChildView:function(a,b){this.proxyChildEvents(a),this.triggerMethod("before:add:child",a),this.children.add(a),this.renderChildView(a,b),this._isShown&&!this.isBuffering&&(c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")),this.triggerMethod("add:child",a)},renderChildView:function(a,b){return a.render(),this.attachHtml(this,a,b),a},buildChildView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeChildView:function(a){return a&&(this.triggerMethod("before:remove:child",a),a.destroy?a.destroy():a.remove&&a.remove(),this.stopListening(a),this.children.remove(a),this.triggerMethod("remove:child",a),this._updateIndices(a,!1)),a},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},attachBuffer:function(a,b){a.$el.append(b)},attachHtml:function(a,b,c){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b)):a._insertBefore(b,c)||a._insertAfter(b)},_insertBefore:function(a,b){var c,d=this.sort&&b functions or function names // and return a mapping of events => functions Marionette.normalizeMethods = function(hash) { - var normalizedHash = {}, method; - _.each(hash, function(fn, name) { - method = fn; + var normalizedHash = {}; + _.each(hash, function(method, name) { if (!_.isFunction(method)) { method = this[method]; } @@ -113,7 +112,7 @@ } _.each(_.keys(hash), function(v) { - var pattern = /@ui.[a-zA-Z_$0-9]*/g; + var pattern = /@ui\.[a-zA-Z_$0-9]*/g; if (v.match(pattern)) { hash[v.replace(pattern, function(r) { return ui[r.slice(4)]; @@ -217,7 +216,7 @@ } function isInDOM(view) { - return documentElement.contains(view.el); + return Backbone.$.contains(documentElement, view.el); } // Export public API @@ -409,12 +408,13 @@ // Ensure it can trigger events with Backbone.Events _.extend(Marionette.Controller.prototype, Backbone.Events, { destroy: function() { - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); this.triggerMethod.apply(this, ['before:destroy'].concat(args)); this.triggerMethod.apply(this, ['destroy'].concat(args)); this.stopListening(); this.off(); + return this; }, // import the `triggerMethod` to trigger events with corresponding @@ -426,6 +426,51 @@ }); + // Marionette Object + // --------------------- + // + // A Base Class that other Classes should descend from. + // Object borrows many conventions and utilities from Backbone. + Marionette.Object = function(options) { + + this.options = _.extend({}, _.result(this, 'options'), options); + + this.initialize(this.options); + }; + + Marionette.Object.extend = Marionette.extend; + + // Object Methods + // -------------- + + _.extend(Marionette.Object.prototype, { + + //this is a noop method intended to be overridden by classes that extend from this base + initialize: function() {}, + + destroy: function() { + this.triggerMethod('before:destroy'); + this.triggerMethod('destroy'); + this.stopListening(); + }, + + // Import the `triggerMethod` to trigger events with corresponding + // methods if the method exists + triggerMethod: Marionette.triggerMethod, + + // Proxy `getOption` to enable getting options from this or this.options by name. + getOption: Marionette.proxyGetOption, + + // Proxy `unbindEntityEvents` to enable binding view's events from another entity. + bindEntityEvents: Marionette.proxyBindEntityEvents, + + // Proxy `unbindEntityEvents` to enable unbinding view's events from another entity. + unbindEntityEvents: Marionette.proxyUnbindEntityEvents + }); + + // Ensure it can trigger events with Backbone.Events + _.extend(Marionette.Object.prototype, Backbone.Events); + /* jshint maxcomplexity: 10, maxstatements: 29 */ // Region @@ -448,7 +493,7 @@ this.$el = this.getEl(this.el); if (this.initialize) { - var args = Array.prototype.slice.apply(arguments); + var args = slice.apply(arguments); this.initialize.apply(this, args); } }; @@ -473,53 +518,41 @@ // } // ``` // - buildRegion: function(regionConfig, defaultRegionClass) { - var regionIsString = _.isString(regionConfig); - var regionSelectorIsString = _.isString(regionConfig.selector); - var regionClassIsUndefined = _.isUndefined(regionConfig.regionClass); - var regionIsClass = _.isFunction(regionConfig); - - if (!regionIsClass && !regionIsString && !regionSelectorIsString) { - throwError('Region must be specified as a Region class,' + - 'a selector string or an object with selector property'); + buildRegion: function(regionConfig, DefaultRegionClass) { + if (_.isString(regionConfig)) { + return this._buildRegionFromSelector(regionConfig, DefaultRegionClass); } - var selector, RegionClass; - - // get the selector for the region - - if (regionIsString) { - selector = regionConfig; + if (regionConfig.selector || regionConfig.el || regionConfig.regionClass) { + return this._buildRegionFromObject(regionConfig, DefaultRegionClass); } - if (regionConfig.selector) { - selector = regionConfig.selector; - delete regionConfig.selector; + if (_.isFunction(regionConfig)) { + return this._buildRegionFromRegionClass(regionConfig); } - // get the class for the region - - if (regionIsClass) { - RegionClass = regionConfig; - } + throwError('Improper region configuration type. Please refer ' + + 'to http://marionettejs.com/docs/marionette.region.html#region-configuration-types'); + }, - if (!regionIsClass && regionClassIsUndefined) { - RegionClass = defaultRegionClass; - } + // Build the region from a string selector like '#foo-region' + _buildRegionFromSelector: function(selector, DefaultRegionClass) { + return new DefaultRegionClass({ el: selector }); + }, - if (regionConfig.regionClass) { - RegionClass = regionConfig.regionClass; - delete regionConfig.regionClass; - } + // Build the region from a configuration object + // ```js + // { selector: '#foo', regionClass: FooRegion } + // ``` + _buildRegionFromObject: function(regionConfig, DefaultRegionClass) { + var RegionClass = regionConfig.regionClass || DefaultRegionClass; + var options = _.omit(regionConfig, 'selector', 'regionClass'); - if (regionIsString || regionIsClass) { - regionConfig = {}; + if (regionConfig.selector && !options.el) { + options.el = regionConfig.selector; } - regionConfig.el = selector; - - // build the region instance - var region = new RegionClass(regionConfig); + var region = new RegionClass(options); // override the `getEl` function if we have a parentEl // this must be overridden to ensure the selector is found @@ -541,6 +574,11 @@ } return region; + }, + + // Build the region directly from a given `RegionClass` + _buildRegionFromRegionClass: function(RegionClass) { + return new RegionClass(); } }); @@ -664,6 +702,7 @@ // Remove region pointer to the currentView delete this.currentView; + return this; }, // call 'destroy' or 'remove', depending on which is found @@ -684,6 +723,14 @@ // of the region. attachView: function(view) { this.currentView = view; + return this; + }, + + // Checks whether a view is currently present within + // the region. Returns `true` if there is and `false` if + // no view is present. + hasView: function() { + return !!this.currentView; }, // Reset the region by destroying any existing view and @@ -698,6 +745,7 @@ } delete this.$el; + return this; }, // Proxy `getOption` to enable getting options from this or this.options by name. @@ -723,10 +771,15 @@ Marionette.Controller.call(this, options); }, - // Add multiple regions using an object literal, where + // Add multiple regions using an object literal or a + // function that returns an object literal, where // each key becomes the region name, and each value is // the region definition. addRegions: function(regionDefinitions, defaults) { + if (_.isFunction(regionDefinitions)) { + regionDefinitions = regionDefinitions.apply(this, arguments); + } + var regions = {}; _.each(regionDefinitions, function(definition, name) { @@ -785,29 +838,37 @@ removeRegion: function(name) { var region = this._regions[name]; this._remove(name, region); + + return region; }, // Empty all regions in the region manager, and // remove them removeRegions: function() { + var regions = this.getRegions(); _.each(this._regions, function(region, name) { this._remove(name, region); }, this); + + return regions; }, // Empty all regions in the region manager, but // leave them attached emptyRegions: function() { - _.each(this._regions, function(region) { + var regions = this.getRegions(); + _.each(regions, function(region) { region.empty(); }, this); + + return regions; }, // Destroy all regions and shut down the region // manager entirely destroy: function() { this.removeRegions(); - Marionette.Controller.prototype.destroy.apply(this, arguments); + return Marionette.Controller.prototype.destroy.apply(this, arguments); }, // internal method to store regions @@ -998,6 +1059,12 @@ return this.getOption('template'); }, + // Serialize a model by returning its attributes. Clones + // the attributes to allow modification. + serializeModel: function(model){ + return model.toJSON.apply(model, slice.call(arguments, 1)); + }, + // Mix in template helper methods. Looks for a // `templateHelpers` attribute, which can either be an // object literal, or a function that returns an object @@ -1073,6 +1140,7 @@ this._delegateDOMEvents(events); this.bindEntityEvents(this.model, this.getOption('modelEvents')); this.bindEntityEvents(this.collection, this.getOption('collectionEvents')); + return this; }, // internal method to delegate DOM events and triggers @@ -1098,10 +1166,11 @@ // Overriding Backbone.View's undelegateEvents to handle unbinding // the `triggers`, `modelEvents`, and `collectionEvents` config undelegateEvents: function() { - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); Backbone.View.prototype.undelegateEvents.apply(this, args); this.unbindEntityEvents(this.model, this.getOption('modelEvents')); this.unbindEntityEvents(this.collection, this.getOption('collectionEvents')); + return this; }, // Internal method, handles the `show` event. @@ -1123,7 +1192,7 @@ destroy: function() { if (this.isDestroyed) { return; } - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); this.triggerMethod.apply(this, ['before:destroy'].concat(args)); @@ -1138,6 +1207,7 @@ // remove the view from the DOM this.remove(); + return this; }, // This method binds the elements specified in the "ui" hash inside the view's code with @@ -1211,24 +1281,30 @@ }, // Serialize the model or collection for the view. If a model is - // found, `.toJSON()` is called. If a collection is found, `.toJSON()` - // is also called, but is used to populate an `items` array in the - // resulting data. If both are found, defaults to the model. - // You can override the `serializeData` method in your own view - // definition, to provide custom serialization for your view's data. - serializeData: function() { + // found, the view's `serializeModel` is called. If a collection is found, + // each model in the collection is serialized by calling + // the view's `serializeCollection` and put into an `items` array in + // the resulting data. If both are found, defaults to the model. + // You can override the `serializeData` method in your own view definition, + // to provide custom serialization for your view's data. + serializeData: function(){ var data = {}; if (this.model) { - data = this.model.toJSON(); + data = _.partial(this.serializeModel, this.model).apply(this, arguments); } else if (this.collection) { - data = {items: this.collection.toJSON()}; + data = { items: _.partial(this.serializeCollection, this.collection).apply(this, arguments) }; } return data; }, + // Serialize a collection by serializing each of its models. + serializeCollection: function(collection){ + return collection.toJSON.apply(collection, slice.call(arguments, 1)); + }, + // Render the view, defaulting to underscore.js templates. // You can override this in your view definition to provide // a very specific rendering for your view. In general, though, @@ -1239,15 +1315,38 @@ this.triggerMethod('before:render', this); + this._renderTemplate(); + this.bindUIElements(); + + this.triggerMethod('render', this); + + return this; + }, + + // Internal method to render the template with the serialized data + // and template helpers via the `Marionette.Renderer` object. + // Throws an `UndefinedTemplateError` error if the template is + // any falsely value but literal `false`. + _renderTemplate: function() { + var template = this.getTemplate(); + + // Allow template-less item views + if (template === false) { + return; + } + + if (!template) { + throwError('Cannot render the template since it is null or undefined.', + 'UndefinedTemplateError'); + } + + // Add in entity data and template helpers var data = this.serializeData(); data = this.mixinTemplateHelpers(data); - var template = this.getTemplate(); - var html = Marionette.Renderer.render(template, data); + // Render and add to el + var html = Marionette.Renderer.render(template, data, this); this.attachElContent(html); - this.bindUIElements(); - - this.triggerMethod('render', this); return this; }, @@ -1275,7 +1374,7 @@ destroy: function() { if (this.isDestroyed) { return; } - Marionette.View.prototype.destroy.apply(this, arguments); + return Marionette.View.prototype.destroy.apply(this, arguments); } }); @@ -1363,7 +1462,7 @@ }, // Handle a child added to the collection - _onCollectionAdd: function(child, collection, options) { + _onCollectionAdd: function(child) { this.destroyEmptyView(); var ChildView = this.getChildView(child); var index = this.collection.indexOf(child); @@ -1399,17 +1498,25 @@ return this; }, + // Render view after sorting. Override this method to + // change how the view renders after a `sort` on the collection. + // An example of this would be to only `renderChildren` in a `CompositeView` + // rather than the full view. + resortView: function() { + this.render(); + }, + // Internal method. This checks for any changes in the order of the collection. // If the index of any view doesn't match, it will render. - _sortViews: function(){ + _sortViews: function() { // check for any changes in sort order of views var orderChanged = this.collection.find(function(item, index){ var view = this.children.findByModel(item); - return view && view._index !== index; + return !view || view._index !== index; }, this); if (orderChanged) { - this.render(); + this.resortView(); } }, @@ -1507,9 +1614,12 @@ } }, - // Retrieve the childView class, either from `this.options.childView` + // Retrieve the `childView` class, either from `this.options.childView` // or from the `childView` in the object definition. The "options" // takes precedence. + // This method receives the model that will be passed to the instance + // created from this `childView`. Overriding methods may use the child + // to determine what `childView` class to return. getChildView: function(child) { var childView = this.getOption('childView'); @@ -1597,6 +1707,7 @@ renderChildView: function(view, index) { view.render(); this.attachHtml(this, view, index); + return view; }, // Build a `childView` for a model in the collection. @@ -1625,6 +1736,7 @@ this._updateIndices(view, false); } + return view; }, // check if the collection is empty @@ -1704,14 +1816,16 @@ this.destroyChildren(); this.triggerMethod('destroy:collection'); - Marionette.View.prototype.destroy.apply(this, arguments); + return Marionette.View.prototype.destroy.apply(this, arguments); }, // Destroy the child views that this collection view // is holding on to, if any destroyChildren: function() { + var childViews = this.children.map(_.identity); this.children.each(this.removeChildView, this); this.checkEmpty(); + return childViews; }, // Set up the child view event forwarding. Uses a "childview:" @@ -1722,7 +1836,7 @@ // Forward all child view events through the parent, // prepending "childview:" to the event name this.listenTo(view, 'all', function() { - var args = Array.prototype.slice.call(arguments); + var args = slice.call(arguments); var rootEvent = args[0]; var childEvents = this.normalizeMethods(_.result(this, 'childEvents')); @@ -1799,8 +1913,8 @@ serializeData: function() { var data = {}; - if (this.model) { - data = this.model.toJSON(); + if (this.model){ + data = _.partial(this.serializeModel, this.model).apply(this, arguments); } return data; @@ -1816,7 +1930,7 @@ this.triggerMethod('before:render', this); - this._renderRoot(); + this._renderTemplate(); this._renderChildren(); this.triggerMethod('render', this); @@ -1831,7 +1945,7 @@ // Render the root template that the children // views are appended to - _renderRoot: function() { + _renderTemplate: function() { var data = {}; data = this.serializeData(); data = this.mixinTemplateHelpers(data); @@ -1839,7 +1953,7 @@ this.triggerMethod('before:render:template'); var template = this.getTemplate(); - var html = Marionette.Renderer.render(template, data); + var html = Marionette.Renderer.render(template, data, this); this.attachElContent(html); // the ui bindings is done here and not at the end of render since they @@ -1966,10 +2080,10 @@ // Handle destroying regions, and then destroy the view itself. destroy: function() { - if (this.isDestroyed) { return; } + if (this.isDestroyed) { return this; } this.regionManager.destroy(); - Marionette.ItemView.prototype.destroy.apply(this, arguments); + return Marionette.ItemView.prototype.destroy.apply(this, arguments); }, // Add a single region, by name, to the layoutView @@ -2177,7 +2291,10 @@ // is not set until after setElement is called. _.each(behaviors, function(b) { b.$el = this.$el; + b.el = this.el; }, this); + + return this; }, destroy: function(destroy, behaviors) { @@ -2189,6 +2306,7 @@ // This unbinds event listeners // that behaviors have registerd for. _.invoke(behaviors, 'destroy', args); + return this; }, bindUIElements: function(bindUIElements, behaviors) { @@ -2218,6 +2336,8 @@ Marionette.bindEntityEvents(b, this.model, Marionette.getOption(b, 'modelEvents')); Marionette.bindEntityEvents(b, this.collection, Marionette.getOption(b, 'collectionEvents')); }, this); + + return this; }, undelegateEvents: function(undelegateEvents, behaviors) { @@ -2228,6 +2348,8 @@ Marionette.unbindEntityEvents(b, this.model, Marionette.getOption(b, 'modelEvents')); Marionette.unbindEntityEvents(b, this.collection, Marionette.getOption(b, 'collectionEvents')); }, this); + + return this; }, behaviorEvents: function(behaviorEvents, behaviors) { @@ -2373,7 +2495,7 @@ // method call, if it exists _processOnRoute: function(routeName, routeArgs) { // find the path that matched - var routePath = _.invert(this.appRoutes)[routeName]; + var routePath = _.invert(this.getOption('appRoutes'))[routeName]; // make sure an onRoute is there, and call it if (_.isFunction(this.onRoute)) { @@ -2419,15 +2541,11 @@ // Stores and starts up `Region` objects, includes an // event aggregator as `app.vent` Marionette.Application = function(options) { - this._initRegionManager(); + this._initializeRegions(options); this._initCallbacks = new Marionette.Callbacks(); - var globalCh = Backbone.Wreqr.radio.channel('global'); - this.vent = globalCh.vent; - this.commands = globalCh.commands; - this.reqres = globalCh.reqres; this.submodules = {}; - _.extend(this, options); + this._initChannel(); }; _.extend(Marionette.Application.prototype, Backbone.Events, { @@ -2467,14 +2585,14 @@ // Empty all regions in the app, without removing them emptyRegions: function() { - this._regionManager.emptyRegions(); + return this._regionManager.emptyRegions(); }, // Removes a region from your app, by name // Accepts the regions name // removeRegion('myRegion') removeRegion: function(region) { - this._regionManager.removeRegion(region); + return this._regionManager.removeRegion(region); }, // Provides alternative access to regions @@ -2504,9 +2622,39 @@ return ModuleClass.create.apply(ModuleClass, args); }, + // Enable easy overriding of the default `RegionManager` + // for customized region interactions and business-specific + // view logic for better control over single regions. + getRegionManager: function() { + return new Marionette.RegionManager(); + }, + + // Internal method to initialize the regions that have been defined in a + // `regions` attribute on the application instance + _initializeRegions: function(options) { + var regions = _.isFunction(this.regions) ? this.regions(options) : this.regions || {}; + + this._initRegionManager(); + + // Enable users to define `regions` in instance options. + var optionRegions = Marionette.getOption(options, 'regions'); + + // Enable region options to be a function + if (_.isFunction(optionRegions)) { + optionRegions = optionRegions.call(this, options); + } + + // Overwrite current regions with those passed in options + _.extend(regions, optionRegions); + + this.addRegions(regions); + + return this; + }, + // Internal method to set up the region manager _initRegionManager: function() { - this._regionManager = new Marionette.RegionManager(); + this._regionManager = this.getRegionManager(); this.listenTo(this._regionManager, 'before:add:region', function(name) { this.triggerMethod('before:add:region', name); @@ -2527,9 +2675,21 @@ }); }, + // Internal method to setup the Wreqr.radio channel + _initChannel: function() { + this.channelName = _.result(this, 'channelName') || 'global'; + this.channel = _.result(this, 'channel') || Backbone.Wreqr.radio.channel(this.channelName); + this.vent = _.result(this, 'vent') || this.channel.vent; + this.commands = _.result(this, 'commands') || this.channel.commands; + this.reqres = _.result(this, 'reqres') || this.channel.reqres; + }, + // import the `triggerMethod` to trigger events with corresponding // methods if the method exists - triggerMethod: Marionette.triggerMethod + triggerMethod: Marionette.triggerMethod, + + // Proxy `getOption` to enable getting options from this or this.options by name. + getOption: Marionette.proxyGetOption }); // Copy the `extend` function used by Backbone's classes diff --git a/lib/core/backbone.marionette.map b/lib/core/backbone.marionette.map index 891bc473af..239879697b 100644 --- a/lib/core/backbone.marionette.map +++ b/lib/core/backbone.marionette.map @@ -1 +1 @@ -{"version":3,"file":"lib/core/backbone.marionette.min.js","sources":["core/backbone.marionette.js"],"names":["root","factory","define","amd","Backbone","_","Marionette","exports","require","module","this","throwError","message","name","error","Error","previousMarionette","VERSION","noConflict","Deferred","$","slice","Array","prototype","extend","Model","getOption","target","optionName","value","options","undefined","proxyGetOption","normalizeMethods","hash","method","normalizedHash","each","fn","isFunction","normalizeUIKeys","ui","keys","v","pattern","match","replace","r","actAsCollection","object","listProperty","methods","list","values","result","args","concat","toArray","arguments","apply","triggerMethod","getEventName","prefix","eventName","toUpperCase","splitter","event","methodName","tail","trigger","MonitorDOMRefresh","documentElement","handleShow","view","_isShown","triggerDOMRefresh","handleRender","_isRendered","isInDOM","contains","el","listenTo","document","bindFromStrings","entity","evt","methodNames","split","bindToFunction","unbindFromStrings","stopListening","unbindToFunction","iterateEvents","bindings","functionCallback","stringCallback","call","bindEntityEvents","unbindEntityEvents","proxyBindEntityEvents","proxyUnbindEntityEvents","Callbacks","_deferred","_callbacks","add","callback","contextOverride","promise","push","cb","ctx","then","context","run","resolve","reset","callbacks","Controller","initialize","Events","destroy","off","Region","$el","getEl","buildRegion","regionConfig","defaultRegionClass","regionIsString","isString","regionSelectorIsString","selector","regionClassIsUndefined","isUndefined","regionClass","regionIsClass","RegionClass","region","parentEl","isObject","find","show","_ensureElement","showOptions","isDifferentView","currentView","preventDestroy","forceShow","isChangingView","_shouldDestroyView","empty","_shouldShowView","once","bind","render","attachHtml","length","innerHTML","appendChild","_destroyView","isDestroyed","remove","attachView","RegionManager","constructor","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","hasSelector","_store","get","getRegions","clone","removeRegion","_remove","removeRegions","emptyRegions","_setLength","size","TemplateCache","templateId","templateCaches","cachedTemplate","load","clear","i","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","events","behaviors","Behaviors","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","uiBindings","configureTriggers","triggers","triggerEvents","key","hasOptions","e","prevent","preventDefault","stop","stopPropagation","shouldPrevent","shouldStop","model","collection","delegateEvents","_delegateDOMEvents","combinedEvents","behaviorEvents","undelegateEvents","_ensureViewIsIntact","err","unbindUIElements","bindUIElements","_uiBindings","ItemView","serializeData","toJSON","items","attachElContent","CollectionView","childViewEventPrefix","initOptions","sort","_initChildViewStorage","_initialEvents","initRenderBuffer","elBuffer","createDocumentFragment","_bufferedChildren","startBuffering","isBuffering","endBuffering","_triggerBeforeShowBufferedChildren","attachBuffer","_triggerShowBufferedChildren","invoke","child","_onCollectionAdd","_onCollectionRemove","_sortViews","destroyEmptyView","ChildView","getChildView","index","indexOf","addChild","children","findByModel","removeChildView","checkEmpty","_renderChildren","orderChanged","item","_index","destroyChildren","isEmpty","showEmptyView","showCollection","EmptyView","getEmptyView","_showingEmptyView","addEmptyView","emptyViewOptions","buildChildView","renderChildView","childView","childViewOptions","_updateIndices","_addChildView","increment","laterView","proxyChildEvents","ChildViewClass","collectionView","buffer","append","_insertBefore","_insertAfter","findPosition","before","ChildViewContainer","rootEvent","childEvents","splice","CompositeView","isRendered","resetChildViewContainer","_renderRoot","compositeView","$container","getChildViewContainer","containerView","$childViewContainer","container","childViewContainer","charAt","substr","LayoutView","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","getRegion","that","_initRegionManager","regionOptions","getRegionManager","Behavior","parseBehaviors","wrap","setElement","b","_behaviorsEvents","viewUI","_events","behaviorUI","whitespace","join","eventKey","handler","behaviorsLookup","getBehaviorClass","behaviorClass","chain","map","BehaviorClass","behavior","nestedBehaviors","flatten","partial","AppRouter","Router","appRoutes","controller","_getController","processAppRoutes","on","_processOnRoute","appRoute","route","_addAppRoute","routeName","routeArgs","routePath","invert","onRoute","routeNames","reverse","Application","_initCallbacks","globalCh","Wreqr","radio","channel","vent","commands","reqres","submodules","execute","request","addInitializer","initializer","start","_regionManager","moduleNames","moduleDefinition","ModuleClass","Module","getClass","unshift","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","addDefinition","customArgs","_runModuleDefinition","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","moduleClass","_getDefine","_getStartWithParent","_addStartWithParent","swp","startWithParentIsConfigured"],"mappings":"CASC,SAASA,EAAMC,GAEd,GAAsB,kBAAXC,SAAyBA,OAAOC,IACzCD,QAAQ,WAAY,aAAc,iBAAkB,uBAAwB,SAASE,EAAUC,GAC7F,MAAQL,GAAKM,WAAaL,EAAQD,EAAMI,EAAUC,SAE/C,IAAuB,mBAAZE,SAAyB,CACzC,CAAA,GAAIH,GAAWI,QAAQ,YACnBH,EAAIG,QAAQ,aACJA,SAAQ,kBACHA,QAAQ,uBACzBC,OAAOF,QAAUN,EAAQD,EAAMI,EAAUC,OAEzCL,GAAKM,WAAaL,EAAQD,EAAMA,EAAKI,SAAUJ,EAAKK,IAGtDK,KAAM,SAASV,EAAMI,EAAUC,GAC/B,YAwBA,SAASM,GAAWC,EAASC,GAC3B,GAAIC,GAAQ,GAAIC,OAAMH,EAEtB,MADAE,GAAMD,KAAOA,GAAQ,QACfC,EAzBR,GAAIE,GAAqBhB,EAAKM,WAE1BA,EAAaF,EAASE,aAE1BA,GAAWW,QAAU,QAErBX,EAAWY,WAAa,WAEtB,MADAlB,GAAKM,WAAaU,EACXN,MAITJ,EAAWa,SAAWf,EAASgB,EAAED,QAQjC,IAAIE,GAAQC,MAAMC,UAAUF,KAusF5B,OA3rFAf,GAAWkB,OAASpB,EAASqB,MAAMD,OAOnClB,EAAWoB,UAAY,SAASC,EAAQC,GACtC,GAAKD,GAAWC,EAAhB,CACA,GAAIC,EAQJ,OALEA,GADEF,EAAOG,SAA2CC,SAA/BJ,EAAOG,QAAQF,GAC5BD,EAAOG,QAAQF,GAEfD,EAAOC,KAOnBtB,EAAW0B,eAAiB,SAASJ,GACnC,MAAOtB,GAAWoB,UAAUhB,KAAMkB,IAQpCtB,EAAW2B,iBAAmB,SAASC,GACrC,GAAyBC,GAArBC,IAWJ,OAVA/B,GAAEgC,KAAKH,EAAM,SAASI,EAAIzB,GACxBsB,EAASG,EACJjC,EA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AetB,EAT9BA,GAeXoB,qBAAsB,SAASF,EAAc3Y,EAAQ8Y,EAAKhW,GACxD,GAAIjB,GAAK5B,KAAK+Y,WAAWF,GACrBb,EAAkBhY,KAAKgZ,oBAAoBH,EAAK9Y,EAEhD6B,IACF7B,EAAOuY,cAAc1W,EAAIiB,GAG3B7C,KAAKiZ,oBAAoBP,EAAc3Y,EAAQiY,IAGjDgB,oBAAqB,SAASH,EAAK9Y,GACjC,GAAImZ,EAEJ,OAAIvZ,GAAEkC,WAAWgX,IAASA,EAAIhY,oBAAqBjB,GAAW6X,QAC5DyB,EAAMnZ,EAAO2J,YAAY7I,UAAUmX,gBAC5BrY,EAAEgI,YAAYuR,IAAO,EAAOA,GAGjCvZ,EAAEsI,SAAS4Q,IACbK,EAAML,EAAIb,gBACHrY,EAAEgI,YAAYuR,IAAO,EAAOA,IAG9B,GAGTH,WAAY,SAASF,GACnB,OAAIlZ,EAAEkC,WAAWgX,IAAUA,EAAIhY,oBAAqBjB,GAAW6X,OAI3D9X,EAAEsI,SAAS4Q,GACNA,EAAIrZ,OAGN,KAPEqZ,GAUXI,oBAAqB,SAASP,EAAc3Y,EAAQiY,GAClDjY,EAAOiY,gBAAkBjY,EAAOiY,iBAAmBA,EAE9CjY,EAAOiY,kBAAqBjY,EAAOoZ,8BAIxCpZ,EAAOoZ,6BAA8B,EAErCT,EAAaxB,eAAe,SAAS9V,GAC/BrB,EAAOiY,iBACTjY,EAAOqX,MAAMhW,SAOdxB"} \ No newline at end of file +{"version":3,"file":"lib/core/backbone.marionette.min.js","sources":["core/backbone.marionette.js"],"names":["root","factory","define","amd","Backbone","_","Marionette","exports","require","module","this","throwError","message","name","error","Error","previousMarionette","VERSION","noConflict","Deferred","$","slice","Array","prototype","extend","Model","getOption","target","optionName","value","options","undefined","proxyGetOption","normalizeMethods","hash","normalizedHash","each","method","isFunction","normalizeUIKeys","ui","keys","v","pattern","match","replace","r","actAsCollection","object","listProperty","methods","list","values","result","args","concat","toArray","arguments","apply","triggerMethod","getEventName","prefix","eventName","toUpperCase","splitter","event","methodName","tail","trigger","MonitorDOMRefresh","documentElement","handleShow","view","_isShown","triggerDOMRefresh","handleRender","_isRendered","isInDOM","contains","el","listenTo","document","bindFromStrings","entity","evt","methodNames","split","bindToFunction","unbindFromStrings","stopListening","unbindToFunction","iterateEvents","bindings","functionCallback","stringCallback","call","bindEntityEvents","unbindEntityEvents","proxyBindEntityEvents","proxyUnbindEntityEvents","Callbacks","_deferred","_callbacks","add","callback","contextOverride","promise","push","cb","ctx","then","context","run","resolve","reset","callbacks","Controller","initialize","Events","destroy","off","Object","Region","$el","getEl","buildRegion","regionConfig","DefaultRegionClass","isString","_buildRegionFromSelector","selector","regionClass","_buildRegionFromObject","_buildRegionFromRegionClass","RegionClass","omit","region","parentEl","isObject","find","show","_ensureElement","showOptions","isDifferentView","currentView","preventDestroy","forceShow","isChangingView","_shouldDestroyView","empty","_shouldShowView","once","bind","render","attachHtml","length","innerHTML","appendChild","_destroyView","isDestroyed","remove","attachView","hasView","RegionManager","constructor","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","hasSelector","_store","get","getRegions","clone","removeRegion","_remove","removeRegions","emptyRegions","_setLength","size","TemplateCache","templateId","templateCaches","cachedTemplate","load","clear","i","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","events","behaviors","Behaviors","onShowCalled","getTemplate","serializeModel","model","toJSON","mixinTemplateHelpers","templateHelpers","uiBindings","configureTriggers","triggers","triggerEvents","key","hasOptions","e","prevent","preventDefault","stop","stopPropagation","shouldPrevent","shouldStop","collection","delegateEvents","_delegateDOMEvents","combinedEvents","behaviorEvents","undelegateEvents","_ensureViewIsIntact","err","unbindUIElements","bindUIElements","_uiBindings","ItemView","serializeData","partial","items","serializeCollection","_renderTemplate","attachElContent","CollectionView","childViewEventPrefix","initOptions","sort","isUndefined","_initChildViewStorage","_initialEvents","initRenderBuffer","elBuffer","createDocumentFragment","_bufferedChildren","startBuffering","isBuffering","endBuffering","_triggerBeforeShowBufferedChildren","attachBuffer","_triggerShowBufferedChildren","invoke","child","_onCollectionAdd","_onCollectionRemove","_sortViews","destroyEmptyView","ChildView","getChildView","index","indexOf","addChild","children","findByModel","removeChildView","checkEmpty","_renderChildren","resortView","orderChanged","item","_index","destroyChildren","isEmpty","showEmptyView","showCollection","EmptyView","getEmptyView","_showingEmptyView","addEmptyView","emptyViewOptions","buildChildView","renderChildView","childView","childViewOptions","_updateIndices","_addChildView","increment","laterView","proxyChildEvents","ChildViewClass","collectionView","buffer","append","_insertBefore","_insertAfter","findPosition","before","ChildViewContainer","childViews","map","identity","rootEvent","childEvents","splice","CompositeView","isRendered","resetChildViewContainer","compositeView","$container","getChildViewContainer","containerView","$childViewContainer","container","childViewContainer","charAt","substr","LayoutView","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","getRegion","that","_initRegionManager","regionOptions","getRegionManager","Behavior","parseBehaviors","wrap","setElement","b","_behaviorsEvents","viewUI","_events","behaviorUI","whitespace","join","eventKey","handler","behaviorsLookup","getBehaviorClass","behaviorClass","chain","BehaviorClass","behavior","nestedBehaviors","flatten","AppRouter","Router","appRoutes","controller","_getController","processAppRoutes","on","_processOnRoute","appRoute","route","_addAppRoute","routeName","routeArgs","routePath","invert","onRoute","routeNames","reverse","Application","_initCallbacks","submodules","_initChannel","execute","commands","request","reqres","addInitializer","initializer","start","_regionManager","moduleNames","moduleDefinition","ModuleClass","Module","getClass","unshift","create","optionRegions","channelName","channel","Wreqr","radio","vent","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","addDefinition","customArgs","_runModuleDefinition","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","moduleClass","fn","_getDefine","_getStartWithParent","_addStartWithParent","swp","startWithParentIsConfigured"],"mappings":"CASC,SAASA,EAAMC,GAEd,GAAsB,kBAAXC,SAAyBA,OAAOC,IACzCD,QA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,UAAU2X,gBAC5B7Y,EAAEiP,YAAY+K,IAAO,EAAOA,GAGjCha,EAAEqI,SAASqR,IACbM,EAAMN,EAAIb,gBACH7Y,EAAEiP,YAAY+K,IAAO,EAAOA,IAG9B,GAGTH,WAAY,SAASH,GACnB,OAAI1Z,EAAEiC,WAAWyX,IAAUA,EAAIxY,oBAAqBjB,GAAW+X,OAI3DhY,EAAEqI,SAASqR,GACNA,EAAI7Z,OAGN,KAPE6Z,GAUXK,oBAAqB,SAASR,EAAcnZ,EAAQyY,GAClDzY,EAAOyY,gBAAkBzY,EAAOyY,iBAAmBA,EAE9CzY,EAAOyY,kBAAqBzY,EAAO6Z,8BAIxC7Z,EAAO6Z,6BAA8B,EAErCV,EAAa9B,eAAe,SAAShW,GAC/BrB,EAAOyY,iBACTzY,EAAOuX,MAAMlW,SAOdxB"} \ No newline at end of file diff --git a/lib/core/backbone.marionette.min.js b/lib/core/backbone.marionette.min.js index 17fa99a5b0..44b8cc6f8d 100644 --- a/lib/core/backbone.marionette.min.js +++ b/lib/core/backbone.marionette.min.js @@ -1,2 +1,2 @@ -!function(a,b){if("function"==typeof define&&define.amd)define(["backbone","underscore","backbone.wreqr","backbone.babysitter"],function(c,d){return a.Marionette=b(a,c,d)});else if("undefined"!=typeof exports){{var c=require("backbone"),d=require("underscore");require("backbone.wreqr"),require("backbone.babysitter")}module.exports=b(a,c,d)}else a.Marionette=b(a,a.Backbone,a._)}(this,function(a,b,c){"use strict";function d(a,b){var c=new Error(a);throw c.name=b||"Error",c}var e=a.Marionette,f=b.Marionette={};f.VERSION="2.0.3",f.noConflict=function(){return a.Marionette=e,this},f.Deferred=b.$.Deferred;var g=Array.prototype.slice;return f.extend=b.Model.extend,f.getOption=function(a,b){if(a&&b){var c;return c=a.options&&void 0!==a.options[b]?a.options[b]:a[b]}},f.proxyGetOption=function(a){return f.getOption(this,a)},f.normalizeMethods=function(a){var b,d={};return c.each(a,function(a,e){b=a,c.isFunction(b)||(b=this[b]),b&&(d[e]=b)},this),d},f.normalizeUIKeys=function(a,b){return"undefined"!=typeof a?(c.each(c.keys(a),function(c){var d=/@ui.[a-zA-Z_$0-9]*/g;c.match(d)&&(a[c.replace(d,function(a){return b[a.slice(4)]})]=a[c],delete a[c])}),a):void 0},f.actAsCollection=function(a,b){var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];c.each(d,function(d){a[d]=function(){var a=c.values(c.result(this,b)),e=[a].concat(c.toArray(arguments));return c[d].apply(c,e)}})},f.triggerMethod=function(){function a(a,b,c){return c.toUpperCase()}var b=/(^|:)(\w)/gi,d=function(d){var e,f="on"+d.replace(b,a),g=this[f];return c.isFunction(g)&&(e=g.apply(this,c.tail(arguments))),c.isFunction(this.trigger)&&this.trigger.apply(this,arguments),e};return d}(),f.MonitorDOMRefresh=function(a){function b(a){a._isShown=!0,e(a)}function d(a){a._isRendered=!0,e(a)}function e(a){a._isShown&&a._isRendered&&f(a)&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}function f(b){return a.contains(b.el)}return function(a){a.listenTo(a,"show",function(){b(a)}),a.listenTo(a,"render",function(){d(a)})}}(document.documentElement),function(a){function b(a,b,e,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||d('Method "'+c+'" was configured as an event handler, but does not exist.'),a.listenTo(b,e,f)})}function e(a,b,c,d){a.listenTo(b,c,d)}function f(a,b,d,e){var f=e.split(/\s+/);c.each(f,function(c){var e=a[c];a.stopListening(b,d,e)})}function g(a,b,c,d){a.stopListening(b,c,d)}function h(a,b,d,e,f){b&&d&&(c.isFunction(d)&&(d=d.call(a)),c.each(d,function(d,g){c.isFunction(d)?e(a,b,g,d):f(a,b,g,d)}))}a.bindEntityEvents=function(a,c,d){h(a,c,d,e,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)},a.proxyBindEntityEvents=function(b,c){return a.bindEntityEvents(this,b,c)},a.proxyUnbindEntityEvents=function(b,c){return a.unbindEntityEvents(this,b,c)}}(f),f.Callbacks=function(){this._deferred=f.Deferred(),this._callbacks=[]},c.extend(f.Callbacks.prototype,{add:function(a,b){var d=c.result(this._deferred,"promise");this._callbacks.push({cb:a,ctx:b}),d.then(function(c){b&&(c.context=b),a.call(c.context,c.options)})},run:function(a,b){this._deferred.resolve({options:a,context:b})},reset:function(){var a=this._callbacks;this._deferred=f.Deferred(),this._callbacks=[],c.each(a,function(a){this.add(a.cb,a.ctx)},this)}}),f.Controller=function(a){this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},f.Controller.extend=f.extend,c.extend(f.Controller.prototype,b.Events,{destroy:function(){var a=Array.prototype.slice.call(arguments);this.triggerMethod.apply(this,["before:destroy"].concat(a)),this.triggerMethod.apply(this,["destroy"].concat(a)),this.stopListening(),this.off()},triggerMethod:f.triggerMethod,getOption:f.proxyGetOption}),f.Region=function(a){if(this.options=a||{},this.el=this.getOption("el"),this.el=this.el instanceof b.$?this.el[0]:this.el,this.el||d('An "el" must be specified for a region.',"NoElError"),this.$el=this.getEl(this.el),this.initialize){var c=Array.prototype.slice.apply(arguments);this.initialize.apply(this,c)}},c.extend(f.Region,{buildRegion:function(a,e){var f=c.isString(a),g=c.isString(a.selector),h=c.isUndefined(a.regionClass),i=c.isFunction(a);i||f||g||d("Region must be specified as a Region class,a selector string or an object with selector property");var j,k;f&&(j=a),a.selector&&(j=a.selector,delete a.selector),i&&(k=a),!i&&h&&(k=e),a.regionClass&&(k=a.regionClass,delete a.regionClass),(f||i)&&(a={}),a.el=j;var l=new k(a);return a.parentEl&&(l.getEl=function(d){if(c.isObject(d))return b.$(d);var e=a.parentEl;return c.isFunction(e)&&(e=e()),e.find(d)}),l}}),c.extend(f.Region.prototype,b.Events,{show:function(a,b){this._ensureElement();var d=b||{},e=a!==this.currentView,f=!!d.preventDestroy,g=!!d.forceShow,h=!!this.currentView,i=!f&&e;i&&this.empty();var j=e||g;return j?(a.once("destroy",c.bind(this.empty,this)),a.render(),h&&this.triggerMethod("before:swap",a),this.triggerMethod("before:show",a),c.isFunction(a.triggerMethod)?a.triggerMethod("before:show"):this.triggerMethod.call(a,"before:show"),this.attachHtml(a),this.currentView=a,h&&this.triggerMethod("swap",a),this.triggerMethod("show",a),c.isFunction(a.triggerMethod)?a.triggerMethod("show"):this.triggerMethod.call(a,"show"),this):this},_ensureElement:function(){c.isObject(this.el)||(this.$el=this.getEl(this.el),this.el=this.$el[0]),this.$el&&0!==this.$el.length||d('An "el" '+this.$el.selector+" must exist in DOM")},getEl:function(a){return b.$(a)},attachHtml:function(a){this.el.innerHTML="",this.el.appendChild(a.el)},empty:function(){var a=this.currentView;a&&(this.triggerMethod("before:empty",a),this._destroyView(),this.triggerMethod("empty",a),delete this.currentView)},_destroyView:function(){var a=this.currentView;a.destroy&&!a.isDestroyed?a.destroy():a.remove&&a.remove()},attachView:function(a){this.currentView=a},reset:function(){this.empty(),this.$el&&(this.el=this.$el.selector),delete this.$el},getOption:f.proxyGetOption,triggerMethod:f.triggerMethod}),f.Region.extend=f.extend,f.RegionManager=function(a){var b=a.Controller.extend({constructor:function(b){this._regions={},a.Controller.call(this,b)},addRegions:function(a,b){var d={};return c.each(a,function(a,e){c.isString(a)&&(a={selector:a}),a.selector&&(a=c.defaults({},a,b));var f=this.addRegion(e,a);d[e]=f},this),d},addRegion:function(b,d){var e,f=c.isObject(d),g=c.isString(d),h=!!d.selector;return e=g||f&&h?a.Region.buildRegion(d,a.Region):c.isFunction(d)?a.Region.buildRegion(d,a.Region):d,this.triggerMethod("before:add:region",b,e),this._store(b,e),this.triggerMethod("add:region",b,e),e},get:function(a){return this._regions[a]},getRegions:function(){return c.clone(this._regions)},removeRegion:function(a){var b=this._regions[a];this._remove(a,b)},removeRegions:function(){c.each(this._regions,function(a,b){this._remove(b,a)},this)},emptyRegions:function(){c.each(this._regions,function(a){a.empty()},this)},destroy:function(){this.removeRegions(),a.Controller.prototype.destroy.apply(this,arguments)},_store:function(a,b){this._regions[a]=b,this._setLength()},_remove:function(a,b){this.triggerMethod("before:remove:region",a,b),b.empty(),b.stopListening(),delete this._regions[a],this._setLength(),this.triggerMethod("remove:region",a,b)},_setLength:function(){this.length=c.size(this._regions)}});return a.actAsCollection(b.prototype,"_regions"),b}(f),f.TemplateCache=function(a){this.templateId=a},c.extend(f.TemplateCache,{templateCaches:{},get:function(a){var b=this.templateCaches[a];return b||(b=new f.TemplateCache(a),this.templateCaches[a]=b),b.load()},clear:function(){var a,b=g.call(arguments),c=b.length;if(c>0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(f.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var c=b.$(a).html();return c&&0!==c.length||d('Could not find template: "'+a+'"',"NoTemplateError"),c},compileTemplate:function(a){return c.template(a)}}),f.Renderer={render:function(a,b){a||d("Cannot render the template since its false, null or undefined.","TemplateNotFoundError");var c;return(c="function"==typeof a?a:f.TemplateCache.get(a))(b)}},f.View=b.View.extend({constructor:function(a){c.bindAll(this,"render"),this.options=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),c.isObject(this.behaviors)&&new f.Behaviors(this),b.View.apply(this,arguments),f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled)},getTemplate:function(){return this.getOption("template")},mixinTemplateHelpers:function(a){a=a||{};var b=this.getOption("templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},normalizeUIKeys:function(a){var b=c.result(this,"ui"),d=c.result(this,"_uiBindings");return f.normalizeUIKeys(a,d||b)},configureTriggers:function(){if(this.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),this.bindEntityEvents(this.model,this.getOption("modelEvents")),this.bindEntityEvents(this.collection,this.getOption("collectionEvents"))},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this)),a=this.normalizeUIKeys(a);var d={},e=c.result(this,"behaviorEvents")||{},f=this.configureTriggers();c.extend(d,e,a,f),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=Array.prototype.slice.call(arguments);b.View.prototype.undelegateEvents.apply(this,a),this.unbindEntityEvents(this.model,this.getOption("modelEvents")),this.unbindEntityEvents(this.collection,this.getOption("collectionEvents"))},onShowCalled:function(){},_ensureViewIsIntact:function(){if(this.isDestroyed){var a=new Error("Cannot use a view thats already been destroyed.");throw a.name="ViewDestroyedError",a}},destroy:function(){if(!this.isDestroyed){var a=Array.prototype.slice.call(arguments);this.triggerMethod.apply(this,["before:destroy"].concat(a)),this.isDestroyed=!0,this.triggerMethod.apply(this,["destroy"].concat(a)),this.unbindUIElements(),this.remove()}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)},triggerMethod:f.triggerMethod,normalizeMethods:f.normalizeMethods,getOption:f.proxyGetOption,bindEntityEvents:f.proxyBindEntityEvents,unbindEntityEvents:f.proxyUnbindEntityEvents}),f.ItemView=f.View.extend({constructor:function(){f.View.apply(this,arguments)},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this._ensureViewIsIntact(),this.triggerMethod("before:render",this);var a=this.serializeData();a=this.mixinTemplateHelpers(a);var b=this.getTemplate(),c=f.Renderer.render(b,a);return this.attachElContent(c),this.bindUIElements(),this.triggerMethod("render",this),this},attachElContent:function(a){return this.$el.html(a),this},destroy:function(){this.isDestroyed||f.View.prototype.destroy.apply(this,arguments)}}),f.CollectionView=f.View.extend({childViewEventPrefix:"childview",constructor:function(a){var b=a||{};this.sort=c.isUndefined(b.sort)?!0:b.sort,this._initChildViewStorage(),f.View.apply(this,arguments),this._initialEvents(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this._triggerBeforeShowBufferedChildren(),this.attachBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerBeforeShowBufferedChildren:function(){this._isShown&&c.invoke(this._bufferedChildren,"triggerMethod","before:show")},_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this.render),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(a){this.destroyEmptyView();var b=this.getChildView(a),c=this.collection.indexOf(a);this.addChild(a,b,c)},_onCollectionRemove:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},onShowCalled:function(){this.children.each(function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")})},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderChildren(),this.triggerMethod("render",this),this},_sortViews:function(){var a=this.collection.find(function(a,b){var c=this.children.findByModel(a);return c&&c._index!==b},this);a&&this.render()},_renderChildren:function(){this.destroyEmptyView(),this.destroyChildren(),this.isEmpty(this.collection)?this.showEmptyView():(this.triggerMethod("before:render:collection",this),this.startBuffering(),this.showCollection(),this.endBuffering(),this.triggerMethod("render:collection",this))},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getChildView(b),this.addChild(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this.triggerMethod("before:render:empty"),this._showingEmptyView=!0;var c=new b.Model;this.addEmptyView(c,a),this.triggerMethod("render:empty")}},destroyEmptyView:function(){this._showingEmptyView&&(this.destroyChildren(),delete this._showingEmptyView)},getEmptyView:function(){return this.getOption("emptyView")},addEmptyView:function(a,b){var d=this.getOption("emptyViewOptions")||this.getOption("childViewOptions");c.isFunction(d)&&(d=d.call(this));var e=this.buildChildView(a,b,d);this._isShown&&this.triggerMethod.call(e,"before:show"),this.children.add(e),this.renderChildView(e,-1),this._isShown&&this.triggerMethod.call(e,"show")},getChildView:function(){var a=this.getOption("childView");return a||d('A "childView" must be specified',"NoChildViewError"),a},addChild:function(a,b,d){var e=this.getOption("childViewOptions");c.isFunction(e)&&(e=e.call(this,a,d));var f=this.buildChildView(a,b,e);return this._updateIndices(f,!0,d),this._addChildView(f,d),f},_updateIndices:function(a,b,c){this.sort&&(b?(a._index=c,this.children.each(function(b){b._index>=a._index&&b._index++})):this.children.each(function(b){b._index>=a._index&&b._index--}))},_addChildView:function(a,b){this.proxyChildEvents(a),this.triggerMethod("before:add:child",a),this.children.add(a),this.renderChildView(a,b),this._isShown&&!this.isBuffering&&(c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")),this.triggerMethod("add:child",a)},renderChildView:function(a,b){a.render(),this.attachHtml(this,a,b)},buildChildView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeChildView:function(a){a&&(this.triggerMethod("before:remove:child",a),a.destroy?a.destroy():a.remove&&a.remove(),this.stopListening(a),this.children.remove(a),this.triggerMethod("remove:child",a),this._updateIndices(a,!1))},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},attachBuffer:function(a,b){a.$el.append(b)},attachHtml:function(a,b,c){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b)):a._insertBefore(b,c)||a._insertAfter(b)},_insertBefore:function(a,b){var c,d=this.sort&&b0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(f.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var c=b.$(a).html();return c&&0!==c.length||d('Could not find template: "'+a+'"',"NoTemplateError"),c},compileTemplate:function(a){return c.template(a)}}),f.Renderer={render:function(a,b){a||d("Cannot render the template since its false, null or undefined.","TemplateNotFoundError");var c;return(c="function"==typeof a?a:f.TemplateCache.get(a))(b)}},f.View=b.View.extend({constructor:function(a){c.bindAll(this,"render"),this.options=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),c.isObject(this.behaviors)&&new f.Behaviors(this),b.View.apply(this,arguments),f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled)},getTemplate:function(){return this.getOption("template")},serializeModel:function(a){return a.toJSON.apply(a,g.call(arguments,1))},mixinTemplateHelpers:function(a){a=a||{};var b=this.getOption("templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},normalizeUIKeys:function(a){var b=c.result(this,"ui"),d=c.result(this,"_uiBindings");return f.normalizeUIKeys(a,d||b)},configureTriggers:function(){if(this.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){return this._delegateDOMEvents(a),this.bindEntityEvents(this.model,this.getOption("modelEvents")),this.bindEntityEvents(this.collection,this.getOption("collectionEvents")),this},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this)),a=this.normalizeUIKeys(a);var d={},e=c.result(this,"behaviorEvents")||{},f=this.configureTriggers();c.extend(d,e,a,f),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=g.call(arguments);return b.View.prototype.undelegateEvents.apply(this,a),this.unbindEntityEvents(this.model,this.getOption("modelEvents")),this.unbindEntityEvents(this.collection,this.getOption("collectionEvents")),this},onShowCalled:function(){},_ensureViewIsIntact:function(){if(this.isDestroyed){var a=new Error("Cannot use a view thats already been destroyed.");throw a.name="ViewDestroyedError",a}},destroy:function(){if(!this.isDestroyed){var a=g.call(arguments);return this.triggerMethod.apply(this,["before:destroy"].concat(a)),this.isDestroyed=!0,this.triggerMethod.apply(this,["destroy"].concat(a)),this.unbindUIElements(),this.remove(),this}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)},triggerMethod:f.triggerMethod,normalizeMethods:f.normalizeMethods,getOption:f.proxyGetOption,bindEntityEvents:f.proxyBindEntityEvents,unbindEntityEvents:f.proxyUnbindEntityEvents}),f.ItemView=f.View.extend({constructor:function(){f.View.apply(this,arguments)},serializeData:function(){var a={};return this.model?a=c.partial(this.serializeModel,this.model).apply(this,arguments):this.collection&&(a={items:c.partial(this.serializeCollection,this.collection).apply(this,arguments)}),a},serializeCollection:function(a){return a.toJSON.apply(a,g.call(arguments,1))},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderTemplate(),this.bindUIElements(),this.triggerMethod("render",this),this},_renderTemplate:function(){var a=this.getTemplate();if(a!==!1){a||d("Cannot render the template since it is null or undefined.","UndefinedTemplateError");var b=this.serializeData();b=this.mixinTemplateHelpers(b);var c=f.Renderer.render(a,b,this);return this.attachElContent(c),this}},attachElContent:function(a){return this.$el.html(a),this},destroy:function(){return this.isDestroyed?void 0:f.View.prototype.destroy.apply(this,arguments)}}),f.CollectionView=f.View.extend({childViewEventPrefix:"childview",constructor:function(a){var b=a||{};this.sort=c.isUndefined(b.sort)?!0:b.sort,this._initChildViewStorage(),f.View.apply(this,arguments),this._initialEvents(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this._triggerBeforeShowBufferedChildren(),this.attachBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerBeforeShowBufferedChildren:function(){this._isShown&&c.invoke(this._bufferedChildren,"triggerMethod","before:show")},_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this.render),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(a){this.destroyEmptyView();var b=this.getChildView(a),c=this.collection.indexOf(a);this.addChild(a,b,c)},_onCollectionRemove:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},onShowCalled:function(){this.children.each(function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")})},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderChildren(),this.triggerMethod("render",this),this},resortView:function(){this.render()},_sortViews:function(){var a=this.collection.find(function(a,b){var c=this.children.findByModel(a);return!c||c._index!==b},this);a&&this.resortView()},_renderChildren:function(){this.destroyEmptyView(),this.destroyChildren(),this.isEmpty(this.collection)?this.showEmptyView():(this.triggerMethod("before:render:collection",this),this.startBuffering(),this.showCollection(),this.endBuffering(),this.triggerMethod("render:collection",this))},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getChildView(b),this.addChild(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this.triggerMethod("before:render:empty"),this._showingEmptyView=!0;var c=new b.Model;this.addEmptyView(c,a),this.triggerMethod("render:empty")}},destroyEmptyView:function(){this._showingEmptyView&&(this.destroyChildren(),delete this._showingEmptyView)},getEmptyView:function(){return this.getOption("emptyView")},addEmptyView:function(a,b){var d=this.getOption("emptyViewOptions")||this.getOption("childViewOptions");c.isFunction(d)&&(d=d.call(this));var e=this.buildChildView(a,b,d);this._isShown&&this.triggerMethod.call(e,"before:show"),this.children.add(e),this.renderChildView(e,-1),this._isShown&&this.triggerMethod.call(e,"show")},getChildView:function(){var a=this.getOption("childView");return a||d('A "childView" must be specified',"NoChildViewError"),a},addChild:function(a,b,d){var e=this.getOption("childViewOptions");c.isFunction(e)&&(e=e.call(this,a,d));var f=this.buildChildView(a,b,e);return this._updateIndices(f,!0,d),this._addChildView(f,d),f},_updateIndices:function(a,b,c){this.sort&&(b?(a._index=c,this.children.each(function(b){b._index>=a._index&&b._index++})):this.children.each(function(b){b._index>=a._index&&b._index--}))},_addChildView:function(a,b){this.proxyChildEvents(a),this.triggerMethod("before:add:child",a),this.children.add(a),this.renderChildView(a,b),this._isShown&&!this.isBuffering&&(c.isFunction(a.triggerMethod)?a.triggerMethod("show"):f.triggerMethod.call(a,"show")),this.triggerMethod("add:child",a)},renderChildView:function(a,b){return a.render(),this.attachHtml(this,a,b),a},buildChildView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeChildView:function(a){return a&&(this.triggerMethod("before:remove:child",a),a.destroy?a.destroy():a.remove&&a.remove(),this.stopListening(a),this.children.remove(a),this.triggerMethod("remove:child",a),this._updateIndices(a,!1)),a},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},attachBuffer:function(a,b){a.$el.append(b)},attachHtml:function(a,b,c){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b)):a._insertBefore(b,c)||a._insertAfter(b)},_insertBefore:function(a,b){var c,d=this.sort&&b