marionette-rails 1.1.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3df84f2bc2ea6c1aef5cb2440c83ade372d82a95
4
- data.tar.gz: c301df07ebf0f28da4bda15ea0bcd3aa0a1d95b8
3
+ metadata.gz: 26d85a4dae7f6e1bd27a70fcee47c2ae21c1498f
4
+ data.tar.gz: e3c160a8c07560160399173fbc14a2997f0b861d
5
5
  SHA512:
6
- metadata.gz: 57c7cf2def08ea6c5c88510cb04a76efd5dea850f7c034b6d6a67e7826ec2085cd43cb749df07387d1b94133d973afb92f857a44fd1473e520af4255624f7426
7
- data.tar.gz: a3842e6bf08ae00997fb7a636bcb1670935a9962a3a3289a789ce56b0c795ed38fcff876425f1f3ffe0a4e1b87fb394ea135b4d851f79878bf708accbc3a3692
6
+ metadata.gz: c7c19feef5550993c99566e96619da1269461c2d7ea54cef7dded226b1a3f33e65a61250c5269c1c0b2f9a6fb3fe1a9c6cb3d63e203241b829ac1ad5490c685e
7
+ data.tar.gz: 3a4aef997d04e45a1eee691ae9ec9ddf39902cb1b9014c9cd5d10cedbbb50f0364502c3783ba62f1b609050667193635e6b3e04a85ddee881b1c93e96914dd98
@@ -1,5 +1,5 @@
1
1
  module Marionette
2
2
  module Rails
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.2'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  // MarionetteJS (Backbone.Marionette)
2
2
  // ----------------------------------
3
- // v1.1.0
3
+ // v1.2.2
4
4
  //
5
5
  // Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
6
6
  // Distributed under MIT license
@@ -33,7 +33,7 @@
33
33
  // shut down child views.
34
34
 
35
35
  Backbone.ChildViewContainer = (function(Backbone, _){
36
-
36
+
37
37
  // Container Constructor
38
38
  // ---------------------
39
39
 
@@ -158,9 +158,9 @@ Backbone.ChildViewContainer = (function(Backbone, _){
158
158
  //
159
159
  // Mix in methods from Underscore, for iteration, and other
160
160
  // collection related features.
161
- var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter',
162
- 'select', 'reject', 'every', 'all', 'some', 'any', 'include',
163
- 'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',
161
+ var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter',
162
+ 'select', 'reject', 'every', 'all', 'some', 'any', 'include',
163
+ 'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',
164
164
  'last', 'without', 'isEmpty', 'pluck'];
165
165
 
166
166
  _.each(methods, function(method) {
@@ -195,14 +195,14 @@ Backbone.Wreqr = (function(Backbone, Marionette, _){
195
195
 
196
196
  Wreqr.Handlers = (function(Backbone, _){
197
197
  "use strict";
198
-
198
+
199
199
  // Constructor
200
200
  // -----------
201
201
 
202
202
  var Handlers = function(options){
203
203
  this.options = options;
204
204
  this._wreqrHandlers = {};
205
-
205
+
206
206
  if (_.isFunction(this.initialize)){
207
207
  this.initialize(options);
208
208
  }
@@ -308,7 +308,7 @@ Wreqr.CommandStorage = (function(){
308
308
 
309
309
  // build the configuration
310
310
  commands = {
311
- command: commandName,
311
+ command: commandName,
312
312
  instances: []
313
313
  };
314
314
 
@@ -576,8 +576,8 @@ Marionette.MonitorDOMRefresh = (function(){
576
576
  // Marionette.bindEntityEvents & unbindEntityEvents
577
577
  // ---------------------------
578
578
  //
579
- // These methods are used to bind/unbind a backbone "entity" (collection/model)
580
- // to methods on a target object.
579
+ // These methods are used to bind/unbind a backbone "entity" (collection/model)
580
+ // to methods on a target object.
581
581
  //
582
582
  // The first parameter, `target`, must have a `listenTo` method from the
583
583
  // EventBinder object.
@@ -587,7 +587,7 @@ Marionette.MonitorDOMRefresh = (function(){
587
587
  //
588
588
  // The third parameter is a hash of { "event:name": "eventHandler" }
589
589
  // configuration. Multiple handlers can be separated by a space. A
590
- // function can be supplied instead of a string handler name.
590
+ // function can be supplied instead of a string handler name.
591
591
 
592
592
  (function(Marionette){
593
593
  "use strict";
@@ -629,7 +629,7 @@ Marionette.MonitorDOMRefresh = (function(){
629
629
  target.stopListening(entity, evt, method, target);
630
630
  }
631
631
 
632
-
632
+
633
633
  // generic looping function
634
634
  function iterateEvents(target, entity, bindings, functionCallback, stringCallback){
635
635
  if (!entity || !bindings) { return; }
@@ -642,7 +642,7 @@ Marionette.MonitorDOMRefresh = (function(){
642
642
  // iterate the bindings and bind them
643
643
  _.each(bindings, function(methods, evt){
644
644
 
645
- // allow for a function as the handler,
645
+ // allow for a function as the handler,
646
646
  // or a list of event names as a string
647
647
  if (_.isFunction(methods)){
648
648
  functionCallback(target, entity, evt, methods);
@@ -652,7 +652,7 @@ Marionette.MonitorDOMRefresh = (function(){
652
652
 
653
653
  });
654
654
  }
655
-
655
+
656
656
  // Export Public API
657
657
  Marionette.bindEntityEvents = function(target, entity, bindings){
658
658
  iterateEvents(target, entity, bindings, bindToFunction, bindFromStrings);
@@ -679,7 +679,7 @@ Marionette.Callbacks = function(){
679
679
  _.extend(Marionette.Callbacks.prototype, {
680
680
 
681
681
  // Add a callback to be executed. Callbacks added here are
682
- // guaranteed to execute, even if they are added after the
682
+ // guaranteed to execute, even if they are added after the
683
683
  // `run` method is called.
684
684
  add: function(callback, contextOverride){
685
685
  this._callbacks.push({cb: callback, ctx: contextOverride});
@@ -690,8 +690,8 @@ _.extend(Marionette.Callbacks.prototype, {
690
690
  });
691
691
  },
692
692
 
693
- // Run all registered callbacks with the context specified.
694
- // Additional callbacks can be added after this has been run
693
+ // Run all registered callbacks with the context specified.
694
+ // Additional callbacks can be added after this has been run
695
695
  // and they will still be executed.
696
696
  run: function(options, context){
697
697
  this._deferred.resolve(context, options);
@@ -703,7 +703,7 @@ _.extend(Marionette.Callbacks.prototype, {
703
703
  var callbacks = this._callbacks;
704
704
  this._deferred = Marionette.$.Deferred();
705
705
  this._callbacks = [];
706
-
706
+
707
707
  _.each(callbacks, function(cb){
708
708
  this.add(cb.cb, cb.ctx);
709
709
  }, this);
@@ -740,7 +740,7 @@ _.extend(Marionette.Controller.prototype, Backbone.Events, {
740
740
  }
741
741
  });
742
742
 
743
- // Region
743
+ // Region
744
744
  // ------
745
745
  //
746
746
  // Manage the visual regions of your composite application. See
@@ -795,19 +795,19 @@ _.extend(Marionette.Region, {
795
795
  }
796
796
 
797
797
  var selector, RegionType;
798
-
798
+
799
799
  // get the selector for the region
800
-
800
+
801
801
  if (regionIsString) {
802
802
  selector = regionConfig;
803
- }
803
+ }
804
804
 
805
805
  if (regionConfig.selector) {
806
806
  selector = regionConfig.selector;
807
807
  }
808
808
 
809
809
  // get the type for the region
810
-
810
+
811
811
  if (regionIsType){
812
812
  RegionType = regionConfig;
813
813
  }
@@ -819,7 +819,7 @@ _.extend(Marionette.Region, {
819
819
  if (regionConfig.regionType) {
820
820
  RegionType = regionConfig.regionType;
821
821
  }
822
-
822
+
823
823
  // build the region instance
824
824
  var region = new RegionType({
825
825
  el: selector
@@ -874,7 +874,7 @@ _.extend(Marionette.Region.prototype, Backbone.Events, {
874
874
  if (isDifferentView || isViewClosed) {
875
875
  this.open(view);
876
876
  }
877
-
877
+
878
878
  this.currentView = view;
879
879
 
880
880
  Marionette.triggerMethod.call(this, "show", view);
@@ -914,8 +914,8 @@ _.extend(Marionette.Region.prototype, Backbone.Events, {
914
914
  delete this.currentView;
915
915
  },
916
916
 
917
- // Attach an existing view to the region. This
918
- // will not call `render` or `onShow` for the new view,
917
+ // Attach an existing view to the region. This
918
+ // will not call `render` or `onShow` for the new view,
919
919
  // and will not replace the current HTML for the `el`
920
920
  // of the region.
921
921
  attachView: function(view){
@@ -1052,9 +1052,9 @@ Marionette.RegionManager = (function(Marionette){
1052
1052
  //
1053
1053
  // Mix in methods from Underscore, for iteration, and other
1054
1054
  // collection related features.
1055
- var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter',
1056
- 'select', 'reject', 'every', 'all', 'some', 'any', 'include',
1057
- 'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',
1055
+ var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter',
1056
+ 'select', 'reject', 'every', 'all', 'some', 'any', 'include',
1057
+ 'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',
1058
1058
  'last', 'without', 'isEmpty', 'pluck'];
1059
1059
 
1060
1060
  _.each(methods, function(method) {
@@ -1079,7 +1079,7 @@ Marionette.TemplateCache = function(templateId){
1079
1079
  };
1080
1080
 
1081
1081
  // TemplateCache object-level methods. Manage the template
1082
- // caches from these method calls instead of creating
1082
+ // caches from these method calls instead of creating
1083
1083
  // your own TemplateCache instances
1084
1084
  _.extend(Marionette.TemplateCache, {
1085
1085
  templateCaches: {},
@@ -1102,7 +1102,7 @@ _.extend(Marionette.TemplateCache, {
1102
1102
  // are specified, clears all templates:
1103
1103
  // `clear()`
1104
1104
  //
1105
- // If arguments are specified, clears each of the
1105
+ // If arguments are specified, clears each of the
1106
1106
  // specified templates from the cache:
1107
1107
  // `clear("#t1", "#t2", "...")`
1108
1108
  clear: function(){
@@ -1142,7 +1142,7 @@ _.extend(Marionette.TemplateCache.prototype, {
1142
1142
  // Load a template from the DOM, by default. Override
1143
1143
  // this method to provide your own template retrieval
1144
1144
  // For asynchronous loading with AMD/RequireJS, consider
1145
- // using a template-loader plugin as described here:
1145
+ // using a template-loader plugin as described here:
1146
1146
  // https://github.com/marionettejs/backbone.marionette/wiki/Using-marionette-with-requirejs
1147
1147
  loadTemplate: function(templateId){
1148
1148
  var template = Marionette.$(templateId).html();
@@ -1202,10 +1202,16 @@ Marionette.Renderer = {
1202
1202
  // The core view type that other Marionette views extend from.
1203
1203
  Marionette.View = Backbone.View.extend({
1204
1204
 
1205
- constructor: function(){
1205
+ constructor: function(options){
1206
1206
  _.bindAll(this, "render");
1207
1207
 
1208
1208
  var args = Array.prototype.slice.apply(arguments);
1209
+
1210
+ // this exposes view options to the view initializer
1211
+ // this is a backfill since backbone removed the assignment
1212
+ // of this.options
1213
+ // at some point however this may be removed
1214
+ this.options = options || {};
1209
1215
  Backbone.View.prototype.constructor.apply(this, args);
1210
1216
 
1211
1217
  Marionette.MonitorDOMRefresh(this);
@@ -1213,7 +1219,7 @@ Marionette.View = Backbone.View.extend({
1213
1219
  },
1214
1220
 
1215
1221
  // import the "triggerMethod" to trigger events with corresponding
1216
- // methods if the method exists
1222
+ // methods if the method exists
1217
1223
  triggerMethod: Marionette.triggerMethod,
1218
1224
 
1219
1225
  // Get the template for this view
@@ -1252,12 +1258,23 @@ Marionette.View = Backbone.View.extend({
1252
1258
  // action and stop propagation of DOM events
1253
1259
  _.each(triggers, function(value, key){
1254
1260
 
1261
+ var hasOptions = _.isObject(value);
1262
+ var eventName = hasOptions ? value.event : value;
1263
+
1255
1264
  // build the event handler function for the DOM event
1256
1265
  triggerEvents[key] = function(e){
1257
1266
 
1258
1267
  // stop the event in its tracks
1259
- if (e && e.preventDefault){ e.preventDefault(); }
1260
- if (e && e.stopPropagation){ e.stopPropagation(); }
1268
+ if (e) {
1269
+ var prevent = e.preventDefault;
1270
+ var stop = e.stopPropagation;
1271
+
1272
+ var shouldPrevent = hasOptions ? value.preventDefault : prevent;
1273
+ var shouldStop = hasOptions ? value.stopPropagation : stop;
1274
+
1275
+ if (shouldPrevent && prevent) { prevent.apply(e); }
1276
+ if (shouldStop && stop) { stop.apply(e); }
1277
+ }
1261
1278
 
1262
1279
  // build the args for the event
1263
1280
  var args = {
@@ -1267,7 +1284,7 @@ Marionette.View = Backbone.View.extend({
1267
1284
  };
1268
1285
 
1269
1286
  // trigger the event
1270
- this.triggerMethod(value, args);
1287
+ this.triggerMethod(eventName, args);
1271
1288
  };
1272
1289
 
1273
1290
  }, this);
@@ -1275,7 +1292,7 @@ Marionette.View = Backbone.View.extend({
1275
1292
  return triggerEvents;
1276
1293
  },
1277
1294
 
1278
- // Overriding Backbone.View's delegateEvents to handle
1295
+ // Overriding Backbone.View's delegateEvents to handle
1279
1296
  // the `triggers`, `modelEvents`, and `collectionEvents` configuration
1280
1297
  delegateEvents: function(events){
1281
1298
  this._delegateDOMEvents(events);
@@ -1381,8 +1398,8 @@ Marionette.View = Backbone.View.extend({
1381
1398
  // with underscore.js templates, serializing the view's model or collection,
1382
1399
  // and calling several methods on extended views, such as `onRender`.
1383
1400
  Marionette.ItemView = Marionette.View.extend({
1384
-
1385
- // Setting up the inheritance chain which allows changes to
1401
+
1402
+ // Setting up the inheritance chain which allows changes to
1386
1403
  // Marionette.View.prototype.constructor which allows overriding
1387
1404
  constructor: function(){
1388
1405
  Marionette.View.prototype.constructor.apply(this, slice(arguments));
@@ -1545,7 +1562,7 @@ Marionette.CollectionView = Marionette.View.extend({
1545
1562
  // a collection of item views, when the collection is
1546
1563
  // empty
1547
1564
  showEmptyView: function(){
1548
- var EmptyView = Marionette.getOption(this, "emptyView");
1565
+ var EmptyView = this.getEmptyView();
1549
1566
 
1550
1567
  if (EmptyView && !this._showingEmptyView){
1551
1568
  this._showingEmptyView = true;
@@ -1564,6 +1581,11 @@ Marionette.CollectionView = Marionette.View.extend({
1564
1581
  }
1565
1582
  },
1566
1583
 
1584
+ // Retrieve the empty view type
1585
+ getEmptyView: function(){
1586
+ return Marionette.getOption(this, "emptyView");
1587
+ },
1588
+
1567
1589
  // Retrieve the itemView type, either from `this.options.itemView`
1568
1590
  // or from the `itemView` in the object definition. The "options"
1569
1591
  // takes precedence.
@@ -1586,9 +1608,9 @@ Marionette.CollectionView = Marionette.View.extend({
1586
1608
  itemViewOptions = itemViewOptions.call(this, item, index);
1587
1609
  }
1588
1610
 
1589
- // build the view
1611
+ // build the view
1590
1612
  var view = this.buildItemView(item, ItemView, itemViewOptions);
1591
-
1613
+
1592
1614
  // set up the child view event forwarding
1593
1615
  this.addChildViewEventForwarding(view);
1594
1616
 
@@ -1859,7 +1881,7 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
1859
1881
  // Used for composite view management and sub-application areas.
1860
1882
  Marionette.Layout = Marionette.ItemView.extend({
1861
1883
  regionType: Marionette.Region,
1862
-
1884
+
1863
1885
  // Ensure the regions are available when the `initialize` method
1864
1886
  // is called.
1865
1887
  constructor: function (options) {
@@ -1867,7 +1889,7 @@ Marionette.Layout = Marionette.ItemView.extend({
1867
1889
 
1868
1890
  this._firstRender = true;
1869
1891
  this._initializeRegions(options);
1870
-
1892
+
1871
1893
  Marionette.ItemView.prototype.constructor.call(this, options);
1872
1894
  },
1873
1895
 
@@ -1878,7 +1900,7 @@ Marionette.Layout = Marionette.ItemView.extend({
1878
1900
  render: function(){
1879
1901
 
1880
1902
  if (this.isClosed){
1881
- // a previously closed layout means we need to
1903
+ // a previously closed layout means we need to
1882
1904
  // completely re-initialize the regions
1883
1905
  this._initializeRegions();
1884
1906
  }
@@ -1887,7 +1909,7 @@ Marionette.Layout = Marionette.ItemView.extend({
1887
1909
  // reset the regions
1888
1910
  this._firstRender = false;
1889
1911
  } else if (!this.isClosed){
1890
- // If this is not the first render call, then we need to
1912
+ // If this is not the first render call, then we need to
1891
1913
  // re-initializing the `el` for each region
1892
1914
  this._reInitializeRegions();
1893
1915
  }
@@ -1938,7 +1960,7 @@ Marionette.Layout = Marionette.ItemView.extend({
1938
1960
  },
1939
1961
 
1940
1962
  // Internal method to initialize the regions that have been defined in a
1941
- // `regions` attribute on this layout.
1963
+ // `regions` attribute on this layout.
1942
1964
  _initializeRegions: function (options) {
1943
1965
  var regions;
1944
1966
  this._initRegionManager();
@@ -1989,7 +2011,7 @@ Marionette.Layout = Marionette.ItemView.extend({
1989
2011
  //
1990
2012
  // Configure an AppRouter with `appRoutes`.
1991
2013
  //
1992
- // App routers can only take one `controller` object.
2014
+ // App routers can only take one `controller` object.
1993
2015
  // It is recommended that you divide your controller
1994
2016
  // objects in to smaller pieces of related functionality
1995
2017
  // and have multiple routers / controllers, instead of
@@ -2001,7 +2023,7 @@ Marionette.AppRouter = Backbone.Router.extend({
2001
2023
 
2002
2024
  constructor: function(options){
2003
2025
  Backbone.Router.prototype.constructor.apply(this, slice(arguments));
2004
-
2026
+
2005
2027
  this.options = options || {};
2006
2028
 
2007
2029
  var appRoutes = Marionette.getOption(this, "appRoutes");
@@ -2095,7 +2117,7 @@ _.extend(Marionette.Application.prototype, Backbone.Events, {
2095
2117
  this.triggerMethod("start", options);
2096
2118
  },
2097
2119
 
2098
- // Add regions to your app.
2120
+ // Add regions to your app.
2099
2121
  // Accepts a hash of named strings or Region objects
2100
2122
  // addRegions({something: "#someRegion"})
2101
2123
  // addRegions({something: Region.extend({el: "#someRegion"}) });
@@ -2114,7 +2136,7 @@ _.extend(Marionette.Application.prototype, Backbone.Events, {
2114
2136
  removeRegion: function(region) {
2115
2137
  this._regionManager.removeRegion(region);
2116
2138
  },
2117
-
2139
+
2118
2140
  // Provides alternative access to regions
2119
2141
  // Accepts the region name
2120
2142
  // getRegion('main')
@@ -2312,7 +2334,7 @@ _.extend(Marionette.Module, {
2312
2334
  },
2313
2335
 
2314
2336
  _addModuleDefinition: function(parentModule, module, def, args){
2315
- var fn;
2337
+ var fn;
2316
2338
  var startWithParent;
2317
2339
 
2318
2340
  if (_.isFunction(def)){
@@ -2324,7 +2346,7 @@ _.extend(Marionette.Module, {
2324
2346
  // if an object is supplied
2325
2347
  fn = def.define;
2326
2348
  startWithParent = def.startWithParent;
2327
-
2349
+
2328
2350
  } else {
2329
2351
  // if nothing is supplied
2330
2352
  startWithParent = true;
@@ -2360,4 +2382,4 @@ _.extend(Marionette.Module, {
2360
2382
 
2361
2383
 
2362
2384
  return Marionette;
2363
- })(this, Backbone, _);
2385
+ })(this, Backbone, _);
@@ -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","_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,OAAOhB,MAAKiB,UAAUN,IAIxBO,aAAc,SAASC,GACrB,GAAIR,GAAUX,KAAKG,eAAegB,EAClC,OAAOnB,MAAKiB,UAAUN,IAKxBS,YAAa,SAASD,GACpB,MAAOtB,GAAEwB,OAAOrB,KA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ASrT,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
+ {"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","hasOptions","e","prevent","preventDefault","stop","stopPropagation","shouldPrevent","shouldStop","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","getEmptyView","_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","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,a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M9B,UACvB6S,GAAW/D,OAAO,EAAG,GAGrBkE,EAAcA,EAAYxN,MAAM,IAChC,IAAIrF,GAAS6S,EAAY7S,OAGrB8S,IAWJ,OAVAA,GAAkB9S,EAAO,GAAKyS,EAG9B5U,EAAEQ,KAAKwU,EAAa,SAASd,EAAY3H,GACvC,GAAI2I,GAAepB,CACnBA,GAAS3T,KAAKgV,WAAWD,EAAchB,EAAYC,GACnDhU,KAAKiV,qBAAqBF,EAAcpB,EAAQmB,EAAkB1I,GAAIsI,IACrE1U,MAGI2T,GAGTqB,WAAY,SAASD,EAAchB,EAAYC,GAE7C,GAAIL,GAASoB,EAAahB,EAU1B,OARKJ,KAEHA,EAAS,GAAIrR,GAAWuR,OAAOE,EAAYC,GAC3Ce,EAAahB,GAAcJ,EAE3BoB,EAAa1B,WAAWU,GAAcJ,GAGjCA,GAGTsB,qBAAsB,SAASF,EAAcpB,EAAQuB,EAAKpT,GACxD,GAAIqT,GACAjB,CAEArU,GAAEkC,WAAWmT,IAEfC,EAAKD,EACLhB,GAAkB,GAETrU,EAAEqD,SAASgS,IAEpBC,EAAKD,EAAIE,OACTlB,EAAkBgB,EAAIhB,iBAItBA,GAAkB,EAIhBiB,GACFxB,EAAOa,cAAcW,EAAIrT,GAK3B6R,EAAOO,gBAAkBP,EAAOO,iBAAmBA,EAG/CP,EAAOO,kBAAoBP,EAAO0B,8BAGpC1B,EAAO0B,6BAA8B,EAGrCN,EAAazB,eAAe,SAAS9Q,GAC/BmR,EAAOO,iBACTP,EAAOH,MAAMhR,SAWdF,GACNtC,KAAML,SAAUE"}
@@ -1,6 +1,6 @@
1
1
  // MarionetteJS (Backbone.Marionette)
2
2
  // ----------------------------------
3
- // v1.1.0
3
+ // v1.2.2
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 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
- //@ sourceMappingURL=backbone.marionette.map
20
+ Backbone.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;this._views[c]=a,a.model&&(this._indexByModel[a.model.cid]=c),b&&(this._indexByCustom[b]=c),this._updateLength()},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;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()},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}(Backbone,_),Backbone.Wreqr=function(a,b,c){"use strict";var d={};return 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)throw new Error("Handler not found for '"+a+"'");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,c),d.CommandStorage=function(){var b=function(a){this.options=a,this._commands={},c.isFunction(this.initialize)&&this.initialize(a)};return c.extend(b.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=[]}}),b}(),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,b,d){var e=this.storage.getCommands(a);c.each(e.instances,function(a){b.apply(d,a)}),this.storage.clearCommands(a)},_initializeStorage:function(a){var b,d=a.storageType||this.storageType;b=c.isFunction(d)?new d:d,this.storage=b}})}(d),d.RequestResponse=function(a){return a.Handlers.extend({request:function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);return this.getHandler(a).apply(this,b)}})}(d),d.EventAggregator=function(a,b){var c=function(){};return c.extend=a.Model.extend,b.extend(c.prototype,a.Events),c}(a,c),d}(Backbone,Backbone.Marionette,_);var Marionette=function(a,b,c){"use strict";function d(a){return g.call(a)}function e(a,b){var c=new Error(a);throw c.name=b||"Error",c}var f={};b.Marionette=f,f.$=b.$;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&&b in a.options&&void 0!==a.options[b]?a.options[b]:a[b]}},f.triggerMethod=function(){function a(a,b,c){return c.toUpperCase()}var b=/(^|:)(\w)/gi,d=function(d){var e="on"+d.replace(b,a),f=this[e];return c.isFunction(this.trigger)&&this.trigger.apply(this,arguments),c.isFunction(f)?f.apply(this,c.tail(arguments)):void 0};return d}(),f.MonitorDOMRefresh=function(){function a(a){a._isShown=!0,d(a)}function b(a){a._isRendered=!0,d(a)}function d(a){a._isShown&&a._isRendered&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}return function(c){c.listenTo(c,"show",function(){a(c)}),c.listenTo(c,"render",function(){b(c)})}}(),function(a){function b(a,b,d,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||e("Method '"+c+"' was configured as an event handler, but does not exist."),a.listenTo(b,d,f,a)})}function d(a,b,c,d){a.listenTo(b,c,d,a)}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,a)})}function g(a,b,c,d){a.stopListening(b,c,d,a)}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,e){h(a,c,e,d,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)}}(f),f.Callbacks=function(){this._deferred=f.$.Deferred(),this._callbacks=[]},c.extend(f.Callbacks.prototype,{add:function(a,b){this._callbacks.push({cb:a,ctx:b}),this._deferred.done(function(c,d){b&&(c=b),a.call(c,d)})},run:function(a,b){this._deferred.resolve(b,a)},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.triggerMethod=f.triggerMethod,this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},f.Controller.extend=f.extend,c.extend(f.Controller.prototype,b.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),f.Region=function(a){if(this.options=a||{},this.el=f.getOption(this,"el"),!this.el){var b=new Error("An 'el' must be specified for a region.");throw b.name="NoElError",b}if(this.initialize){var c=Array.prototype.slice.apply(arguments);this.initialize.apply(this,c)}},c.extend(f.Region,{buildRegion:function(a,b){var d="string"==typeof a,e="string"==typeof a.selector,f="undefined"==typeof a.regionType,g="function"==typeof a;if(!g&&!d&&!e)throw new Error("Region must be specified as a Region type, a selector string or an object with selector property");var h,i;d&&(h=a),a.selector&&(h=a.selector),g&&(i=a),!g&&f&&(i=b),a.regionType&&(i=a.regionType);var j=new i({el:h});return a.parentEl&&(j.getEl=function(b){var d=a.parentEl;return c.isFunction(d)&&(d=d()),d.find(b)}),j}}),c.extend(f.Region.prototype,b.Events,{show:function(a){this.ensureEl();var b=a.isClosed||c.isUndefined(a.$el),d=a!==this.currentView;d&&this.close(),a.render(),(d||b)&&this.open(a),this.currentView=a,f.triggerMethod.call(this,"show",a),f.triggerMethod.call(a,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(a){return f.$(a)},open:function(a){this.$el.empty().append(a.el)},close:function(){var a=this.currentView;a&&!a.isClosed&&(a.close?a.close():a.remove&&a.remove(),f.triggerMethod.call(this,"close"),delete this.currentView)},attachView:function(a){this.currentView=a},reset:function(){this.close(),delete this.$el}}),f.Region.extend=f.extend,f.RegionManager=function(a){var b=a.Controller.extend({constructor:function(b){this._regions={},a.Controller.prototype.constructor.call(this,b)},addRegions:function(a,b){var d={};return c.each(a,function(a,e){"string"==typeof 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._store(b,e),this.triggerMethod("region:add",b,e),e},get:function(a){return this._regions[a]},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)},closeRegions:function(){c.each(this._regions,function(a){a.close()},this)},close:function(){this.removeRegions();var b=Array.prototype.slice.call(arguments);a.Controller.prototype.close.apply(this,b)},_store:function(a,b){this._regions[a]=b,this._setLength()},_remove:function(a,b){b.close(),delete this._regions[a],this._setLength(),this.triggerMethod("region:remove",a,b)},_setLength:function(){this.length=c.size(this._regions)}}),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 c.each(d,function(a){b.prototype[a]=function(){var b=c.values(this._regions),d=[b].concat(c.toArray(arguments));return c[a].apply(c,d)}}),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=d(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 b=f.$(a).html();return b&&0!==b.length||e("Could not find template: '"+a+"'","NoTemplateError"),b},compileTemplate:function(a){return c.template(a)}}),f.Renderer={render:function(a,b){if(!a){var c=new Error("Cannot render the template since it's false, null or undefined.");throw c.name="TemplateNotFoundError",c}var d;return d="function"==typeof a?a:f.TemplateCache.get(a),d(b)}},f.View=b.View.extend({constructor:function(a){c.bindAll(this,"render");var d=Array.prototype.slice.apply(arguments);this.options=a||{},b.View.prototype.constructor.apply(this,d),f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:f.triggerMethod,getTemplate:function(){return f.getOption(this,"template")},mixinTemplateHelpers:function(a){a=a||{};var b=f.getOption(this,"templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},configureTriggers:function(){if(this.triggers){var a={},b=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),f.bindEntityEvents(this,this.model,f.getOption(this,"modelEvents")),f.bindEntityEvents(this,this.collection,f.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this));var d={},e=this.configureTriggers();c.extend(d,a,e),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=Array.prototype.slice.call(arguments);b.View.prototype.undelegateEvents.apply(this,a),f.unbindEntityEvents(this,this.model,f.getOption(this,"modelEvents")),f.unbindEntityEvents(this,this.collection,f.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var a=this.triggerMethod("before:close");a!==!1&&(this.isClosed=!0,this.triggerMethod("close"),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)}}),f.ItemView=f.View.extend({constructor:function(){f.View.prototype.constructor.apply(this,d(arguments))},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this.isClosed=!1,this.triggerMethod("before:render",this),this.triggerMethod("item:before:render",this);var a=this.serializeData();a=this.mixinTemplateHelpers(a);var b=this.getTemplate(),c=f.Renderer.render(b,a);return this.$el.html(c),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),f.View.prototype.close.apply(this,d(arguments)),this.triggerMethod("item:closed"))}}),f.CollectionView=f.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),f.View.prototype.constructor.apply(this,d(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(a){this.closeEmptyView();var b=this.getItemView(a),c=this.collection.indexOf(a);this.addItemView(a,b,c)},onShowCalled:function(){this.children.each(function(a){f.triggerMethod.call(a,"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 a;this.collection.each(function(b,c){a=this.getItemView(b),this.addItemView(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this._showingEmptyView=!0;var c=new b.Model;this.addItemView(c,a,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getEmptyView:function(){return f.getOption(this,"emptyView")},getItemView:function(){var a=f.getOption(this,"itemView");return a||e("An `itemView` must be specified","NoItemViewError"),a},addItemView:function(a,b,d){var e=f.getOption(this,"itemViewOptions");c.isFunction(e)&&(e=e.call(this,a,d));var g=this.buildItemView(a,b,e);this.addChildViewEventForwarding(g),this.triggerMethod("before:item:added",g),this.children.add(g),this.renderItemView(g,d),this._isShown&&f.triggerMethod.call(g,"show"),this.triggerMethod("after:item:added",g)},addChildViewEventForwarding:function(a){var b=f.getOption(this,"itemViewEventPrefix");this.listenTo(a,"all",function(){var c=d(arguments);c[0]=b+":"+c[0],c.splice(1,0,a),f.triggerMethod.apply(this,c)},this)},renderItemView:function(a,b){a.render(),this.appendHtml(this,a,b)},buildItemView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeItemView:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},removeChildView:function(a){a&&(this.stopListening(a),a.close?a.close():a.remove&&a.remove(),this.children.remove(a)),this.triggerMethod("item:removed",a)},checkEmpty:function(){this.collection&&0!==this.collection.length||this.showEmptyView()},appendHtml:function(a,b){a.$el.append(b.el)},_initChildViewStorage:function(){this.children=new b.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),f.View.prototype.close.apply(this,d(arguments)))},closeChildren:function(){this.children.each(function(a){this.removeChildView(a)},this),this.checkEmpty()}}),f.CompositeView=f.CollectionView.extend({constructor:function(){f.CollectionView.prototype.constructor.apply(this,d(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 a=f.getOption(this,"itemView")||this.constructor;return a||e("An `itemView` must be specified","NoItemViewError"),a},serializeData:function(){var a={};return this.model&&(a=this.model.toJSON()),a},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var a=this.renderModel();return this.$el.html(a),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(f.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var a={};a=this.serializeData(),a=this.mixinTemplateHelpers(a);var b=this.getTemplate();return f.Renderer.render(b,a)},appendHtml:function(a,b){var c=this.getItemViewContainer(a);c.append(b.el)},getItemViewContainer:function(a){if("$itemViewContainer"in a)return a.$itemViewContainer;var b,d=f.getOption(a,"itemViewContainer");if(d){var g=c.isFunction(d)?d():d;b=a.$(g),b.length<=0&&e("The specified `itemViewContainer` was not found: "+a.itemViewContainer,"ItemViewContainerMissingError")}else b=a.$el;return a.$itemViewContainer=b,b},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),f.Layout=f.ItemView.extend({regionType:f.Region,constructor:function(a){a=a||{},this._firstRender=!0,this._initializeRegions(a),f.ItemView.prototype.constructor.call(this,a)},render:function(){this.isClosed&&this._initializeRegions(),this._firstRender?this._firstRender=!1:this.isClosed||this._reInitializeRegions();var a=Array.prototype.slice.apply(arguments),b=f.ItemView.prototype.render.apply(this,a);return b},close:function(){if(!this.isClosed){this.regionManager.close();var a=Array.prototype.slice.apply(arguments);f.ItemView.prototype.close.apply(this,a)}},addRegion:function(a,b){var c={};return c[a]=b,this._buildRegions(c)[a]},addRegions:function(a){return this.regions=c.extend({},this.regions,a),this._buildRegions(a)},removeRegion:function(a){return delete this.regions[a],this.regionManager.removeRegion(a)},_buildRegions:function(a){var b=this,c={regionType:f.getOption(this,"regionType"),parentEl:function(){return b.$el}};return this.regionManager.addRegions(a,c)},_initializeRegions:function(a){var b;this._initRegionManager(),b=c.isFunction(this.regions)?this.regions(a):this.regions||{},this.addRegions(b)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(a){a.reset()})},_initRegionManager:function(){this.regionManager=new f.RegionManager,this.listenTo(this.regionManager,"region:add",function(a,b){this[a]=b,this.trigger("region:add",a,b)}),this.listenTo(this.regionManager,"region:remove",function(a,b){delete this[a],this.trigger("region:remove",a,b)})}}),f.AppRouter=b.Router.extend({constructor:function(a){b.Router.prototype.constructor.apply(this,d(arguments)),this.options=a||{};var c=f.getOption(this,"appRoutes"),e=this._getController();this.processAppRoutes(e,c)},appRoute:function(a,b){var c=this._getController();this._addAppRoute(c,a,b)},processAppRoutes:function(a,b){if(b){var d=c.keys(b).reverse();c.each(d,function(c){this._addAppRoute(a,c,b[c])},this)}},_getController:function(){return f.getOption(this,"controller")},_addAppRoute:function(a,b,d){var e=a[d];if(!e)throw new Error("Method '"+d+"' was not found on the controller");this.route(b,d,c.bind(e,a))}}),f.Application=function(a){this._initRegionManager(),this._initCallbacks=new f.Callbacks,this.vent=new b.Wreqr.EventAggregator,this.commands=new b.Wreqr.Commands,this.reqres=new b.Wreqr.RequestResponse,this.submodules={},c.extend(this,a),this.triggerMethod=f.triggerMethod},c.extend(f.Application.prototype,b.Events,{execute:function(){var a=Array.prototype.slice.apply(arguments);this.commands.execute.apply(this.commands,a)},request:function(){var a=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,a)},addInitializer:function(a){this._initCallbacks.add(a)},start:function(a){this.triggerMethod("initialize:before",a),this._initCallbacks.run(a,this),this.triggerMethod("initialize:after",a),this.triggerMethod("start",a)},addRegions:function(a){return this._regionManager.addRegions(a)},closeRegions:function(){this._regionManager.closeRegions()},removeRegion:function(a){this._regionManager.removeRegion(a)},getRegion:function(a){return this._regionManager.get(a)},module:function(){var a=d(arguments);return a.unshift(this),f.Module.create.apply(f.Module,a)},_initRegionManager:function(){this._regionManager=new f.RegionManager,this.listenTo(this._regionManager,"region:add",function(a,b){this[a]=b}),this.listenTo(this._regionManager,"region:remove",function(a){delete this[a]})}}),f.Application.extend=f.extend,f.Module=function(a,b){this.moduleName=a,this.submodules={},this._setupInitializersAndFinalizers(),this.app=b,this.startWithParent=!0,this.triggerMethod=f.triggerMethod},c.extend(f.Module.prototype,b.Events,{addInitializer:function(a){this._initializerCallbacks.add(a)},addFinalizer:function(a){this._finalizerCallbacks.add(a)},start:function(a){this._isInitialized||(c.each(this.submodules,function(b){b.startWithParent&&b.start(a)}),this.triggerMethod("before:start",a),this._initializerCallbacks.run(a,this),this._isInitialized=!0,this.triggerMethod("start",a))},stop:function(){this._isInitialized&&(this._isInitialized=!1,f.triggerMethod.call(this,"before:stop"),c.each(this.submodules,function(a){a.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),f.triggerMethod.call(this,"stop"))},addDefinition:function(a,b){this._runModuleDefinition(a,b)},_runModuleDefinition:function(a,d){if(a){var e=c.flatten([this,this.app,b,f,f.$,c,d]);a.apply(this,e)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new f.Callbacks,this._finalizerCallbacks=new f.Callbacks}}),c.extend(f.Module,{create:function(a,b,e){var f=a,g=d(arguments);g.splice(0,3),b=b.split(".");var h=b.length,i=[];return i[h-1]=e,c.each(b,function(b,c){var d=f;f=this._getModule(d,b,a),this._addModuleDefinition(d,f,i[c],g)},this),f},_getModule:function(a,b,c){var d=a[b];return d||(d=new f.Module(b,c),a[b]=d,a.submodules[b]=d),d},_addModuleDefinition:function(a,b,d,e){var f,g;c.isFunction(d)?(f=d,g=!0):c.isObject(d)?(f=d.define,g=d.startWithParent):g=!0,f&&b.addDefinition(f,e),b.startWithParent=b.startWithParent&&g,b.startWithParent&&!b.startWithParentIsConfigured&&(b.startWithParentIsConfigured=!0,a.addInitializer(function(a){b.startWithParent&&b.start(a)}))}}),f}(this,Backbone,_);
21
+ //# sourceMappingURL=backbone.marionette.map
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionette-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godfrey Chan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-14 00:00:00.000000000 Z
12
+ date: 2013-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  version: 1.3.6
60
60
  requirements: []
61
61
  rubyforge_project:
62
- rubygems_version: 2.0.3
62
+ rubygems_version: 2.1.10
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: Backbone.Marionette for Rails