marionette-rails 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3df84f2bc2ea6c1aef5cb2440c83ade372d82a95
4
+ data.tar.gz: c301df07ebf0f28da4bda15ea0bcd3aa0a1d95b8
5
+ SHA512:
6
+ metadata.gz: 57c7cf2def08ea6c5c88510cb04a76efd5dea850f7c034b6d6a67e7826ec2085cd43cb749df07387d1b94133d973afb92f857a44fd1473e520af4255624f7426
7
+ data.tar.gz: a3842e6bf08ae00997fb7a636bcb1670935a9962a3a3289a789ce56b0c795ed38fcff876425f1f3ffe0a4e1b87fb394ea135b4d851f79878bf708accbc3a3692
data/README.md CHANGED
@@ -21,7 +21,8 @@ Add it to your Gemfile:
21
21
  gem 'marionette-rails'
22
22
  end
23
23
 
24
- Then add this to `app/assets/javascripts/application.js.coffee`:
24
+ Then add this to `app/assets/javascripts/application.js.coffee` after your
25
+ backbone require:
25
26
 
26
27
  #= require backbone.marionette
27
28
 
@@ -1,5 +1,5 @@
1
1
  module Marionette
2
2
  module Rails
3
- VERSION = '1.0.4'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  // MarionetteJS (Backbone.Marionette)
2
2
  // ----------------------------------
3
- // v1.0.4
3
+ // v1.1.0
4
4
  //
5
5
  // Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
6
6
  // Distributed under MIT license
@@ -491,21 +491,21 @@ Marionette.getOption = function(target, optionName){
491
491
  return value;
492
492
  };
493
493
 
494
- // Trigger an event and a corresponding method name. Examples:
494
+ // Trigger an event and/or a corresponding method name. Examples:
495
495
  //
496
496
  // `this.triggerMethod("foo")` will trigger the "foo" event and
497
- // call the "onFoo" method.
497
+ // call the "onFoo" method.
498
498
  //
499
499
  // `this.triggerMethod("foo:bar") will trigger the "foo:bar" event and
500
500
  // call the "onFooBar" method.
501
501
  Marionette.triggerMethod = (function(){
502
-
502
+
503
503
  // split the event name on the :
504
504
  var splitter = /(^|:)(\w)/gi;
505
505
 
506
506
  // take the event section ("section1:section2:section3")
507
507
  // and turn it in to uppercase name
508
- function getEventName(match, prefix, eventName) {
508
+ function getEventName(match, prefix, eventName) {
509
509
  return eventName.toUpperCase();
510
510
  }
511
511
 
@@ -515,8 +515,10 @@ Marionette.triggerMethod = (function(){
515
515
  var methodName = 'on' + event.replace(splitter, getEventName);
516
516
  var method = this[methodName];
517
517
 
518
- // trigger the event
519
- this.trigger.apply(this, arguments);
518
+ // trigger the event, if a trigger method exists
519
+ if(_.isFunction(this.trigger)) {
520
+ this.trigger.apply(this, arguments);
521
+ }
520
522
 
521
523
  // call the onMethodName if it exists
522
524
  if (_.isFunction(method)) {
@@ -536,14 +538,14 @@ Marionette.triggerMethod = (function(){
536
538
  // re-rendered.
537
539
 
538
540
  Marionette.MonitorDOMRefresh = (function(){
539
- // track when the view has been rendered
541
+ // track when the view has been shown in the DOM,
542
+ // using a Marionette.Region (or by other means of triggering "show")
540
543
  function handleShow(view){
541
544
  view._isShown = true;
542
545
  triggerDOMRefresh(view);
543
546
  }
544
547
 
545
- // track when the view has been shown in the DOM,
546
- // using a Marionette.Region (or by other means of triggering "show")
548
+ // track when the view has been rendered
547
549
  function handleRender(view){
548
550
  view._isRendered = true;
549
551
  triggerDOMRefresh(view);
@@ -782,6 +784,7 @@ _.extend(Marionette.Region, {
782
784
  // ```
783
785
  //
784
786
  buildRegion: function(regionConfig, defaultRegionType){
787
+
785
788
  var regionIsString = (typeof regionConfig === "string");
786
789
  var regionSelectorIsString = (typeof regionConfig.selector === "string");
787
790
  var regionTypeIsUndefined = (typeof regionConfig.regionType === "undefined");
@@ -1228,7 +1231,7 @@ Marionette.View = Backbone.View.extend({
1228
1231
  // are copies to the object passed in.
1229
1232
  mixinTemplateHelpers: function(target){
1230
1233
  target = target || {};
1231
- var templateHelpers = this.templateHelpers;
1234
+ var templateHelpers = Marionette.getOption(this, "templateHelpers");
1232
1235
  if (_.isFunction(templateHelpers)){
1233
1236
  templateHelpers = templateHelpers.call(this);
1234
1237
  }
@@ -1358,7 +1361,7 @@ Marionette.View = Backbone.View.extend({
1358
1361
 
1359
1362
  // This method unbinds the elements specified in the "ui" hash
1360
1363
  unbindUIElements: function(){
1361
- if (!this.ui){ return; }
1364
+ if (!this.ui || !this._uiBindings){ return; }
1362
1365
 
1363
1366
  // delete all of the existing ui bindings
1364
1367
  _.each(this.ui, function($el, name){
@@ -1714,8 +1717,8 @@ Marionette.CollectionView = Marionette.View.extend({
1714
1717
  // Extends directly from CollectionView and also renders an
1715
1718
  // an item view as `modelView`, for the top leaf
1716
1719
  Marionette.CompositeView = Marionette.CollectionView.extend({
1717
-
1718
- // Setting up the inheritance chain which allows changes to
1720
+
1721
+ // Setting up the inheritance chain which allows changes to
1719
1722
  // Marionette.CollectionView.prototype.constructor which allows overriding
1720
1723
  constructor: function(){
1721
1724
  Marionette.CollectionView.prototype.constructor.apply(this, slice(arguments));
@@ -1746,7 +1749,7 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
1746
1749
  return itemView;
1747
1750
  },
1748
1751
 
1749
- // Serialize the collection for the view.
1752
+ // Serialize the collection for the view.
1750
1753
  // You can override the `serializeData` method in your own view
1751
1754
  // definition, to provide custom serialization for your view's data.
1752
1755
  serializeData: function(){
@@ -1770,7 +1773,7 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
1770
1773
  this.triggerBeforeRender();
1771
1774
  var html = this.renderModel();
1772
1775
  this.$el.html(html);
1773
- // the ui bindings is done here and not at the end of render since they
1776
+ // the ui bindings is done here and not at the end of render since they
1774
1777
  // will not be available until after the model is rendered, but should be
1775
1778
  // available before the collection is rendered.
1776
1779
  this.bindUIElements();
@@ -1819,9 +1822,10 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
1819
1822
  }
1820
1823
 
1821
1824
  var container;
1822
- if (containerView.itemViewContainer){
1825
+ var itemViewContainer = Marionette.getOption(containerView, "itemViewContainer");
1826
+ if (itemViewContainer){
1823
1827
 
1824
- var selector = _.result(containerView, "itemViewContainer");
1828
+ var selector = _.isFunction(itemViewContainer) ? itemViewContainer() : itemViewContainer;
1825
1829
  container = containerView.$(selector);
1826
1830
  if (container.length <= 0) {
1827
1831
  throwError("The specified `itemViewContainer` was not found: " + containerView.itemViewContainer, "ItemViewContainerMissingError");
@@ -1873,15 +1877,16 @@ Marionette.Layout = Marionette.ItemView.extend({
1873
1877
  // for the regions to the newly rendered DOM elements.
1874
1878
  render: function(){
1875
1879
 
1876
- if (this._firstRender){
1877
- // if this is the first render, don't do anything to
1878
- // reset the regions
1879
- this._firstRender = false;
1880
- } else if (this.isClosed){
1880
+ if (this.isClosed){
1881
1881
  // a previously closed layout means we need to
1882
1882
  // completely re-initialize the regions
1883
1883
  this._initializeRegions();
1884
- } else {
1884
+ }
1885
+ if (this._firstRender) {
1886
+ // if this is the first render, don't do anything to
1887
+ // reset the regions
1888
+ this._firstRender = false;
1889
+ } else if (!this.isClosed){
1885
1890
  // If this is not the first render call, then we need to
1886
1891
  // re-initializing the `el` for each region
1887
1892
  this._reInitializeRegions();
@@ -1905,17 +1910,18 @@ Marionette.Layout = Marionette.ItemView.extend({
1905
1910
  addRegion: function(name, definition){
1906
1911
  var regions = {};
1907
1912
  regions[name] = definition;
1908
- return this.addRegions(regions)[name];
1913
+ return this._buildRegions(regions)[name];
1909
1914
  },
1910
1915
 
1911
1916
  // Add multiple regions as a {name: definition, name2: def2} object literal
1912
1917
  addRegions: function(regions){
1913
- this.regions = _.extend(this.regions || {}, regions);
1918
+ this.regions = _.extend({}, this.regions, regions);
1914
1919
  return this._buildRegions(regions);
1915
1920
  },
1916
1921
 
1917
1922
  // Remove a single region from the Layout, by name
1918
1923
  removeRegion: function(name){
1924
+ delete this.regions[name];
1919
1925
  return this.regionManager.removeRegion(name);
1920
1926
  },
1921
1927
 
@@ -1924,6 +1930,7 @@ Marionette.Layout = Marionette.ItemView.extend({
1924
1930
  var that = this;
1925
1931
 
1926
1932
  var defaults = {
1933
+ regionType: Marionette.getOption(this, "regionType"),
1927
1934
  parentEl: function(){ return that.$el; }
1928
1935
  };
1929
1936
 
@@ -1994,31 +2001,46 @@ Marionette.AppRouter = Backbone.Router.extend({
1994
2001
 
1995
2002
  constructor: function(options){
1996
2003
  Backbone.Router.prototype.constructor.apply(this, slice(arguments));
2004
+
2005
+ this.options = options || {};
1997
2006
 
1998
- this.options = options;
2007
+ var appRoutes = Marionette.getOption(this, "appRoutes");
2008
+ var controller = this._getController();
2009
+ this.processAppRoutes(controller, appRoutes);
2010
+ },
1999
2011
 
2000
- if (this.appRoutes){
2001
- var controller = Marionette.getOption(this, "controller");
2002
- this.processAppRoutes(controller, this.appRoutes);
2003
- }
2012
+ // Similar to route method on a Backbone Router but
2013
+ // method is called on the controller
2014
+ appRoute: function(route, methodName) {
2015
+ var controller = this._getController();
2016
+ this._addAppRoute(controller, route, methodName);
2004
2017
  },
2005
2018
 
2006
2019
  // Internal method to process the `appRoutes` for the
2007
2020
  // router, and turn them in to routes that trigger the
2008
2021
  // specified method on the specified `controller`.
2009
2022
  processAppRoutes: function(controller, appRoutes) {
2023
+ if (!appRoutes){ return; }
2024
+
2010
2025
  var routeNames = _.keys(appRoutes).reverse(); // Backbone requires reverted order of routes
2011
2026
 
2012
2027
  _.each(routeNames, function(route) {
2013
- var methodName = appRoutes[route];
2014
- var method = controller[methodName];
2028
+ this._addAppRoute(controller, route, appRoutes[route]);
2029
+ }, this);
2030
+ },
2015
2031
 
2016
- if (!method) {
2017
- throw new Error("Method '" + methodName + "' was not found on the controller");
2018
- }
2032
+ _getController: function(){
2033
+ return Marionette.getOption(this, "controller");
2034
+ },
2019
2035
 
2020
- this.route(route, methodName, _.bind(method, controller));
2021
- }, this);
2036
+ _addAppRoute: function(controller, route, methodName){
2037
+ var method = controller[methodName];
2038
+
2039
+ if (!method) {
2040
+ throw new Error("Method '" + methodName + "' was not found on the controller");
2041
+ }
2042
+
2043
+ this.route(route, methodName, _.bind(method, controller));
2022
2044
  }
2023
2045
  });
2024
2046
 
@@ -2081,12 +2103,24 @@ _.extend(Marionette.Application.prototype, Backbone.Events, {
2081
2103
  return this._regionManager.addRegions(regions);
2082
2104
  },
2083
2105
 
2084
- // Removes a region from your app.
2106
+ // Close all regions in the app, without removing them
2107
+ closeRegions: function(){
2108
+ this._regionManager.closeRegions();
2109
+ },
2110
+
2111
+ // Removes a region from your app, by name
2085
2112
  // Accepts the regions name
2086
2113
  // removeRegion('myRegion')
2087
2114
  removeRegion: function(region) {
2088
2115
  this._regionManager.removeRegion(region);
2089
2116
  },
2117
+
2118
+ // Provides alternative access to regions
2119
+ // Accepts the region name
2120
+ // getRegion('main')
2121
+ getRegion: function(region) {
2122
+ return this._regionManager.get(region);
2123
+ },
2090
2124
 
2091
2125
  // Create a module, attached to the application
2092
2126
  module: function(moduleNames, moduleDefinition){
@@ -1 +1 @@
1
- {"version":3,"file":"lib/backbone.marionette.min.js","sources":["backbone.marionette.js"],"names":["Backbone","ChildViewContainer","_","Container","views","this","_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","Wreqr","Marionette","Handlers","options","_wreqrHandlers","initialize","Model","Events","setHandlers","handlers","handler","name","context","isObject","callback","setHandler","config","trigger","hasHandler","getHandler","Error","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","global","protoSlice","throwError","message","error","$","getOption","target","optionName","value","undefined","triggerMethod","getEventName","match","prefix","eventName","toUpperCase","splitter","event","methodName","replace","MonitorDOMRefresh","handleShow","_isShown","triggerDOMRefresh","handleRender","_isRendered","listenTo","bindFromStrings","entity","evt","methodNames","split","bindToFunction","unbindFromStrings","stopListening","unbindToFunction","iterateEvents","bindings","functionCallback","stringCallback","bindEntityEvents","unbindEntityEvents","Callbacks","_deferred","Deferred","_callbacks","contextOverride","cb","ctx","done","run","resolve","reset","callbacks","Controller","close","unbind","Region","el","err","buildRegion","regionConfig","defaultRegionType","regionIsString","regionSelectorIsString","selector","regionTypeIsUndefined","regionType","regionIsType","RegionType","region","parentEl","getEl","find","show","ensureEl","isViewClosed","isClosed","isUndefined","$el","isDifferentView","currentView","render","open","empty","append","attachView","RegionManager","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","isString","hasSelector","_store","get","removeRegion","_remove","removeRegions","closeRegions","_setLength","TemplateCache","templateId","templateCaches","cachedTemplate","load","clear","i","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","configureTriggers","triggers","triggerEvents","result","e","preventDefault","stopPropagation","collection","delegateEvents","events","_delegateDOMEvents","combinedEvents","undelegateEvents","shouldClose","unbindUIElements","bindUIElements","ui","_uiBindings","keys","ItemView","serializeData","toJSON","items","CollectionView","itemViewEventPrefix","_initChildViewStorage","_initialEvents","addChildView","removeItemView","item","closeEmptyView","getItemView","indexOf","addItemView","children","child","triggerBeforeRender","triggerRendered","_renderChildren","closeChildren","showCollection","showEmptyView","EmptyView","_showingEmptyView","itemView","itemViewOptions","buildItemView","addChildViewEventForwarding","renderItemView","splice","appendHtml","ItemViewType","removeChildView","checkEmpty","collectionView","CompositeView","isRendered","resetItemViewContainer","renderModel","cv","iv","$container","getItemViewContainer","containerView","$itemViewContainer","container","itemViewContainer","Layout","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","that","_initRegionManager","AppRouter","Router","appRoutes","controller","processAppRoutes","routeNames","reverse","route","bind","Application","_initCallbacks","vent","reqres","submodules","addInitializer","initializer","start","_regionManager","module","unshift","Module","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","stop","addDefinition","moduleDefinition","customArgs","_runModuleDefinition","flatten","moduleNames","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","fn","define","startWithParentIsConfigured"],"mappings":"AAkCAA,SAASC,mBAAqB,SAAUD,EAAUE,GAKhD,GAAIC,GAAY,SAASC,GACvBC,KAAKC,UACLD,KAAKE,iBACLF,KAAKG,kBACLH,KAAKI,gBAELP,EAAEQ,KAAKN,EAAOC,KAAKM,IAAKN,MAM1BH,GAAEU,OAAOT,EAAUU,WAMjBF,IAAK,SAASG,EAAMC,GAClB,GAAIC,GAAUF,EAAKG,GAGnBZ,MAAKC,OAAOU,GAAWF,EAGnBA,EAAKI,QACPb,KAAKE,cAAcO,EAAKI,MAAMD,KAAOD,GAInCD,IACFV,KAAKG,eAAeO,GAAeC,GAGrCX,KAAKI,iBAKPU,YAAa,SAASD,GACpB,MAAOb,MAAKe,eAAeF,EAAMD,MAMnCG,eAAgB,SAASC,GACvB,GAAIL,GAAUX,KAAKE,cAAcc,EACjC,OAAOhB,MAAKiB,UAAUN,IAIxBO,aAAc,SAASC,GACrB,GAAIR,GAAUX,KAAKG,eAAegB,EAClC,OAAOnB,MAAKiB,UAAUN,IAKxBS,YAAa,SAASD,GACpB,MAAOtB,GAAEwB,OAAOrB,KAAKC,QAAQkB,IAI/BF,UAAW,SAASL,GAClB,MAAOZ,MAAKC,OAAOW,IAIrBU,OAAQ,SAASb,GACf,GAAIE,GAAUF,EAAKG,GAGfH,GAAKI,aACAb,MAAKE,cAAcO,EAAKI,MAAMD,KAIvCf,EAAE0B,IAAIvB,KAAKG,eAAgB,SAASS,EAAKY,GACvC,MAAIZ,KAAQD,SACHX,MAAKG,eAAeqB,IACpB,GAFT,QAICxB,YAGIA,MAAKC,OAAOU,GAGnBX,KAAKI,iBAMPqB,KAAM,SAASC,GACb1B,KAAK2B,MAAMD,EAAQ7B,EAAE+B,KAAKC,aAM5BF,MA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,EAAEU,OAAO+B,EAAW6Q,QAGlBC,OAAQ,SAASE,EAAKc,EAAaJ,GACjC,GAAIf,GAASK,EAITW,EAAatQ,EAAM9B,UACvBoS,GAAW5D,OAAO,EAAG,GAGrB+D,EAAcA,EAAY/M,MAAM,IAChC,IAAIrF,GAASoS,EAAYpS,OAGrBqS,IAWJ,OAVAA,GAAkBrS,EAAO,GAAKgS,EAG9BnU,EAAEQ,KAAK+T,EAAa,SAASf,EAAYjH,GACvC,GAAIkI,GAAerB,CACnBA,GAASjT,KAAKuU,WAAWD,EAAcjB,EAAYC,GACnDtT,KAAKwU,qBAAqBF,EAAcrB,EAAQoB,EAAkBjI,GAAI6H,IACrEjU,MAGIiT,GAGTsB,WAAY,SAASD,EAAcjB,EAAYC,GAE7C,GAAIL,GAASqB,EAAajB,EAU1B,OARKJ,KAEHA,EAAS,GAAI3Q,GAAW6Q,OAAOE,EAAYC,GAC3CgB,EAAajB,GAAcJ,EAE3BqB,EAAa1B,WAAWS,GAAcJ,GAGjCA,GAGTuB,qBAAsB,SAASF,EAAcrB,EAAQwB,EAAK3S,GACxD,GAAI4S,GACAlB,CAEA3T,GAAEkC,WAAW0S,IAEfC,EAAKD,EACLjB,GAAkB,GAET3T,EAAEqD,SAASuR,IAEpBC,EAAKD,EAAIE,OACTnB,EAAkBiB,EAAIjB,iBAItBA,GAAkB,EAIhBkB,GACFzB,EAAOc,cAAcW,EAAI5S,GAK3BmR,EAAOO,gBAAkBP,EAAOO,iBAAmBA,EAG/CP,EAAOO,kBAAoBP,EAAO2B,8BAGpC3B,EAAO2B,6BAA8B,EAGrCN,EAAazB,eAAe,SAASrQ,GAC/ByQ,EAAOO,iBACTP,EAAOF,MAAMvQ,SAWdF,GACNtC,KAAML,SAAUE"}
1
+ {"version":3,"file":"lib/backbone.marionette.min.js","sources":["backbone.marionette.js"],"names":["Backbone","ChildViewContainer","_","Container","views","this","_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","Wreqr","Marionette","Handlers","options","_wreqrHandlers","initialize","Model","Events","setHandlers","handlers","handler","name","context","isObject","callback","setHandler","config","trigger","hasHandler","getHandler","Error","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","global","protoSlice","throwError","message","error","$","getOption","target","optionName","value","undefined","triggerMethod","getEventName","match","prefix","eventName","toUpperCase","splitter","event","methodName","replace","MonitorDOMRefresh","handleShow","_isShown","triggerDOMRefresh","handleRender","_isRendered","listenTo","bindFromStrings","entity","evt","methodNames","split","bindToFunction","unbindFromStrings","stopListening","unbindToFunction","iterateEvents","bindings","functionCallback","stringCallback","bindEntityEvents","unbindEntityEvents","Callbacks","_deferred","Deferred","_callbacks","contextOverride","cb","ctx","done","run","resolve","reset","callbacks","Controller","close","unbind","Region","el","err","buildRegion","regionConfig","defaultRegionType","regionIsString","regionSelectorIsString","selector","regionTypeIsUndefined","regionType","regionIsType","RegionType","region","parentEl","getEl","find","show","ensureEl","isViewClosed","isClosed","isUndefined","$el","isDifferentView","currentView","render","open","empty","append","attachView","RegionManager","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","isString","hasSelector","_store","get","removeRegion","_remove","removeRegions","closeRegions","_setLength","TemplateCache","templateId","templateCaches","cachedTemplate","load","clear","i","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","configureTriggers","triggers","triggerEvents","result","e","preventDefault","stopPropagation","collection","delegateEvents","events","_delegateDOMEvents","combinedEvents","undelegateEvents","shouldClose","unbindUIElements","bindUIElements","ui","_uiBindings","keys","ItemView","serializeData","toJSON","items","CollectionView","itemViewEventPrefix","_initChildViewStorage","_initialEvents","addChildView","removeItemView","item","closeEmptyView","getItemView","indexOf","addItemView","children","child","triggerBeforeRender","triggerRendered","_renderChildren","closeChildren","showCollection","showEmptyView","EmptyView","_showingEmptyView","itemView","itemViewOptions","buildItemView","addChildViewEventForwarding","renderItemView","splice","appendHtml","ItemViewType","removeChildView","checkEmpty","collectionView","CompositeView","isRendered","resetItemViewContainer","renderModel","cv","iv","$container","getItemViewContainer","containerView","$itemViewContainer","container","itemViewContainer","Layout","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","that","_initRegionManager","AppRouter","Router","appRoutes","controller","_getController","processAppRoutes","appRoute","route","_addAppRoute","routeNames","reverse","bind","Application","_initCallbacks","vent","reqres","submodules","addInitializer","initializer","start","_regionManager","getRegion","module","unshift","Module","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","stop","addDefinition","moduleDefinition","customArgs","_runModuleDefinition","flatten","moduleNames","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","fn","define","startWithParentIsConfigured"],"mappings":"AAkCAA,SAASC,mBAAqB,SAAUD,EAAUE,GAKhD,GAAIC,GAAY,SAASC,GACvBC,KAAKC,UACLD,KAAKE,iBACLF,KAAKG,kBACLH,KAAKI,gBAELP,EAAEQ,KAAKN,EAAOC,KAAKM,IAAKN,MAM1BH,GAAEU,OAAOT,EAAUU,WAMjBF,IAAK,SAASG,EAAMC,GAClB,GAAIC,GAAUF,EAAKG,GAGnBZ,MAAKC,OAAOU,GAAWF,EAGnBA,EAAKI,QACPb,KAAKE,cAAcO,EAAKI,MAAMD,KAAOD,GAInCD,IACFV,KAAKG,eAAeO,GAAeC,GAGrCX,KAAKI,iBAKPU,YAAa,SAASD,GACpB,MAAOb,MAAKe,eAAeF,EAAMD,MAMnCG,eAAgB,SAASC,GACvB,GAAIL,GAAUX,KAAKE,cAAcc,EACjC,OAAO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AM,IAChC,IAAIrF,GAASwS,EAAYxS,OAGrByS,IAWJ,OAVAA,GAAkBzS,EAAO,GAAKoS,EAG9BvU,EAAEQ,KAAKmU,EAAa,SAASf,EAAYrH,GACvC,GAAIsI,GAAerB,CACnBA,GAASrT,KAAK2U,WAAWD,EAAcjB,EAAYC,GACnD1T,KAAK4U,qBAAqBF,EAAcrB,EAAQoB,EAAkBrI,GAAIiI,IACrErU,MAGIqT,GAGTsB,WAAY,SAASD,EAAcjB,EAAYC,GAE7C,GAAIL,GAASqB,EAAajB,EAU1B,OARKJ,KAEHA,EAAS,GAAI/Q,GAAWiR,OAAOE,EAAYC,GAC3CgB,EAAajB,GAAcJ,EAE3BqB,EAAa3B,WAAWU,GAAcJ,GAGjCA,GAGTuB,qBAAsB,SAASF,EAAcrB,EAAQwB,EAAK/S,GACxD,GAAIgT,GACAlB,CAEA/T,GAAEkC,WAAW8S,IAEfC,EAAKD,EACLjB,GAAkB,GAET/T,EAAEqD,SAAS2R,IAEpBC,EAAKD,EAAIE,OACTnB,EAAkBiB,EAAIjB,iBAItBA,GAAkB,EAIhBkB,GACFzB,EAAOc,cAAcW,EAAIhT,GAK3BuR,EAAOO,gBAAkBP,EAAOO,iBAAmBA,EAG/CP,EAAOO,kBAAoBP,EAAO2B,8BAGpC3B,EAAO2B,6BAA8B,EAGrCN,EAAa1B,eAAe,SAASxQ,GAC/B6Q,EAAOO,iBACTP,EAAOH,MAAM1Q,SAWdF,GACNtC,KAAML,SAAUE"}
@@ -1,6 +1,6 @@
1
1
  // MarionetteJS (Backbone.Marionette)
2
2
  // ----------------------------------
3
- // v1.0.4
3
+ // v1.1.0
4
4
  //
5
5
  // Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
6
6
  // Distributed under MIT license
@@ -17,5 +17,5 @@
17
17
  * https://github.com/marionettejs/backbone.wreqr/
18
18
  */
19
19
 
20
- Backbone.ChildViewContainer=function(e,t){var i=function(e){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),t.each(e,this.add,this)};t.extend(i.prototype,{add:function(e,t){var i=e.cid;this._views[i]=e,e.model&&(this._indexByModel[e.model.cid]=i),t&&(this._indexByCustom[t]=i),this._updateLength()},findByModel:function(e){return this.findByModelCid(e.cid)},findByModelCid:function(e){var t=this._indexByModel[e];return this.findByCid(t)},findByCustom:function(e){var t=this._indexByCustom[e];return this.findByCid(t)},findByIndex:function(e){return t.values(this._views)[e]},findByCid:function(e){return this._views[e]},remove:function(e){var i=e.cid;e.model&&delete this._indexByModel[e.model.cid],t.any(this._indexByCustom,function(e,t){return e===i?(delete this._indexByCustom[t],!0):void 0},this),delete this._views[i],this._updateLength()},call:function(e){this.apply(e,t.tail(arguments))},apply:function(e,i){t.each(this._views,function(n){t.isFunction(n[e])&&n[e].apply(n,i||[])})},_updateLength:function(){this.length=t.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return t.each(n,function(e){i.prototype[e]=function(){var i=t.values(this._views),n=[i].concat(t.toArray(arguments));return t[e].apply(t,n)}}),i}(Backbone,_),Backbone.Wreqr=function(e,t,i){"use strict";var n={};return n.Handlers=function(e,t){var i=function(e){this.options=e,this._wreqrHandlers={},t.isFunction(this.initialize)&&this.initialize(e)};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events,{setHandlers:function(e){t.each(e,function(e,i){var n=null;t.isObject(e)&&!t.isFunction(e)&&(n=e.context,e=e.callback),this.setHandler(i,e,n)},this)},setHandler:function(e,t,i){var n={callback:t,context:i};this._wreqrHandlers[e]=n,this.trigger("handler:add",e,t,i)},hasHandler:function(e){return!!this._wreqrHandlers[e]},getHandler:function(e){var t=this._wreqrHandlers[e];if(!t)throw Error("Handler not found for '"+e+"'");return function(){var e=Array.prototype.slice.apply(arguments);return t.callback.apply(t.context,e)}},removeHandler:function(e){delete this._wreqrHandlers[e]},removeAllHandlers:function(){this._wreqrHandlers={}}}),i}(e,i),n.CommandStorage=function(){var t=function(e){this.options=e,this._commands={},i.isFunction(this.initialize)&&this.initialize(e)};return i.extend(t.prototype,e.Events,{getCommands:function(e){var t=this._commands[e];return t||(t={command:e,instances:[]},this._commands[e]=t),t},addCommand:function(e,t){var i=this.getCommands(e);i.instances.push(t)},clearCommands:function(e){var t=this.getCommands(e);t.instances=[]}}),t}(),n.Commands=function(e){return e.Handlers.extend({storageType:e.CommandStorage,constructor:function(t){this.options=t||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var i=Array.prototype.slice.call(arguments);e.Handlers.prototype.constructor.apply(this,i)},execute:function(e,t){e=arguments[0],t=Array.prototype.slice.call(arguments,1),this.hasHandler(e)?this.getHandler(e).apply(this,t):this.storage.addCommand(e,t)},_executeCommands:function(e,t,n){var r=this.storage.getCommands(e);i.each(r.instances,function(e){t.apply(n,e)}),this.storage.clearCommands(e)},_initializeStorage:function(e){var t,n=e.storageType||this.storageType;t=i.isFunction(n)?new n:n,this.storage=t}})}(n),n.RequestResponse=function(e){return e.Handlers.extend({request:function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return this.getHandler(e).apply(this,t)}})}(n),n.EventAggregator=function(e,t){var i=function(){};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events),i}(e,i),n}(Backbone,Backbone.Marionette,_);var Marionette=function(e,t,i){"use strict";function n(e){return s.call(e)}function r(e,t){var i=Error(e);throw i.name=t||"Error",i}var o={};t.Marionette=o,o.$=t.$;var s=Array.prototype.slice;return o.extend=t.Model.extend,o.getOption=function(e,t){if(e&&t){var i;return i=e.options&&t in e.options&&void 0!==e.options[t]?e.options[t]:e[t]}},o.triggerMethod=function(){function e(e,t,i){return i.toUpperCase()}var t=/(^|:)(\w)/gi,n=function(n){var r="on"+n.replace(t,e),o=this[r];return this.trigger.apply(this,arguments),i.isFunction(o)?o.apply(this,i.tail(arguments)):void 0};return n}(),o.MonitorDOMRefresh=function(){function e(e){e._isShown=!0,n(e)}function t(e){e._isRendered=!0,n(e)}function n(e){e._isShown&&e._isRendered&&i.isFunction(e.triggerMethod)&&e.triggerMethod("dom:refresh")}return function(i){i.listenTo(i,"show",function(){e(i)}),i.listenTo(i,"render",function(){t(i)})}}(),function(e){function t(e,t,n,o){var s=o.split(/\s+/);i.each(s,function(i){var o=e[i];o||r("Method '"+i+"' was configured as an event handler, but does not exist."),e.listenTo(t,n,o,e)})}function n(e,t,i,n){e.listenTo(t,i,n,e)}function o(e,t,n,r){var o=r.split(/\s+/);i.each(o,function(i){var r=e[i];e.stopListening(t,n,r,e)})}function s(e,t,i,n){e.stopListening(t,i,n,e)}function h(e,t,n,r,o){t&&n&&(i.isFunction(n)&&(n=n.call(e)),i.each(n,function(n,s){i.isFunction(n)?r(e,t,s,n):o(e,t,s,n)}))}e.bindEntityEvents=function(e,i,r){h(e,i,r,n,t)},e.unbindEntityEvents=function(e,t,i){h(e,t,i,s,o)}}(o),o.Callbacks=function(){this._deferred=o.$.Deferred(),this._callbacks=[]},i.extend(o.Callbacks.prototype,{add:function(e,t){this._callbacks.push({cb:e,ctx:t}),this._deferred.done(function(i,n){t&&(i=t),e.call(i,n)})},run:function(e,t){this._deferred.resolve(t,e)},reset:function(){var e=this._callbacks;this._deferred=o.$.Deferred(),this._callbacks=[],i.each(e,function(e){this.add(e.cb,e.ctx)},this)}}),o.Controller=function(e){this.triggerMethod=o.triggerMethod,this.options=e||{},i.isFunction(this.initialize)&&this.initialize(this.options)},o.Controller.extend=o.extend,i.extend(o.Controller.prototype,t.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),o.Region=function(e){if(this.options=e||{},this.el=o.getOption(this,"el"),!this.el){var t=Error("An 'el' must be specified for a region.");throw t.name="NoElError",t}if(this.initialize){var i=Array.prototype.slice.apply(arguments);this.initialize.apply(this,i)}},i.extend(o.Region,{buildRegion:function(e,t){var n="string"==typeof e,r="string"==typeof e.selector,o=e.regionType===void 0,s="function"==typeof e;if(!s&&!n&&!r)throw Error("Region must be specified as a Region type, a selector string or an object with selector property");var h,a;n&&(h=e),e.selector&&(h=e.selector),s&&(a=e),!s&&o&&(a=t),e.regionType&&(a=e.regionType);var l=new a({el:h});return e.parentEl&&(l.getEl=function(t){var n=e.parentEl;return i.isFunction(n)&&(n=n()),n.find(t)}),l}}),i.extend(o.Region.prototype,t.Events,{show:function(e){this.ensureEl();var t=e.isClosed||i.isUndefined(e.$el),n=e!==this.currentView;n&&this.close(),e.render(),(n||t)&&this.open(e),this.currentView=e,o.triggerMethod.call(this,"show",e),o.triggerMethod.call(e,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(e){return o.$(e)},open:function(e){this.$el.empty().append(e.el)},close:function(){var e=this.currentView;e&&!e.isClosed&&(e.close?e.close():e.remove&&e.remove(),o.triggerMethod.call(this,"close"),delete this.currentView)},attachView:function(e){this.currentView=e},reset:function(){this.close(),delete this.$el}}),o.Region.extend=o.extend,o.RegionManager=function(e){var t=e.Controller.extend({constructor:function(t){this._regions={},e.Controller.prototype.constructor.call(this,t)},addRegions:function(e,t){var n={};return i.each(e,function(e,r){"string"==typeof e&&(e={selector:e}),e.selector&&(e=i.defaults({},e,t));var o=this.addRegion(r,e);n[r]=o},this),n},addRegion:function(t,n){var r,o=i.isObject(n),s=i.isString(n),h=!!n.selector;return r=s||o&&h?e.Region.buildRegion(n,e.Region):i.isFunction(n)?e.Region.buildRegion(n,e.Region):n,this._store(t,r),this.triggerMethod("region:add",t,r),r},get:function(e){return this._regions[e]},removeRegion:function(e){var t=this._regions[e];this._remove(e,t)},removeRegions:function(){i.each(this._regions,function(e,t){this._remove(t,e)},this)},closeRegions:function(){i.each(this._regions,function(e){e.close()},this)},close:function(){this.removeRegions();var t=Array.prototype.slice.call(arguments);e.Controller.prototype.close.apply(this,t)},_store:function(e,t){this._regions[e]=t,this._setLength()},_remove:function(e,t){t.close(),delete this._regions[e],this._setLength(),this.triggerMethod("region:remove",e,t)},_setLength:function(){this.length=i.size(this._regions)}}),n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return i.each(n,function(e){t.prototype[e]=function(){var t=i.values(this._regions),n=[t].concat(i.toArray(arguments));return i[e].apply(i,n)}}),t}(o),o.TemplateCache=function(e){this.templateId=e},i.extend(o.TemplateCache,{templateCaches:{},get:function(e){var t=this.templateCaches[e];return t||(t=new o.TemplateCache(e),this.templateCaches[e]=t),t.load()},clear:function(){var e,t=n(arguments),i=t.length;if(i>0)for(e=0;i>e;e++)delete this.templateCaches[t[e]];else this.templateCaches={}}}),i.extend(o.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var e=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(e),this.compiledTemplate},loadTemplate:function(e){var t=o.$(e).html();return t&&0!==t.length||r("Could not find template: '"+e+"'","NoTemplateError"),t},compileTemplate:function(e){return i.template(e)}}),o.Renderer={render:function(e,t){if(!e){var i=Error("Cannot render the template since it's false, null or undefined.");throw i.name="TemplateNotFoundError",i}var n;return n="function"==typeof e?e:o.TemplateCache.get(e),n(t)}},o.View=t.View.extend({constructor:function(){i.bindAll(this,"render");var e=Array.prototype.slice.apply(arguments);t.View.prototype.constructor.apply(this,e),o.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:o.triggerMethod,getTemplate:function(){return o.getOption(this,"template")},mixinTemplateHelpers:function(e){e=e||{};var t=this.templateHelpers;return i.isFunction(t)&&(t=t.call(this)),i.extend(e,t)},configureTriggers:function(){if(this.triggers){var e={},t=i.result(this,"triggers");return i.each(t,function(t,i){e[i]=function(e){e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation();var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(t,i)}},this),e}},delegateEvents:function(e){this._delegateDOMEvents(e),o.bindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.bindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(e){e=e||this.events,i.isFunction(e)&&(e=e.call(this));var n={},r=this.configureTriggers();i.extend(n,e,r),t.View.prototype.delegateEvents.call(this,n)},undelegateEvents:function(){var e=Array.prototype.slice.call(arguments);t.View.prototype.undelegateEvents.apply(this,e),o.unbindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.unbindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var e=this.triggerMethod("before:close");e!==!1&&(this.isClosed=!0,this.triggerMethod("close"),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var e=i.result(this,"_uiBindings");this.ui={},i.each(i.keys(e),function(t){var i=e[t];this.ui[t]=this.$(i)},this)}},unbindUIElements:function(){this.ui&&(i.each(this.ui,function(e,t){delete this.ui[t]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),o.ItemView=o.View.extend({constructor:function(){o.View.prototype.constructor.apply(this,n(arguments))},serializeData:function(){var e={};return this.model?e=this.model.toJSON():this.collection&&(e={items:this.collection.toJSON()}),e},render:function(){this.isClosed=!1,this.triggerMethod("before:render",this),this.triggerMethod("item:before:render",this);var e=this.serializeData();e=this.mixinTemplateHelpers(e);var t=this.getTemplate(),i=o.Renderer.render(t,e);return this.$el.html(i),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),o.View.prototype.close.apply(this,n(arguments)),this.triggerMethod("item:closed"))}}),o.CollectionView=o.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),o.View.prototype.constructor.apply(this,n(arguments)),this._initialEvents()},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this.render,this))},addChildView:function(e){this.closeEmptyView();var t=this.getItemView(e),i=this.collection.indexOf(e);this.addItemView(e,t,i)},onShowCalled:function(){this.children.each(function(e){o.triggerMethod.call(e,"show")})},triggerBeforeRender:function(){this.triggerMethod("before:render",this),this.triggerMethod("collection:before:render",this)},triggerRendered:function(){this.triggerMethod("render",this),this.triggerMethod("collection:rendered",this)},render:function(){return this.isClosed=!1,this.triggerBeforeRender(),this._renderChildren(),this.triggerRendered(),this},_renderChildren:function(){this.closeEmptyView(),this.closeChildren(),this.collection&&this.collection.length>0?this.showCollection():this.showEmptyView()},showCollection:function(){var e;this.collection.each(function(t,i){e=this.getItemView(t),this.addItemView(t,e,i)},this)},showEmptyView:function(){var e=o.getOption(this,"emptyView");if(e&&!this._showingEmptyView){this._showingEmptyView=!0;var i=new t.Model;this.addItemView(i,e,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getItemView:function(){var e=o.getOption(this,"itemView");return e||r("An `itemView` must be specified","NoItemViewError"),e},addItemView:function(e,t,n){var r=o.getOption(this,"itemViewOptions");i.isFunction(r)&&(r=r.call(this,e,n));var s=this.buildItemView(e,t,r);this.addChildViewEventForwarding(s),this.triggerMethod("before:item:added",s),this.children.add(s),this.renderItemView(s,n),this._isShown&&o.triggerMethod.call(s,"show"),this.triggerMethod("after:item:added",s)},addChildViewEventForwarding:function(e){var t=o.getOption(this,"itemViewEventPrefix");this.listenTo(e,"all",function(){var i=n(arguments);i[0]=t+":"+i[0],i.splice(1,0,e),o.triggerMethod.apply(this,i)},this)},renderItemView:function(e,t){e.render(),this.appendHtml(this,e,t)},buildItemView:function(e,t,n){var r=i.extend({model:e},n);return new t(r)},removeItemView:function(e){var t=this.children.findByModel(e);this.removeChildView(t),this.checkEmpty()},removeChildView:function(e){e&&(this.stopListening(e),e.close?e.close():e.remove&&e.remove(),this.children.remove(e)),this.triggerMethod("item:removed",e)},checkEmpty:function(){this.collection&&0!==this.collection.length||this.showEmptyView()},appendHtml:function(e,t){e.$el.append(t.el)},_initChildViewStorage:function(){this.children=new t.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),o.View.prototype.close.apply(this,n(arguments)))},closeChildren:function(){this.children.each(function(e){this.removeChildView(e)},this),this.checkEmpty()}}),o.CompositeView=o.CollectionView.extend({constructor:function(){o.CollectionView.prototype.constructor.apply(this,n(arguments))},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this._renderChildren,this))},getItemView:function(){var e=o.getOption(this,"itemView")||this.constructor;return e||r("An `itemView` must be specified","NoItemViewError"),e},serializeData:function(){var e={};return this.model&&(e=this.model.toJSON()),e},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var e=this.renderModel();return this.$el.html(e),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(o.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var e={};e=this.serializeData(),e=this.mixinTemplateHelpers(e);var t=this.getTemplate();return o.Renderer.render(t,e)},appendHtml:function(e,t){var i=this.getItemViewContainer(e);i.append(t.el)},getItemViewContainer:function(e){if("$itemViewContainer"in e)return e.$itemViewContainer;var t;if(e.itemViewContainer){var n=i.result(e,"itemViewContainer");t=e.$(n),0>=t.length&&r("The specified `itemViewContainer` was not found: "+e.itemViewContainer,"ItemViewContainerMissingError")}else t=e.$el;return e.$itemViewContainer=t,t},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),o.Layout=o.ItemView.extend({regionType:o.Region,constructor:function(e){e=e||{},this._firstRender=!0,this._initializeRegions(e),o.ItemView.prototype.constructor.call(this,e)},render:function(){this._firstRender?this._firstRender=!1:this.isClosed?this._initializeRegions():this._reInitializeRegions();var e=Array.prototype.slice.apply(arguments),t=o.ItemView.prototype.render.apply(this,e);return t},close:function(){if(!this.isClosed){this.regionManager.close();var e=Array.prototype.slice.apply(arguments);o.ItemView.prototype.close.apply(this,e)}},addRegion:function(e,t){var i={};return i[e]=t,this.addRegions(i)[e]},addRegions:function(e){return this.regions=i.extend(this.regions||{},e),this._buildRegions(e)},removeRegion:function(e){return this.regionManager.removeRegion(e)},_buildRegions:function(e){var t=this,i={parentEl:function(){return t.$el}};return this.regionManager.addRegions(e,i)},_initializeRegions:function(e){var t;this._initRegionManager(),t=i.isFunction(this.regions)?this.regions(e):this.regions||{},this.addRegions(t)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(e){e.reset()})},_initRegionManager:function(){this.regionManager=new o.RegionManager,this.listenTo(this.regionManager,"region:add",function(e,t){this[e]=t,this.trigger("region:add",e,t)}),this.listenTo(this.regionManager,"region:remove",function(e,t){delete this[e],this.trigger("region:remove",e,t)})}}),o.AppRouter=t.Router.extend({constructor:function(e){if(t.Router.prototype.constructor.apply(this,n(arguments)),this.options=e,this.appRoutes){var i=o.getOption(this,"controller");this.processAppRoutes(i,this.appRoutes)}},processAppRoutes:function(e,t){var n=i.keys(t).reverse();i.each(n,function(n){var r=t[n],o=e[r];if(!o)throw Error("Method '"+r+"' was not found on the controller");this.route(n,r,i.bind(o,e))},this)}}),o.Application=function(e){this._initRegionManager(),this._initCallbacks=new o.Callbacks,this.vent=new t.Wreqr.EventAggregator,this.commands=new t.Wreqr.Commands,this.reqres=new t.Wreqr.RequestResponse,this.submodules={},i.extend(this,e),this.triggerMethod=o.triggerMethod},i.extend(o.Application.prototype,t.Events,{execute:function(){var e=Array.prototype.slice.apply(arguments);this.commands.execute.apply(this.commands,e)},request:function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)},addInitializer:function(e){this._initCallbacks.add(e)},start:function(e){this.triggerMethod("initialize:before",e),this._initCallbacks.run(e,this),this.triggerMethod("initialize:after",e),this.triggerMethod("start",e)},addRegions:function(e){return this._regionManager.addRegions(e)},removeRegion:function(e){this._regionManager.removeRegion(e)},module:function(){var e=n(arguments);return e.unshift(this),o.Module.create.apply(o.Module,e)},_initRegionManager:function(){this._regionManager=new o.RegionManager,this.listenTo(this._regionManager,"region:add",function(e,t){this[e]=t}),this.listenTo(this._regionManager,"region:remove",function(e){delete this[e]})}}),o.Application.extend=o.extend,o.Module=function(e,t){this.moduleName=e,this.submodules={},this._setupInitializersAndFinalizers(),this.app=t,this.startWithParent=!0,this.triggerMethod=o.triggerMethod},i.extend(o.Module.prototype,t.Events,{addInitializer:function(e){this._initializerCallbacks.add(e)},addFinalizer:function(e){this._finalizerCallbacks.add(e)},start:function(e){this._isInitialized||(i.each(this.submodules,function(t){t.startWithParent&&t.start(e)}),this.triggerMethod("before:start",e),this._initializerCallbacks.run(e,this),this._isInitialized=!0,this.triggerMethod("start",e))},stop:function(){this._isInitialized&&(this._isInitialized=!1,o.triggerMethod.call(this,"before:stop"),i.each(this.submodules,function(e){e.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),o.triggerMethod.call(this,"stop"))},addDefinition:function(e,t){this._runModuleDefinition(e,t)},_runModuleDefinition:function(e,n){if(e){var r=i.flatten([this,this.app,t,o,o.$,i,n]);e.apply(this,r)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new o.Callbacks,this._finalizerCallbacks=new o.Callbacks}}),i.extend(o.Module,{create:function(e,t,r){var o=e,s=n(arguments);s.splice(0,3),t=t.split(".");var h=t.length,a=[];return a[h-1]=r,i.each(t,function(t,i){var n=o;o=this._getModule(n,t,e),this._addModuleDefinition(n,o,a[i],s)},this),o},_getModule:function(e,t,i){var n=e[t];return n||(n=new o.Module(t,i),e[t]=n,e.submodules[t]=n),n},_addModuleDefinition:function(e,t,n,r){var o,s;i.isFunction(n)?(o=n,s=!0):i.isObject(n)?(o=n.define,s=n.startWithParent):s=!0,o&&t.addDefinition(o,r),t.startWithParent=t.startWithParent&&s,t.startWithParent&&!t.startWithParentIsConfigured&&(t.startWithParentIsConfigured=!0,e.addInitializer(function(e){t.startWithParent&&t.start(e)}))}}),o}(this,Backbone,_);
20
+ Backbone.ChildViewContainer=function(e,t){var i=function(e){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),t.each(e,this.add,this)};t.extend(i.prototype,{add:function(e,t){var i=e.cid;this._views[i]=e,e.model&&(this._indexByModel[e.model.cid]=i),t&&(this._indexByCustom[t]=i),this._updateLength()},findByModel:function(e){return this.findByModelCid(e.cid)},findByModelCid:function(e){var t=this._indexByModel[e];return this.findByCid(t)},findByCustom:function(e){var t=this._indexByCustom[e];return this.findByCid(t)},findByIndex:function(e){return t.values(this._views)[e]},findByCid:function(e){return this._views[e]},remove:function(e){var i=e.cid;e.model&&delete this._indexByModel[e.model.cid],t.any(this._indexByCustom,function(e,t){return e===i?(delete this._indexByCustom[t],!0):void 0},this),delete this._views[i],this._updateLength()},call:function(e){this.apply(e,t.tail(arguments))},apply:function(e,i){t.each(this._views,function(n){t.isFunction(n[e])&&n[e].apply(n,i||[])})},_updateLength:function(){this.length=t.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return t.each(n,function(e){i.prototype[e]=function(){var i=t.values(this._views),n=[i].concat(t.toArray(arguments));return t[e].apply(t,n)}}),i}(Backbone,_),Backbone.Wreqr=function(e,t,i){"use strict";var n={};return n.Handlers=function(e,t){var i=function(e){this.options=e,this._wreqrHandlers={},t.isFunction(this.initialize)&&this.initialize(e)};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events,{setHandlers:function(e){t.each(e,function(e,i){var n=null;t.isObject(e)&&!t.isFunction(e)&&(n=e.context,e=e.callback),this.setHandler(i,e,n)},this)},setHandler:function(e,t,i){var n={callback:t,context:i};this._wreqrHandlers[e]=n,this.trigger("handler:add",e,t,i)},hasHandler:function(e){return!!this._wreqrHandlers[e]},getHandler:function(e){var t=this._wreqrHandlers[e];if(!t)throw Error("Handler not found for '"+e+"'");return function(){var e=Array.prototype.slice.apply(arguments);return t.callback.apply(t.context,e)}},removeHandler:function(e){delete this._wreqrHandlers[e]},removeAllHandlers:function(){this._wreqrHandlers={}}}),i}(e,i),n.CommandStorage=function(){var t=function(e){this.options=e,this._commands={},i.isFunction(this.initialize)&&this.initialize(e)};return i.extend(t.prototype,e.Events,{getCommands:function(e){var t=this._commands[e];return t||(t={command:e,instances:[]},this._commands[e]=t),t},addCommand:function(e,t){var i=this.getCommands(e);i.instances.push(t)},clearCommands:function(e){var t=this.getCommands(e);t.instances=[]}}),t}(),n.Commands=function(e){return e.Handlers.extend({storageType:e.CommandStorage,constructor:function(t){this.options=t||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var i=Array.prototype.slice.call(arguments);e.Handlers.prototype.constructor.apply(this,i)},execute:function(e,t){e=arguments[0],t=Array.prototype.slice.call(arguments,1),this.hasHandler(e)?this.getHandler(e).apply(this,t):this.storage.addCommand(e,t)},_executeCommands:function(e,t,n){var r=this.storage.getCommands(e);i.each(r.instances,function(e){t.apply(n,e)}),this.storage.clearCommands(e)},_initializeStorage:function(e){var t,n=e.storageType||this.storageType;t=i.isFunction(n)?new n:n,this.storage=t}})}(n),n.RequestResponse=function(e){return e.Handlers.extend({request:function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return this.getHandler(e).apply(this,t)}})}(n),n.EventAggregator=function(e,t){var i=function(){};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events),i}(e,i),n}(Backbone,Backbone.Marionette,_);var Marionette=function(e,t,i){"use strict";function n(e){return s.call(e)}function r(e,t){var i=Error(e);throw i.name=t||"Error",i}var o={};t.Marionette=o,o.$=t.$;var s=Array.prototype.slice;return o.extend=t.Model.extend,o.getOption=function(e,t){if(e&&t){var i;return i=e.options&&t in e.options&&void 0!==e.options[t]?e.options[t]:e[t]}},o.triggerMethod=function(){function e(e,t,i){return i.toUpperCase()}var t=/(^|:)(\w)/gi,n=function(n){var r="on"+n.replace(t,e),o=this[r];return i.isFunction(this.trigger)&&this.trigger.apply(this,arguments),i.isFunction(o)?o.apply(this,i.tail(arguments)):void 0};return n}(),o.MonitorDOMRefresh=function(){function e(e){e._isShown=!0,n(e)}function t(e){e._isRendered=!0,n(e)}function n(e){e._isShown&&e._isRendered&&i.isFunction(e.triggerMethod)&&e.triggerMethod("dom:refresh")}return function(i){i.listenTo(i,"show",function(){e(i)}),i.listenTo(i,"render",function(){t(i)})}}(),function(e){function t(e,t,n,o){var s=o.split(/\s+/);i.each(s,function(i){var o=e[i];o||r("Method '"+i+"' was configured as an event handler, but does not exist."),e.listenTo(t,n,o,e)})}function n(e,t,i,n){e.listenTo(t,i,n,e)}function o(e,t,n,r){var o=r.split(/\s+/);i.each(o,function(i){var r=e[i];e.stopListening(t,n,r,e)})}function s(e,t,i,n){e.stopListening(t,i,n,e)}function h(e,t,n,r,o){t&&n&&(i.isFunction(n)&&(n=n.call(e)),i.each(n,function(n,s){i.isFunction(n)?r(e,t,s,n):o(e,t,s,n)}))}e.bindEntityEvents=function(e,i,r){h(e,i,r,n,t)},e.unbindEntityEvents=function(e,t,i){h(e,t,i,s,o)}}(o),o.Callbacks=function(){this._deferred=o.$.Deferred(),this._callbacks=[]},i.extend(o.Callbacks.prototype,{add:function(e,t){this._callbacks.push({cb:e,ctx:t}),this._deferred.done(function(i,n){t&&(i=t),e.call(i,n)})},run:function(e,t){this._deferred.resolve(t,e)},reset:function(){var e=this._callbacks;this._deferred=o.$.Deferred(),this._callbacks=[],i.each(e,function(e){this.add(e.cb,e.ctx)},this)}}),o.Controller=function(e){this.triggerMethod=o.triggerMethod,this.options=e||{},i.isFunction(this.initialize)&&this.initialize(this.options)},o.Controller.extend=o.extend,i.extend(o.Controller.prototype,t.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),o.Region=function(e){if(this.options=e||{},this.el=o.getOption(this,"el"),!this.el){var t=Error("An 'el' must be specified for a region.");throw t.name="NoElError",t}if(this.initialize){var i=Array.prototype.slice.apply(arguments);this.initialize.apply(this,i)}},i.extend(o.Region,{buildRegion:function(e,t){var n="string"==typeof e,r="string"==typeof e.selector,o=e.regionType===void 0,s="function"==typeof e;if(!s&&!n&&!r)throw Error("Region must be specified as a Region type, a selector string or an object with selector property");var h,a;n&&(h=e),e.selector&&(h=e.selector),s&&(a=e),!s&&o&&(a=t),e.regionType&&(a=e.regionType);var l=new a({el:h});return e.parentEl&&(l.getEl=function(t){var n=e.parentEl;return i.isFunction(n)&&(n=n()),n.find(t)}),l}}),i.extend(o.Region.prototype,t.Events,{show:function(e){this.ensureEl();var t=e.isClosed||i.isUndefined(e.$el),n=e!==this.currentView;n&&this.close(),e.render(),(n||t)&&this.open(e),this.currentView=e,o.triggerMethod.call(this,"show",e),o.triggerMethod.call(e,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(e){return o.$(e)},open:function(e){this.$el.empty().append(e.el)},close:function(){var e=this.currentView;e&&!e.isClosed&&(e.close?e.close():e.remove&&e.remove(),o.triggerMethod.call(this,"close"),delete this.currentView)},attachView:function(e){this.currentView=e},reset:function(){this.close(),delete this.$el}}),o.Region.extend=o.extend,o.RegionManager=function(e){var t=e.Controller.extend({constructor:function(t){this._regions={},e.Controller.prototype.constructor.call(this,t)},addRegions:function(e,t){var n={};return i.each(e,function(e,r){"string"==typeof e&&(e={selector:e}),e.selector&&(e=i.defaults({},e,t));var o=this.addRegion(r,e);n[r]=o},this),n},addRegion:function(t,n){var r,o=i.isObject(n),s=i.isString(n),h=!!n.selector;return r=s||o&&h?e.Region.buildRegion(n,e.Region):i.isFunction(n)?e.Region.buildRegion(n,e.Region):n,this._store(t,r),this.triggerMethod("region:add",t,r),r},get:function(e){return this._regions[e]},removeRegion:function(e){var t=this._regions[e];this._remove(e,t)},removeRegions:function(){i.each(this._regions,function(e,t){this._remove(t,e)},this)},closeRegions:function(){i.each(this._regions,function(e){e.close()},this)},close:function(){this.removeRegions();var t=Array.prototype.slice.call(arguments);e.Controller.prototype.close.apply(this,t)},_store:function(e,t){this._regions[e]=t,this._setLength()},_remove:function(e,t){t.close(),delete this._regions[e],this._setLength(),this.triggerMethod("region:remove",e,t)},_setLength:function(){this.length=i.size(this._regions)}}),n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return i.each(n,function(e){t.prototype[e]=function(){var t=i.values(this._regions),n=[t].concat(i.toArray(arguments));return i[e].apply(i,n)}}),t}(o),o.TemplateCache=function(e){this.templateId=e},i.extend(o.TemplateCache,{templateCaches:{},get:function(e){var t=this.templateCaches[e];return t||(t=new o.TemplateCache(e),this.templateCaches[e]=t),t.load()},clear:function(){var e,t=n(arguments),i=t.length;if(i>0)for(e=0;i>e;e++)delete this.templateCaches[t[e]];else this.templateCaches={}}}),i.extend(o.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var e=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(e),this.compiledTemplate},loadTemplate:function(e){var t=o.$(e).html();return t&&0!==t.length||r("Could not find template: '"+e+"'","NoTemplateError"),t},compileTemplate:function(e){return i.template(e)}}),o.Renderer={render:function(e,t){if(!e){var i=Error("Cannot render the template since it's false, null or undefined.");throw i.name="TemplateNotFoundError",i}var n;return n="function"==typeof e?e:o.TemplateCache.get(e),n(t)}},o.View=t.View.extend({constructor:function(){i.bindAll(this,"render");var e=Array.prototype.slice.apply(arguments);t.View.prototype.constructor.apply(this,e),o.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:o.triggerMethod,getTemplate:function(){return o.getOption(this,"template")},mixinTemplateHelpers:function(e){e=e||{};var t=o.getOption(this,"templateHelpers");return i.isFunction(t)&&(t=t.call(this)),i.extend(e,t)},configureTriggers:function(){if(this.triggers){var e={},t=i.result(this,"triggers");return i.each(t,function(t,i){e[i]=function(e){e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation();var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(t,i)}},this),e}},delegateEvents:function(e){this._delegateDOMEvents(e),o.bindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.bindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(e){e=e||this.events,i.isFunction(e)&&(e=e.call(this));var n={},r=this.configureTriggers();i.extend(n,e,r),t.View.prototype.delegateEvents.call(this,n)},undelegateEvents:function(){var e=Array.prototype.slice.call(arguments);t.View.prototype.undelegateEvents.apply(this,e),o.unbindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.unbindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var e=this.triggerMethod("before:close");e!==!1&&(this.isClosed=!0,this.triggerMethod("close"),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var e=i.result(this,"_uiBindings");this.ui={},i.each(i.keys(e),function(t){var i=e[t];this.ui[t]=this.$(i)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(i.each(this.ui,function(e,t){delete this.ui[t]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),o.ItemView=o.View.extend({constructor:function(){o.View.prototype.constructor.apply(this,n(arguments))},serializeData:function(){var e={};return this.model?e=this.model.toJSON():this.collection&&(e={items:this.collection.toJSON()}),e},render:function(){this.isClosed=!1,this.triggerMethod("before:render",this),this.triggerMethod("item:before:render",this);var e=this.serializeData();e=this.mixinTemplateHelpers(e);var t=this.getTemplate(),i=o.Renderer.render(t,e);return this.$el.html(i),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),o.View.prototype.close.apply(this,n(arguments)),this.triggerMethod("item:closed"))}}),o.CollectionView=o.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),o.View.prototype.constructor.apply(this,n(arguments)),this._initialEvents()},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this.render,this))},addChildView:function(e){this.closeEmptyView();var t=this.getItemView(e),i=this.collection.indexOf(e);this.addItemView(e,t,i)},onShowCalled:function(){this.children.each(function(e){o.triggerMethod.call(e,"show")})},triggerBeforeRender:function(){this.triggerMethod("before:render",this),this.triggerMethod("collection:before:render",this)},triggerRendered:function(){this.triggerMethod("render",this),this.triggerMethod("collection:rendered",this)},render:function(){return this.isClosed=!1,this.triggerBeforeRender(),this._renderChildren(),this.triggerRendered(),this},_renderChildren:function(){this.closeEmptyView(),this.closeChildren(),this.collection&&this.collection.length>0?this.showCollection():this.showEmptyView()},showCollection:function(){var e;this.collection.each(function(t,i){e=this.getItemView(t),this.addItemView(t,e,i)},this)},showEmptyView:function(){var e=o.getOption(this,"emptyView");if(e&&!this._showingEmptyView){this._showingEmptyView=!0;var i=new t.Model;this.addItemView(i,e,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getItemView:function(){var e=o.getOption(this,"itemView");return e||r("An `itemView` must be specified","NoItemViewError"),e},addItemView:function(e,t,n){var r=o.getOption(this,"itemViewOptions");i.isFunction(r)&&(r=r.call(this,e,n));var s=this.buildItemView(e,t,r);this.addChildViewEventForwarding(s),this.triggerMethod("before:item:added",s),this.children.add(s),this.renderItemView(s,n),this._isShown&&o.triggerMethod.call(s,"show"),this.triggerMethod("after:item:added",s)},addChildViewEventForwarding:function(e){var t=o.getOption(this,"itemViewEventPrefix");this.listenTo(e,"all",function(){var i=n(arguments);i[0]=t+":"+i[0],i.splice(1,0,e),o.triggerMethod.apply(this,i)},this)},renderItemView:function(e,t){e.render(),this.appendHtml(this,e,t)},buildItemView:function(e,t,n){var r=i.extend({model:e},n);return new t(r)},removeItemView:function(e){var t=this.children.findByModel(e);this.removeChildView(t),this.checkEmpty()},removeChildView:function(e){e&&(this.stopListening(e),e.close?e.close():e.remove&&e.remove(),this.children.remove(e)),this.triggerMethod("item:removed",e)},checkEmpty:function(){this.collection&&0!==this.collection.length||this.showEmptyView()},appendHtml:function(e,t){e.$el.append(t.el)},_initChildViewStorage:function(){this.children=new t.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),o.View.prototype.close.apply(this,n(arguments)))},closeChildren:function(){this.children.each(function(e){this.removeChildView(e)},this),this.checkEmpty()}}),o.CompositeView=o.CollectionView.extend({constructor:function(){o.CollectionView.prototype.constructor.apply(this,n(arguments))},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this._renderChildren,this))},getItemView:function(){var e=o.getOption(this,"itemView")||this.constructor;return e||r("An `itemView` must be specified","NoItemViewError"),e},serializeData:function(){var e={};return this.model&&(e=this.model.toJSON()),e},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var e=this.renderModel();return this.$el.html(e),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(o.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var e={};e=this.serializeData(),e=this.mixinTemplateHelpers(e);var t=this.getTemplate();return o.Renderer.render(t,e)},appendHtml:function(e,t){var i=this.getItemViewContainer(e);i.append(t.el)},getItemViewContainer:function(e){if("$itemViewContainer"in e)return e.$itemViewContainer;var t,n=o.getOption(e,"itemViewContainer");if(n){var s=i.isFunction(n)?n():n;t=e.$(s),0>=t.length&&r("The specified `itemViewContainer` was not found: "+e.itemViewContainer,"ItemViewContainerMissingError")}else t=e.$el;return e.$itemViewContainer=t,t},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),o.Layout=o.ItemView.extend({regionType:o.Region,constructor:function(e){e=e||{},this._firstRender=!0,this._initializeRegions(e),o.ItemView.prototype.constructor.call(this,e)},render:function(){this.isClosed&&this._initializeRegions(),this._firstRender?this._firstRender=!1:this.isClosed||this._reInitializeRegions();var e=Array.prototype.slice.apply(arguments),t=o.ItemView.prototype.render.apply(this,e);return t},close:function(){if(!this.isClosed){this.regionManager.close();var e=Array.prototype.slice.apply(arguments);o.ItemView.prototype.close.apply(this,e)}},addRegion:function(e,t){var i={};return i[e]=t,this._buildRegions(i)[e]},addRegions:function(e){return this.regions=i.extend({},this.regions,e),this._buildRegions(e)},removeRegion:function(e){return delete this.regions[e],this.regionManager.removeRegion(e)},_buildRegions:function(e){var t=this,i={regionType:o.getOption(this,"regionType"),parentEl:function(){return t.$el}};return this.regionManager.addRegions(e,i)},_initializeRegions:function(e){var t;this._initRegionManager(),t=i.isFunction(this.regions)?this.regions(e):this.regions||{},this.addRegions(t)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(e){e.reset()})},_initRegionManager:function(){this.regionManager=new o.RegionManager,this.listenTo(this.regionManager,"region:add",function(e,t){this[e]=t,this.trigger("region:add",e,t)}),this.listenTo(this.regionManager,"region:remove",function(e,t){delete this[e],this.trigger("region:remove",e,t)})}}),o.AppRouter=t.Router.extend({constructor:function(e){t.Router.prototype.constructor.apply(this,n(arguments)),this.options=e||{};var i=o.getOption(this,"appRoutes"),r=this._getController();this.processAppRoutes(r,i)},appRoute:function(e,t){var i=this._getController();this._addAppRoute(i,e,t)},processAppRoutes:function(e,t){if(t){var n=i.keys(t).reverse();i.each(n,function(i){this._addAppRoute(e,i,t[i])},this)}},_getController:function(){return o.getOption(this,"controller")},_addAppRoute:function(e,t,n){var r=e[n];if(!r)throw Error("Method '"+n+"' was not found on the controller");this.route(t,n,i.bind(r,e))}}),o.Application=function(e){this._initRegionManager(),this._initCallbacks=new o.Callbacks,this.vent=new t.Wreqr.EventAggregator,this.commands=new t.Wreqr.Commands,this.reqres=new t.Wreqr.RequestResponse,this.submodules={},i.extend(this,e),this.triggerMethod=o.triggerMethod},i.extend(o.Application.prototype,t.Events,{execute:function(){var e=Array.prototype.slice.apply(arguments);this.commands.execute.apply(this.commands,e)},request:function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)},addInitializer:function(e){this._initCallbacks.add(e)},start:function(e){this.triggerMethod("initialize:before",e),this._initCallbacks.run(e,this),this.triggerMethod("initialize:after",e),this.triggerMethod("start",e)},addRegions:function(e){return this._regionManager.addRegions(e)},closeRegions:function(){this._regionManager.closeRegions()},removeRegion:function(e){this._regionManager.removeRegion(e)},getRegion:function(e){return this._regionManager.get(e)},module:function(){var e=n(arguments);return e.unshift(this),o.Module.create.apply(o.Module,e)},_initRegionManager:function(){this._regionManager=new o.RegionManager,this.listenTo(this._regionManager,"region:add",function(e,t){this[e]=t}),this.listenTo(this._regionManager,"region:remove",function(e){delete this[e]})}}),o.Application.extend=o.extend,o.Module=function(e,t){this.moduleName=e,this.submodules={},this._setupInitializersAndFinalizers(),this.app=t,this.startWithParent=!0,this.triggerMethod=o.triggerMethod},i.extend(o.Module.prototype,t.Events,{addInitializer:function(e){this._initializerCallbacks.add(e)},addFinalizer:function(e){this._finalizerCallbacks.add(e)},start:function(e){this._isInitialized||(i.each(this.submodules,function(t){t.startWithParent&&t.start(e)}),this.triggerMethod("before:start",e),this._initializerCallbacks.run(e,this),this._isInitialized=!0,this.triggerMethod("start",e))},stop:function(){this._isInitialized&&(this._isInitialized=!1,o.triggerMethod.call(this,"before:stop"),i.each(this.submodules,function(e){e.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),o.triggerMethod.call(this,"stop"))},addDefinition:function(e,t){this._runModuleDefinition(e,t)},_runModuleDefinition:function(e,n){if(e){var r=i.flatten([this,this.app,t,o,o.$,i,n]);e.apply(this,r)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new o.Callbacks,this._finalizerCallbacks=new o.Callbacks}}),i.extend(o.Module,{create:function(e,t,r){var o=e,s=n(arguments);s.splice(0,3),t=t.split(".");var h=t.length,a=[];return a[h-1]=r,i.each(t,function(t,i){var n=o;o=this._getModule(n,t,e),this._addModuleDefinition(n,o,a[i],s)},this),o},_getModule:function(e,t,i){var n=e[t];return n||(n=new o.Module(t,i),e[t]=n,e.submodules[t]=n),n},_addModuleDefinition:function(e,t,n,r){var o,s;i.isFunction(n)?(o=n,s=!0):i.isObject(n)?(o=n.define,s=n.startWithParent):s=!0,o&&t.addDefinition(o,r),t.startWithParent=t.startWithParent&&s,t.startWithParent&&!t.startWithParentIsConfigured&&(t.startWithParentIsConfigured=!0,e.addInitializer(function(e){t.startWithParent&&t.start(e)}))}}),o}(this,Backbone,_);
21
21
  //@ sourceMappingURL=backbone.marionette.map
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionette-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Godfrey Chan
@@ -10,24 +9,22 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-07-10 00:00:00.000000000 Z
12
+ date: 2013-08-14 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
- version_requirements: !ruby/object:Gem::Requirement
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 3.1.0
21
- none: false
22
- name: rails
21
+ type: :runtime
23
22
  prerelease: false
24
- requirement: !ruby/object:Gem::Requirement
23
+ version_requirements: !ruby/object:Gem::Requirement
25
24
  requirements:
26
- - - ! '>='
25
+ - - '>='
27
26
  - !ruby/object:Gem::Version
28
27
  version: 3.1.0
29
- none: false
30
- type: :runtime
31
28
  description: Vendors Backbone.Marionette for use with the asset pipeline.
32
29
  email:
33
30
  - godfreykfc@gmail.com
@@ -36,8 +33,8 @@ executables: []
36
33
  extensions: []
37
34
  extra_rdoc_files: []
38
35
  files:
39
- - lib/marionette-rails.rb
40
36
  - lib/marionette-rails/version.rb
37
+ - lib/marionette-rails.rb
41
38
  - vendor/assets/javascripts/backbone.marionette.js
42
39
  - vendor/assets/javascripts/backbone.marionette.map
43
40
  - vendor/assets/javascripts/backbone.marionette.min.js
@@ -45,26 +42,25 @@ files:
45
42
  - README.md
46
43
  homepage: https://github.com/chancancode/marionette-rails
47
44
  licenses: []
45
+ metadata: {}
48
46
  post_install_message:
49
47
  rdoc_options: []
50
48
  require_paths:
51
49
  - lib
52
50
  required_ruby_version: !ruby/object:Gem::Requirement
53
51
  requirements:
54
- - - ! '>='
52
+ - - '>='
55
53
  - !ruby/object:Gem::Version
56
54
  version: '0'
57
- none: false
58
55
  required_rubygems_version: !ruby/object:Gem::Requirement
59
56
  requirements:
60
- - - ! '>='
57
+ - - '>='
61
58
  - !ruby/object:Gem::Version
62
59
  version: 1.3.6
63
- none: false
64
60
  requirements: []
65
61
  rubyforge_project:
66
- rubygems_version: 1.8.25
62
+ rubygems_version: 2.0.3
67
63
  signing_key:
68
- specification_version: 3
64
+ specification_version: 4
69
65
  summary: Backbone.Marionette for Rails
70
66
  test_files: []