marionette-rails 1.6.2 → 1.6.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce783772b3a710b81bc088a08f3f2932abbd16a1
|
4
|
+
data.tar.gz: c39e2b8a39a0f073e501e59403781efd7275e65c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2067b7107503c59c2d89344a55e3858505b32893ca38b4e740d68862edec10308e02b8614c4a71c379ef3f2666f34af742a7154fc7b08a86610e6f2470b06ab
|
7
|
+
data.tar.gz: cf32b18e79facea0af191dbe70375feab46c6bf2623f30452d47db0a2b11c0399544188adcf69ff22c9288d2c95aa6ba447f95b5f0d1fce4cc6a41832623366e
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// MarionetteJS (Backbone.Marionette)
|
2
2
|
// ----------------------------------
|
3
|
-
// v1.6.
|
3
|
+
// v1.6.3
|
4
4
|
//
|
5
5
|
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
|
6
6
|
// Distributed under MIT license
|
@@ -19,12 +19,12 @@
|
|
19
19
|
|
20
20
|
// Backbone.BabySitter
|
21
21
|
// -------------------
|
22
|
-
// v0.0
|
22
|
+
// v0.1.0
|
23
23
|
//
|
24
|
-
// Copyright (c)
|
24
|
+
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
|
25
25
|
// Distributed under MIT license
|
26
26
|
//
|
27
|
-
// http://github.com/
|
27
|
+
// http://github.com/marionettejs/backbone.babysitter
|
28
28
|
|
29
29
|
// Backbone.ChildViewContainer
|
30
30
|
// ---------------------------
|
@@ -72,6 +72,7 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
72
72
|
}
|
73
73
|
|
74
74
|
this._updateLength();
|
75
|
+
return this;
|
75
76
|
},
|
76
77
|
|
77
78
|
// Find a view by the model that was attached to
|
@@ -100,7 +101,7 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
100
101
|
return _.values(this._views)[index];
|
101
102
|
},
|
102
103
|
|
103
|
-
// retrieve a view by
|
104
|
+
// retrieve a view by its `cid` directly
|
104
105
|
findByCid: function(cid){
|
105
106
|
return this._views[cid];
|
106
107
|
},
|
@@ -127,6 +128,7 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
127
128
|
|
128
129
|
// update the length
|
129
130
|
this._updateLength();
|
131
|
+
return this;
|
130
132
|
},
|
131
133
|
|
132
134
|
// Call a method on every view in the container,
|
@@ -177,9 +179,9 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
177
179
|
|
178
180
|
// Backbone.Wreqr (Backbone.Marionette)
|
179
181
|
// ----------------------------------
|
180
|
-
//
|
182
|
+
// v1.0.0
|
181
183
|
//
|
182
|
-
// Copyright (c)
|
184
|
+
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
|
183
185
|
// Distributed under MIT license
|
184
186
|
//
|
185
187
|
// http://github.com/marionettejs/backbone.wreqr
|
@@ -456,10 +458,7 @@ var Marionette = (function(global, Backbone, _){
|
|
456
458
|
// -------
|
457
459
|
|
458
460
|
// For slicing `arguments` in functions
|
459
|
-
var
|
460
|
-
function slice(args) {
|
461
|
-
return protoSlice.call(args);
|
462
|
-
}
|
461
|
+
var slice = Array.prototype.slice;
|
463
462
|
|
464
463
|
function throwError(message, name) {
|
465
464
|
var error = new Error(message);
|
@@ -510,6 +509,7 @@ Marionette.normalizeMethods = function(hash) {
|
|
510
509
|
}, this);
|
511
510
|
return normalizedHash;
|
512
511
|
};
|
512
|
+
|
513
513
|
// Trigger an event and/or a corresponding method name. Examples:
|
514
514
|
//
|
515
515
|
// `this.triggerMethod("foo")` will trigger the "foo" event and
|
@@ -627,13 +627,13 @@ Marionette.MonitorDOMRefresh = (function(documentElement){
|
|
627
627
|
throwError("Method '"+ methodName +"' was configured as an event handler, but does not exist.");
|
628
628
|
}
|
629
629
|
|
630
|
-
target.listenTo(entity, evt, method
|
630
|
+
target.listenTo(entity, evt, method);
|
631
631
|
});
|
632
632
|
}
|
633
633
|
|
634
634
|
// Bind the event to a supplied callback function
|
635
635
|
function bindToFunction(target, entity, evt, method){
|
636
|
-
target.listenTo(entity, evt, method
|
636
|
+
target.listenTo(entity, evt, method);
|
637
637
|
}
|
638
638
|
|
639
639
|
// Bind the event to handlers specified as a string of
|
@@ -643,13 +643,13 @@ Marionette.MonitorDOMRefresh = (function(documentElement){
|
|
643
643
|
|
644
644
|
_.each(methodNames,function(methodName) {
|
645
645
|
var method = target[methodName];
|
646
|
-
target.stopListening(entity, evt, method
|
646
|
+
target.stopListening(entity, evt, method);
|
647
647
|
});
|
648
648
|
}
|
649
649
|
|
650
650
|
// Bind the event to a supplied callback function
|
651
651
|
function unbindToFunction(target, entity, evt, method){
|
652
|
-
target.stopListening(entity, evt, method
|
652
|
+
target.stopListening(entity, evt, method);
|
653
653
|
}
|
654
654
|
|
655
655
|
|
@@ -774,9 +774,7 @@ Marionette.Region = function(options){
|
|
774
774
|
this.el = Marionette.getOption(this, "el");
|
775
775
|
|
776
776
|
if (!this.el){
|
777
|
-
|
778
|
-
err.name = "NoElError";
|
779
|
-
throw err;
|
777
|
+
throwError("An 'el' must be specified for a region.", "NoElError");
|
780
778
|
}
|
781
779
|
|
782
780
|
if (this.initialize){
|
@@ -806,13 +804,13 @@ _.extend(Marionette.Region, {
|
|
806
804
|
// ```
|
807
805
|
//
|
808
806
|
buildRegion: function(regionConfig, defaultRegionType){
|
809
|
-
var regionIsString = (
|
810
|
-
var regionSelectorIsString = (
|
811
|
-
var regionTypeIsUndefined = (
|
812
|
-
var regionIsType = (
|
807
|
+
var regionIsString = _.isString(regionConfig);
|
808
|
+
var regionSelectorIsString = _.isString(regionConfig.selector);
|
809
|
+
var regionTypeIsUndefined = _.isUndefined(regionConfig.regionType);
|
810
|
+
var regionIsType = _.isFunction(regionConfig);
|
813
811
|
|
814
812
|
if (!regionIsType && !regionIsString && !regionSelectorIsString) {
|
815
|
-
|
813
|
+
throwError("Region must be specified as a Region type, a selector string or an object with selector property");
|
816
814
|
}
|
817
815
|
|
818
816
|
var selector, RegionType;
|
@@ -978,7 +976,7 @@ Marionette.RegionManager = (function(Marionette){
|
|
978
976
|
var regions = {};
|
979
977
|
|
980
978
|
_.each(regionDefinitions, function(definition, name){
|
981
|
-
if (
|
979
|
+
if (_.isString(definition)){
|
982
980
|
definition = { selector: definition };
|
983
981
|
}
|
984
982
|
|
@@ -1046,8 +1044,7 @@ Marionette.RegionManager = (function(Marionette){
|
|
1046
1044
|
// manager entirely
|
1047
1045
|
close: function(){
|
1048
1046
|
this.removeRegions();
|
1049
|
-
|
1050
|
-
Marionette.Controller.prototype.close.apply(this, args);
|
1047
|
+
Marionette.Controller.prototype.close.apply(this, arguments);
|
1051
1048
|
},
|
1052
1049
|
|
1053
1050
|
// internal method to store regions
|
@@ -1131,7 +1128,7 @@ _.extend(Marionette.TemplateCache, {
|
|
1131
1128
|
// `clear("#t1", "#t2", "...")`
|
1132
1129
|
clear: function(){
|
1133
1130
|
var i;
|
1134
|
-
var args = slice(arguments);
|
1131
|
+
var args = slice.call(arguments);
|
1135
1132
|
var length = args.length;
|
1136
1133
|
|
1137
1134
|
if (length > 0){
|
@@ -1202,9 +1199,7 @@ Marionette.Renderer = {
|
|
1202
1199
|
render: function(template, data){
|
1203
1200
|
|
1204
1201
|
if (!template) {
|
1205
|
-
|
1206
|
-
error.name = "TemplateNotFoundError";
|
1207
|
-
throw error;
|
1202
|
+
throwError("Cannot render the template since it's false, null or undefined.", "TemplateNotFoundError");
|
1208
1203
|
}
|
1209
1204
|
|
1210
1205
|
var templateFunc;
|
@@ -1229,8 +1224,6 @@ Marionette.View = Backbone.View.extend({
|
|
1229
1224
|
constructor: function(options){
|
1230
1225
|
_.bindAll(this, "render");
|
1231
1226
|
|
1232
|
-
var args = Array.prototype.slice.apply(arguments);
|
1233
|
-
|
1234
1227
|
// this exposes view options to the view initializer
|
1235
1228
|
// this is a backfill since backbone removed the assignment
|
1236
1229
|
// of this.options
|
@@ -1239,10 +1232,10 @@ Marionette.View = Backbone.View.extend({
|
|
1239
1232
|
|
1240
1233
|
// parses out the @ui DSL for events
|
1241
1234
|
this.events = this.normalizeUIKeys(_.result(this, 'events'));
|
1242
|
-
Backbone.View.prototype.constructor.apply(this,
|
1235
|
+
Backbone.View.prototype.constructor.apply(this, arguments);
|
1243
1236
|
|
1244
1237
|
Marionette.MonitorDOMRefresh(this);
|
1245
|
-
this.listenTo(this, "show", this.onShowCalled
|
1238
|
+
this.listenTo(this, "show", this.onShowCalled);
|
1246
1239
|
},
|
1247
1240
|
|
1248
1241
|
// import the "triggerMethod" to trigger events with corresponding
|
@@ -1279,17 +1272,20 @@ Marionette.View = Backbone.View.extend({
|
|
1279
1272
|
// a given key for triggers and events
|
1280
1273
|
// swaps the @ui with the associated selector
|
1281
1274
|
normalizeUIKeys: function(hash) {
|
1275
|
+
var _this = this;
|
1282
1276
|
if (typeof(hash) === "undefined") {
|
1283
1277
|
return;
|
1284
1278
|
}
|
1285
1279
|
|
1286
1280
|
_.each(_.keys(hash), function(v) {
|
1287
|
-
var
|
1288
|
-
if (
|
1289
|
-
hash[
|
1281
|
+
var pattern = /@ui.[a-zA-Z_$0-9]*/g;
|
1282
|
+
if (v.match(pattern)) {
|
1283
|
+
hash[v.replace(pattern, function(r) {
|
1284
|
+
return _.result(_this, "ui")[r.slice(4)];
|
1285
|
+
})] = hash[v];
|
1290
1286
|
delete hash[v];
|
1291
1287
|
}
|
1292
|
-
}
|
1288
|
+
});
|
1293
1289
|
|
1294
1290
|
return hash;
|
1295
1291
|
},
|
@@ -1452,7 +1448,7 @@ Marionette.ItemView = Marionette.View.extend({
|
|
1452
1448
|
// Setting up the inheritance chain which allows changes to
|
1453
1449
|
// Marionette.View.prototype.constructor which allows overriding
|
1454
1450
|
constructor: function(){
|
1455
|
-
Marionette.View.prototype.constructor.apply(this,
|
1451
|
+
Marionette.View.prototype.constructor.apply(this, arguments);
|
1456
1452
|
},
|
1457
1453
|
|
1458
1454
|
// Serialize the model or collection for the view. If a model is
|
@@ -1507,7 +1503,7 @@ Marionette.ItemView = Marionette.View.extend({
|
|
1507
1503
|
|
1508
1504
|
this.triggerMethod('item:before:close');
|
1509
1505
|
|
1510
|
-
Marionette.View.prototype.close.apply(this,
|
1506
|
+
Marionette.View.prototype.close.apply(this, arguments);
|
1511
1507
|
|
1512
1508
|
this.triggerMethod('item:closed');
|
1513
1509
|
}
|
@@ -1527,7 +1523,7 @@ Marionette.CollectionView = Marionette.View.extend({
|
|
1527
1523
|
constructor: function(options){
|
1528
1524
|
this._initChildViewStorage();
|
1529
1525
|
|
1530
|
-
Marionette.View.prototype.constructor.apply(this,
|
1526
|
+
Marionette.View.prototype.constructor.apply(this, arguments);
|
1531
1527
|
|
1532
1528
|
this._initialEvents();
|
1533
1529
|
this.initRenderBuffer();
|
@@ -1566,9 +1562,9 @@ Marionette.CollectionView = Marionette.View.extend({
|
|
1566
1562
|
// binds to.
|
1567
1563
|
_initialEvents: function(){
|
1568
1564
|
if (this.collection){
|
1569
|
-
this.listenTo(this.collection, "add", this.addChildView
|
1570
|
-
this.listenTo(this.collection, "remove", this.removeItemView
|
1571
|
-
this.listenTo(this.collection, "reset", this.render
|
1565
|
+
this.listenTo(this.collection, "add", this.addChildView);
|
1566
|
+
this.listenTo(this.collection, "remove", this.removeItemView);
|
1567
|
+
this.listenTo(this.collection, "reset", this.render);
|
1572
1568
|
}
|
1573
1569
|
},
|
1574
1570
|
|
@@ -1727,7 +1723,7 @@ Marionette.CollectionView = Marionette.View.extend({
|
|
1727
1723
|
// Forward all child item view events through the parent,
|
1728
1724
|
// prepending "itemview:" to the event name
|
1729
1725
|
this.listenTo(view, "all", function(){
|
1730
|
-
var args = slice(arguments);
|
1726
|
+
var args = slice.call(arguments);
|
1731
1727
|
var rootEvent = args[0];
|
1732
1728
|
var itemEvents = this.normalizeMethods(this.getItemEvents());
|
1733
1729
|
|
@@ -1809,7 +1805,7 @@ Marionette.CollectionView = Marionette.View.extend({
|
|
1809
1805
|
|
1810
1806
|
// Append the HTML to the collection's `el`.
|
1811
1807
|
// Override this method to do something other
|
1812
|
-
//
|
1808
|
+
// than `.append`.
|
1813
1809
|
appendHtml: function(collectionView, itemView, index){
|
1814
1810
|
if (collectionView.isBuffering) {
|
1815
1811
|
// buffering happens on reset events and initial renders
|
@@ -1840,7 +1836,7 @@ Marionette.CollectionView = Marionette.View.extend({
|
|
1840
1836
|
this.closeChildren();
|
1841
1837
|
this.triggerMethod("collection:closed");
|
1842
1838
|
|
1843
|
-
Marionette.View.prototype.close.apply(this,
|
1839
|
+
Marionette.View.prototype.close.apply(this, arguments);
|
1844
1840
|
},
|
1845
1841
|
|
1846
1842
|
// Close the child views that this collection view
|
@@ -1865,7 +1861,7 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
|
|
1865
1861
|
// Setting up the inheritance chain which allows changes to
|
1866
1862
|
// Marionette.CollectionView.prototype.constructor which allows overriding
|
1867
1863
|
constructor: function(){
|
1868
|
-
Marionette.CollectionView.prototype.constructor.apply(this,
|
1864
|
+
Marionette.CollectionView.prototype.constructor.apply(this, arguments);
|
1869
1865
|
},
|
1870
1866
|
|
1871
1867
|
// Configured the initial events that the composite view
|
@@ -1873,13 +1869,13 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
|
|
1873
1869
|
// events, or to add your own initial events.
|
1874
1870
|
_initialEvents: function(){
|
1875
1871
|
|
1876
|
-
// Bind only after composite view
|
1877
|
-
// to
|
1872
|
+
// Bind only after composite view is rendered to avoid adding child views
|
1873
|
+
// to nonexistent itemViewContainer
|
1878
1874
|
this.once('render', function () {
|
1879
1875
|
if (this.collection){
|
1880
|
-
this.listenTo(this.collection, "add", this.addChildView
|
1881
|
-
this.listenTo(this.collection, "remove", this.removeItemView
|
1882
|
-
this.listenTo(this.collection, "reset", this._renderChildren
|
1876
|
+
this.listenTo(this.collection, "add", this.addChildView);
|
1877
|
+
this.listenTo(this.collection, "remove", this.removeItemView);
|
1878
|
+
this.listenTo(this.collection, "reset", this._renderChildren);
|
1883
1879
|
}
|
1884
1880
|
});
|
1885
1881
|
|
@@ -2059,18 +2055,14 @@ Marionette.Layout = Marionette.ItemView.extend({
|
|
2059
2055
|
this._reInitializeRegions();
|
2060
2056
|
}
|
2061
2057
|
|
2062
|
-
|
2063
|
-
var result = Marionette.ItemView.prototype.render.apply(this, args);
|
2064
|
-
|
2065
|
-
return result;
|
2058
|
+
return Marionette.ItemView.prototype.render.apply(this, arguments);
|
2066
2059
|
},
|
2067
2060
|
|
2068
2061
|
// Handle closing regions, and then close the view itself.
|
2069
2062
|
close: function () {
|
2070
2063
|
if (this.isClosed){ return; }
|
2071
2064
|
this.regionManager.close();
|
2072
|
-
|
2073
|
-
Marionette.ItemView.prototype.close.apply(this, args);
|
2065
|
+
Marionette.ItemView.prototype.close.apply(this, arguments);
|
2074
2066
|
},
|
2075
2067
|
|
2076
2068
|
// Add a single region, by name, to the layout
|
@@ -2167,8 +2159,8 @@ Marionette.Layout = Marionette.ItemView.extend({
|
|
2167
2159
|
Marionette.AppRouter = Backbone.Router.extend({
|
2168
2160
|
|
2169
2161
|
constructor: function(options){
|
2170
|
-
Backbone.Router.prototype.constructor.apply(this,
|
2171
|
-
|
2162
|
+
Backbone.Router.prototype.constructor.apply(this, arguments);
|
2163
|
+
|
2172
2164
|
this.options = options || {};
|
2173
2165
|
|
2174
2166
|
var appRoutes = Marionette.getOption(this, "appRoutes");
|
@@ -2204,7 +2196,7 @@ Marionette.AppRouter = Backbone.Router.extend({
|
|
2204
2196
|
var method = controller[methodName];
|
2205
2197
|
|
2206
2198
|
if (!method) {
|
2207
|
-
|
2199
|
+
throwError("Method '" + methodName + "' was not found on the controller");
|
2208
2200
|
}
|
2209
2201
|
|
2210
2202
|
this.route(route, methodName, _.bind(method, controller));
|
@@ -2234,14 +2226,12 @@ Marionette.Application = function(options){
|
|
2234
2226
|
_.extend(Marionette.Application.prototype, Backbone.Events, {
|
2235
2227
|
// Command execution, facilitated by Backbone.Wreqr.Commands
|
2236
2228
|
execute: function(){
|
2237
|
-
|
2238
|
-
this.commands.execute.apply(this.commands, args);
|
2229
|
+
this.commands.execute.apply(this.commands, arguments);
|
2239
2230
|
},
|
2240
2231
|
|
2241
2232
|
// Request/response, facilitated by Backbone.Wreqr.RequestResponse
|
2242
2233
|
request: function(){
|
2243
|
-
|
2244
|
-
return this.reqres.request.apply(this.reqres, args);
|
2234
|
+
return this.reqres.request.apply(this.reqres, arguments);
|
2245
2235
|
},
|
2246
2236
|
|
2247
2237
|
// Add an initializer that is either run at when the `start`
|
@@ -2291,16 +2281,13 @@ _.extend(Marionette.Application.prototype, Backbone.Events, {
|
|
2291
2281
|
|
2292
2282
|
// Create a module, attached to the application
|
2293
2283
|
module: function(moduleNames, moduleDefinition){
|
2294
|
-
var ModuleClass = Marionette.Module;
|
2295
2284
|
|
2296
2285
|
// Overwrite the module class if the user specifies one
|
2297
|
-
|
2298
|
-
ModuleClass = moduleDefinition.moduleClass || ModuleClass;
|
2299
|
-
}
|
2286
|
+
var ModuleClass = Marionette.Module.getClass(moduleDefinition);
|
2300
2287
|
|
2301
2288
|
// slice the args, and add this application object as the
|
2302
2289
|
// first argument of the array
|
2303
|
-
var args = slice(arguments);
|
2290
|
+
var args = slice.call(arguments);
|
2304
2291
|
args.unshift(this);
|
2305
2292
|
|
2306
2293
|
// see the Marionette.Module object for more information
|
@@ -2460,7 +2447,7 @@ _.extend(Marionette.Module, {
|
|
2460
2447
|
|
2461
2448
|
// get the custom args passed in after the module definition and
|
2462
2449
|
// get rid of the module name and definition function
|
2463
|
-
var customArgs = slice(arguments);
|
2450
|
+
var customArgs = slice.call(arguments);
|
2464
2451
|
customArgs.splice(0, 3);
|
2465
2452
|
|
2466
2453
|
// split the module names and get the length
|
@@ -2483,11 +2470,8 @@ _.extend(Marionette.Module, {
|
|
2483
2470
|
},
|
2484
2471
|
|
2485
2472
|
_getModule: function(parentModule, moduleName, app, def, args){
|
2486
|
-
var ModuleClass = Marionette.Module;
|
2487
2473
|
var options = _.extend({}, def);
|
2488
|
-
|
2489
|
-
ModuleClass = def.moduleClass || ModuleClass;
|
2490
|
-
}
|
2474
|
+
var ModuleClass = this.getClass(def);
|
2491
2475
|
|
2492
2476
|
// Get an existing module of this name if we have one
|
2493
2477
|
var module = parentModule[moduleName];
|
@@ -2503,6 +2487,20 @@ _.extend(Marionette.Module, {
|
|
2503
2487
|
return module;
|
2504
2488
|
},
|
2505
2489
|
|
2490
|
+
getClass: function(moduleDefinition) {
|
2491
|
+
var ModuleClass = Marionette.Module;
|
2492
|
+
|
2493
|
+
if (!moduleDefinition) {
|
2494
|
+
return ModuleClass;
|
2495
|
+
}
|
2496
|
+
|
2497
|
+
if (moduleDefinition.prototype instanceof ModuleClass) {
|
2498
|
+
return moduleDefinition;
|
2499
|
+
}
|
2500
|
+
|
2501
|
+
return moduleDefinition.moduleClass || ModuleClass;
|
2502
|
+
},
|
2503
|
+
|
2506
2504
|
_addModuleDefinition: function(parentModule, module, def, args){
|
2507
2505
|
var fn;
|
2508
2506
|
var startWithParent;
|
@@ -2515,7 +2513,7 @@ _.extend(Marionette.Module, {
|
|
2515
2513
|
} else if (_.isObject(def)){
|
2516
2514
|
// if an object is supplied
|
2517
2515
|
fn = def.define;
|
2518
|
-
startWithParent = (
|
2516
|
+
startWithParent = !_.isUndefined(def.startWithParent) ? def.startWithParent : true;
|
2519
2517
|
|
2520
2518
|
} else {
|
2521
2519
|
// if nothing is supplied
|
@@ -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","normalizeMethods","hash","normalizedHash","fn","triggerMethod","getEventName","match","prefix","eventName","toUpperCase","splitter","event","methodName","replace","MonitorDOMRefresh","documentElement","handleShow","_isShown","triggerDOMRefresh","handleRender","_isRendered","isInDOM","contains","el","listenTo","document","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","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","result","events","normalizeUIKeys","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","keys","v","ui","configureTriggers","triggers","triggerEvents","hasOptions","e","prevent","preventDefault","stop","stopPropagation","shouldPrevent","shouldStop","collection","delegateEvents","_delegateDOMEvents","combinedEvents","undelegateEvents","shouldClose","unbindUIElements","bindUIElements","_uiBindings","ItemView","serializeData","toJSON","items","CollectionView","itemViewEventPrefix","_initChildViewStorage","_initialEvents","initRenderBuffer","elBuffer","createDocumentFragment","_bufferedChildren","startBuffering","isBuffering","endBuffering","appendBuffer","_triggerShowBufferedChildren","child","addChildView","removeItemView","item","closeEmptyView","getItemView","indexOf","addItemView","children","triggerBeforeRender","triggerRendered","_renderChildren","closeChildren","isEmpty","showEmptyView","showCollection","EmptyView","getEmptyView","_showingEmptyView","itemView","itemViewOptions","buildItemView","addChildViewEventForwarding","renderItemView","rootEvent","itemEvents","getItemEvents","splice","appendHtml","ItemViewType","removeChildView","checkEmpty","collectionView","buffer","appendChild","CompositeView","once","isRendered","resetItemViewContainer","renderModel","compositeView","$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","moduleNames","moduleDefinition","ModuleClass","Module","moduleClass","unshift","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","addDefinition","customArgs","_runModuleDefinition","flatten","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","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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EpB1Q,EAAK0Q,EAAIC,OACTf,EAAkD,mBAAxBc,GAAId,gBAAmCc,EAAId,iBAAkB,GAIvFA,GAAkB,EAIhB5P,GACFiP,EAAOiB,cAAclQ,EAAIrE,GAK3BsT,EAAOW,gBAAkBX,EAAOW,iBAAmBA,EAG/CX,EAAOW,kBAAoBX,EAAO2B,8BAGpC3B,EAAO2B,6BAA8B,EAGrCL,EAAa3B,eAAe,SAASvS,GAC/B4S,EAAOW,iBACTX,EAAOH,MAAMzS,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","throwError","message","error","$","getOption","target","optionName","value","undefined","normalizeMethods","hash","normalizedHash","fn","triggerMethod","getEventName","match","prefix","eventName","toUpperCase","splitter","event","methodName","replace","MonitorDOMRefresh","documentElement","handleShow","_isShown","triggerDOMRefresh","handleRender","_isRendered","isInDOM","contains","el","listenTo","document","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","buildRegion","regionConfig","defaultRegionType","regionIsString","isString","regionSelectorIsString","selector","regionTypeIsUndefined","isUndefined","regionType","regionIsType","RegionType","region","parentEl","getEl","find","show","ensureEl","isViewClosed","isClosed","$el","isDifferentView","currentView","render","open","empty","append","attachView","RegionManager","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","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","result","events","normalizeUIKeys","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","_this","keys","v","pattern","r","configureTriggers","triggers","triggerEvents","hasOptions","e","prevent","preventDefault","stop","stopPropagation","shouldPrevent","shouldStop","collection","delegateEvents","_delegateDOMEvents","combinedEvents","undelegateEvents","shouldClose","unbindUIElements","bindUIElements","ui","_uiBindings","ItemView","serializeData","toJSON","items","CollectionView","itemViewEventPrefix","_initChildViewStorage","_initialEvents","initRenderBuffer","elBuffer","createDocumentFragment","_bufferedChildren","startBuffering","isBuffering","endBuffering","appendBuffer","_triggerShowBufferedChildren","child","addChildView","removeItemView","item","closeEmptyView","getItemView","indexOf","addItemView","children","triggerBeforeRender","triggerRendered","_renderChildren","closeChildren","isEmpty","showEmptyView","showCollection","EmptyView","getEmptyView","_showingEmptyView","itemView","itemViewOptions","buildItemView","addChildViewEventForwarding","renderItemView","rootEvent","itemEvents","getItemEvents","splice","appendHtml","ItemViewType","removeChildView","checkEmpty","collectionView","buffer","appendChild","CompositeView","once","isRendered","resetItemViewContainer","renderModel","compositeView","$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","moduleNames","moduleDefinition","ModuleClass","Module","getClass","unshift","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","addDefinition","customArgs","_runModuleDefinition","flatten","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","moduleClass","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,GAgBnB,OAbAZ,MAAKC,OAAOU,GAAWF,EAGnBA,EAAKI,QACPb,KAAKE,cAAcO,EAAKI,MAAMD,KAAOD,GAInCD,IACFV,KAAKG,eAAeO,GAAeC,GAGrCX,KAAKI,gBACEJ,MAKTc,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,GAoBnB,OAjBIH,GAAKI,aACAb,MAAKE,cAAcO,EAAKI,MAAMD,KAIvCf,EAAE0B,IAAIvB,KAAKG,eAAgB,SAASS,EAAKY,GACvC,MAAIZ,KAAQD,SACHX,MAAKG,eAAeqB,IACpB,GAFT,QAICxB,YAGIA,MAAKC,OAA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,CAEAnW,GAAEkC,WAAW+U,IAEf5Q,EAAK4Q,EACLd,GAAkB,GAETnW,EAAEqD,SAAS4T,IAEpB5Q,EAAK4Q,EAAIE,OACThB,EAAmBnW,EAAEmK,YAAY8M,EAAId,kBAAyC,EAAtBc,EAAId,iBAI5DA,GAAkB,EAIhB9P,GACFmP,EAAOiB,cAAcpQ,EAAIpE,GAK3BuT,EAAOW,gBAAkBX,EAAOW,iBAAmBA,EAG/CX,EAAOW,kBAAoBX,EAAO4B,8BAGpC5B,EAAO4B,6BAA8B,EAGrCN,EAAa3B,eAAe,SAASxS,GAC/B6S,EAAOW,iBACTX,EAAOH,MAAM1S,SAWdF,GACNtC,KAAML,SAAUE"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// MarionetteJS (Backbone.Marionette)
|
2
2
|
// ----------------------------------
|
3
|
-
// v1.6.
|
3
|
+
// v1.6.3
|
4
4
|
//
|
5
5
|
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
|
6
6
|
// Distributed under MIT license
|
@@ -17,5 +17,6 @@
|
|
17
17
|
* https://github.com/marionettejs/backbone.wreqr/
|
18
18
|
*/
|
19
19
|
|
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.normalizeMethods=function(a){var b,d={};return c.each(a,function(a,e){b=a,c.isFunction(b)||(b=this[b]),b&&(d[e]=b)},this),d},f.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(a){function b(a){a._isShown=!0,e(a)}function d(a){a._isRendered=!0,e(a)}function e(a){a._isShown&&a._isRendered&&f(a)&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}function f(b){return a.contains(b.el)}return function(a){a.listenTo(a,"show",function(){b(a)}),a.listenTo(a,"render",function(){d(a)})}}(document.documentElement),function(a){function b(a,b,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,delete a.selector),g&&(i=a),!g&&f&&(i=b),a.regionType&&(i=a.regionType,delete a.regionType),(d||g)&&(a={}),a.el=h;var j=new i(a);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",a),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=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),b.View.prototype.constructor.apply(this,d),f.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:f.triggerMethod,normalizeMethods:f.normalizeMethods,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)},normalizeUIKeys:function(a){return"undefined"!=typeof a?(c.each(c.keys(a),function(b){var c=b.split("@ui.");2===c.length&&(a[c[0]+this.ui[c[1]]]=a[b],delete a[b])},this),a):void 0},configureTriggers:function(){if(this.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),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(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this.appendBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){f.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_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.startBuffering(),this.closeEmptyView(),this.closeChildren(),this.isEmpty(this.collection)?this.showEmptyView():this.showCollection(),this.endBuffering()},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);return this.addChildViewEventForwarding(g),this.triggerMethod("before:item:added",g),this.children.add(g),this.renderItemView(g,d),this._isShown&&!this.isBuffering&&f.triggerMethod.call(g,"show"),this.triggerMethod("after:item:added",g),g},addChildViewEventForwarding:function(a){var b=f.getOption(this,"itemViewEventPrefix");this.listenTo(a,"all",function(){var e=d(arguments),g=e[0],h=this.normalizeMethods(this.getItemEvents());e[0]=b+":"+g,e.splice(1,0,a),"undefined"!=typeof h&&c.isFunction(h[g])&&h[g].apply(this,e),f.triggerMethod.apply(this,e)},this)},getItemEvents:function(){return c.isFunction(this.itemEvents)?this.itemEvents.call(this):this.itemEvents},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)},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},appendBuffer:function(a,b){a.$el.append(b)},appendHtml:function(a,b){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(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.once("render",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&&(this.triggerMethod("composite:collection:before:render"),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)},appendBuffer:function(a,b){var c=this.getItemViewContainer(a);c.append(b)},appendHtml:function(a,b){if(a.isBuffering)a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b);else{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.call(this):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(a,b){var c=f.Module;b&&(c=b.moduleClass||c);var e=d(arguments);return e.unshift(this),c.create.apply(c,e)},_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,d){this.moduleName=a,this.options=c.extend({},this.options,d),this.initialize=d.initialize||this.initialize,this.submodules={},this._setupInitializersAndFinalizers(),this.app=b,this.startWithParent=!0,this.triggerMethod=f.triggerMethod,c.isFunction(this.initialize)&&this.initialize(this.options,a,b)},f.Module.extend=f.extend,c.extend(f.Module.prototype,b.Events,{initialize:function(){},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,e),this._addModuleDefinition(d,f,i[c],g)},this),f},_getModule:function(a,b,d,e){var g=f.Module,h=c.extend({},e);e&&(g=e.moduleClass||g);var i=a[b];return i||(i=new g(b,d,h),a[b]=i,a.submodules[b]=i),i},_addModuleDefinition:function(a,b,d,e){var f,g;c.isFunction(d)?(f=d,g=!0):c.isObject(d)?(f=d.define,g="undefined"!=typeof d.startWithParent?d.startWithParent:!0):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,_);
|
20
|
+
|
21
|
+
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;return this._views[c]=a,a.model&&(this._indexByModel[a.model.cid]=c),b&&(this._indexByCustom[b]=c),this._updateLength(),this},findByModel:function(a){return this.findByModelCid(a.cid)},findByModelCid:function(a){var b=this._indexByModel[a];return this.findByCid(b)},findByCustom:function(a){var b=this._indexByCustom[a];return this.findByCid(b)},findByIndex:function(a){return b.values(this._views)[a]},findByCid:function(a){return this._views[a]},remove:function(a){var c=a.cid;return a.model&&delete this._indexByModel[a.model.cid],b.any(this._indexByCustom,function(a,b){return a===c?(delete this._indexByCustom[b],!0):void 0},this),delete this._views[c],this._updateLength(),this},call:function(a){this.apply(a,b.tail(arguments))},apply:function(a,c){b.each(this._views,function(d){b.isFunction(d[a])&&d[a].apply(d,c||[])})},_updateLength:function(){this.length=b.size(this._views)}});var d=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return b.each(d,function(a){c.prototype[a]=function(){var c=b.values(this._views),d=[c].concat(b.toArray(arguments));return b[a].apply(b,d)}}),c}(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,b){var c=new Error(a);throw c.name=b||"Error",c}var e={};b.Marionette=e,e.$=b.$;var f=Array.prototype.slice;return e.extend=b.Model.extend,e.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]}},e.normalizeMethods=function(a){var b,d={};return c.each(a,function(a,e){b=a,c.isFunction(b)||(b=this[b]),b&&(d[e]=b)},this),d},e.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}(),e.MonitorDOMRefresh=function(a){function b(a){a._isShown=!0,e(a)}function d(a){a._isRendered=!0,e(a)}function e(a){a._isShown&&a._isRendered&&f(a)&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}function f(b){return a.contains(b.el)}return function(a){a.listenTo(a,"show",function(){b(a)}),a.listenTo(a,"render",function(){d(a)})}}(document.documentElement),function(a){function b(a,b,e,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||d("Method '"+c+"' was configured as an event handler, but does not exist."),a.listenTo(b,e,f)})}function e(a,b,c,d){a.listenTo(b,c,d)}function f(a,b,d,e){var f=e.split(/\s+/);c.each(f,function(c){var e=a[c];a.stopListening(b,d,e)})}function g(a,b,c,d){a.stopListening(b,c,d)}function h(a,b,d,e,f){b&&d&&(c.isFunction(d)&&(d=d.call(a)),c.each(d,function(d,g){c.isFunction(d)?e(a,b,g,d):f(a,b,g,d)}))}a.bindEntityEvents=function(a,c,d){h(a,c,d,e,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)}}(e),e.Callbacks=function(){this._deferred=e.$.Deferred(),this._callbacks=[]},c.extend(e.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=e.$.Deferred(),this._callbacks=[],c.each(a,function(a){this.add(a.cb,a.ctx)},this)}}),e.Controller=function(a){this.triggerMethod=e.triggerMethod,this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},e.Controller.extend=e.extend,c.extend(e.Controller.prototype,b.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),e.Region=function(a){if(this.options=a||{},this.el=e.getOption(this,"el"),this.el||d("An 'el' must be specified for a region.","NoElError"),this.initialize){var b=Array.prototype.slice.apply(arguments);this.initialize.apply(this,b)}},c.extend(e.Region,{buildRegion:function(a,b){var e=c.isString(a),f=c.isString(a.selector),g=c.isUndefined(a.regionType),h=c.isFunction(a);h||e||f||d("Region must be specified as a Region type, a selector string or an object with selector property");var i,j;e&&(i=a),a.selector&&(i=a.selector,delete a.selector),h&&(j=a),!h&&g&&(j=b),a.regionType&&(j=a.regionType,delete a.regionType),(e||h)&&(a={}),a.el=i;var k=new j(a);return a.parentEl&&(k.getEl=function(b){var d=a.parentEl;return c.isFunction(d)&&(d=d()),d.find(b)}),k}}),c.extend(e.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,e.triggerMethod.call(this,"show",a),e.triggerMethod.call(a,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(a){return e.$(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(),e.triggerMethod.call(this,"close",a),delete this.currentView)},attachView:function(a){this.currentView=a},reset:function(){this.close(),delete this.$el}}),e.Region.extend=e.extend,e.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){c.isString(a)&&(a={selector:a}),a.selector&&(a=c.defaults({},a,b));var f=this.addRegion(e,a);d[e]=f},this),d},addRegion:function(b,d){var e,f=c.isObject(d),g=c.isString(d),h=!!d.selector;return e=g||f&&h?a.Region.buildRegion(d,a.Region):c.isFunction(d)?a.Region.buildRegion(d,a.Region):d,this._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(),a.Controller.prototype.close.apply(this,arguments)},_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}(e),e.TemplateCache=function(a){this.templateId=a},c.extend(e.TemplateCache,{templateCaches:{},get:function(a){var b=this.templateCaches[a];return b||(b=new e.TemplateCache(a),this.templateCaches[a]=b),b.load()},clear:function(){var a,b=f.call(arguments),c=b.length;if(c>0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(e.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=e.$(a).html();return b&&0!==b.length||d("Could not find template: '"+a+"'","NoTemplateError"),b},compileTemplate:function(a){return c.template(a)}}),e.Renderer={render:function(a,b){a||d("Cannot render the template since it's false, null or undefined.","TemplateNotFoundError");var c;return(c="function"==typeof a?a:e.TemplateCache.get(a))(b)}},e.View=b.View.extend({constructor:function(a){c.bindAll(this,"render"),this.options=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),b.View.prototype.constructor.apply(this,arguments),e.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled)},triggerMethod:e.triggerMethod,normalizeMethods:e.normalizeMethods,getTemplate:function(){return e.getOption(this,"template")},mixinTemplateHelpers:function(a){a=a||{};var b=e.getOption(this,"templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},normalizeUIKeys:function(a){var b=this;if("undefined"!=typeof a)return c.each(c.keys(a),function(d){var e=/@ui.[a-zA-Z_$0-9]*/g;d.match(e)&&(a[d.replace(e,function(a){return c.result(b,"ui")[a.slice(4)]})]=a[d],delete a[d])}),a},configureTriggers:function(){if(this.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),e.bindEntityEvents(this,this.model,e.getOption(this,"modelEvents")),e.bindEntityEvents(this,this.collection,e.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),e.unbindEntityEvents(this,this.model,e.getOption(this,"modelEvents")),e.unbindEntityEvents(this,this.collection,e.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)}}),e.ItemView=e.View.extend({constructor:function(){e.View.prototype.constructor.apply(this,arguments)},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this.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=e.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"),e.View.prototype.close.apply(this,arguments),this.triggerMethod("item:closed"))}}),e.CollectionView=e.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),e.View.prototype.constructor.apply(this,arguments),this._initialEvents(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this.appendBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){e.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView),this.listenTo(this.collection,"remove",this.removeItemView),this.listenTo(this.collection,"reset",this.render))},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){e.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.startBuffering(),this.closeEmptyView(),this.closeChildren(),this.isEmpty(this.collection)?this.showEmptyView():this.showCollection(),this.endBuffering()},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 e.getOption(this,"emptyView")},getItemView:function(){var a=e.getOption(this,"itemView");return a||d("An `itemView` must be specified","NoItemViewError"),a},addItemView:function(a,b,d){var f=e.getOption(this,"itemViewOptions");c.isFunction(f)&&(f=f.call(this,a,d));var g=this.buildItemView(a,b,f);return this.addChildViewEventForwarding(g),this.triggerMethod("before:item:added",g),this.children.add(g),this.renderItemView(g,d),this._isShown&&!this.isBuffering&&e.triggerMethod.call(g,"show"),this.triggerMethod("after:item:added",g),g},addChildViewEventForwarding:function(a){var b=e.getOption(this,"itemViewEventPrefix");this.listenTo(a,"all",function(){var d=f.call(arguments),g=d[0],h=this.normalizeMethods(this.getItemEvents());d[0]=b+":"+g,d.splice(1,0,a),"undefined"!=typeof h&&c.isFunction(h[g])&&h[g].apply(this,d),e.triggerMethod.apply(this,d)},this)},getItemEvents:function(){return c.isFunction(this.itemEvents)?this.itemEvents.call(this):this.itemEvents},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)},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},appendBuffer:function(a,b){a.$el.append(b)},appendHtml:function(a,b){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(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"),e.View.prototype.close.apply(this,arguments))},closeChildren:function(){this.children.each(function(a){this.removeChildView(a)},this),this.checkEmpty()}}),e.CompositeView=e.CollectionView.extend({constructor:function(){e.CollectionView.prototype.constructor.apply(this,arguments)},_initialEvents:function(){this.once("render",function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView),this.listenTo(this.collection,"remove",this.removeItemView),this.listenTo(this.collection,"reset",this._renderChildren))})},getItemView:function(){var a=e.getOption(this,"itemView")||this.constructor;return a||d("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&&(this.triggerMethod("composite:collection:before:render"),e.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 e.Renderer.render(b,a)},appendBuffer:function(a,b){var c=this.getItemViewContainer(a);c.append(b)},appendHtml:function(a,b){if(a.isBuffering)a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b);else{var c=this.getItemViewContainer(a);c.append(b.el)}},getItemViewContainer:function(a){if("$itemViewContainer"in a)return a.$itemViewContainer;var b,f=e.getOption(a,"itemViewContainer");if(f){var g=c.isFunction(f)?f.call(this):f;b=a.$(g),b.length<=0&&d("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}}),e.Layout=e.ItemView.extend({regionType:e.Region,constructor:function(a){a=a||{},this._firstRender=!0,this._initializeRegions(a),e.ItemView.prototype.constructor.call(this,a)},render:function(){return this.isClosed&&this._initializeRegions(),this._firstRender?this._firstRender=!1:this.isClosed||this._reInitializeRegions(),e.ItemView.prototype.render.apply(this,arguments)},close:function(){this.isClosed||(this.regionManager.close(),e.ItemView.prototype.close.apply(this,arguments))},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:e.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 e.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)})}}),e.AppRouter=b.Router.extend({constructor:function(a){b.Router.prototype.constructor.apply(this,arguments),this.options=a||{};var c=e.getOption(this,"appRoutes"),d=this._getController();this.processAppRoutes(d,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 e.getOption(this,"controller")},_addAppRoute:function(a,b,e){var f=a[e];f||d("Method '"+e+"' was not found on the controller"),this.route(b,e,c.bind(f,a))}}),e.Application=function(a){this._initRegionManager(),this._initCallbacks=new e.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=e.triggerMethod},c.extend(e.Application.prototype,b.Events,{execute:function(){this.commands.execute.apply(this.commands,arguments)},request:function(){return this.reqres.request.apply(this.reqres,arguments)},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(a,b){var c=e.Module.getClass(b),d=f.call(arguments);return d.unshift(this),c.create.apply(c,d)},_initRegionManager:function(){this._regionManager=new e.RegionManager,this.listenTo(this._regionManager,"region:add",function(a,b){this[a]=b}),this.listenTo(this._regionManager,"region:remove",function(a){delete this[a]})}}),e.Application.extend=e.extend,e.Module=function(a,b,d){this.moduleName=a,this.options=c.extend({},this.options,d),this.initialize=d.initialize||this.initialize,this.submodules={},this._setupInitializersAndFinalizers(),this.app=b,this.startWithParent=!0,this.triggerMethod=e.triggerMethod,c.isFunction(this.initialize)&&this.initialize(this.options,a,b)},e.Module.extend=e.extend,c.extend(e.Module.prototype,b.Events,{initialize:function(){},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,e.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(),e.triggerMethod.call(this,"stop"))},addDefinition:function(a,b){this._runModuleDefinition(a,b)},_runModuleDefinition:function(a,d){if(a){var f=c.flatten([this,this.app,b,e,e.$,c,d]);a.apply(this,f)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new e.Callbacks,this._finalizerCallbacks=new e.Callbacks}}),c.extend(e.Module,{create:function(a,b,d){var e=a,g=f.call(arguments);g.splice(0,3),b=b.split(".");var h=b.length,i=[];return i[h-1]=d,c.each(b,function(b,c){var f=e;e=this._getModule(f,b,a,d),this._addModuleDefinition(f,e,i[c],g)},this),e},_getModule:function(a,b,d,e){var f=c.extend({},e),g=this.getClass(e),h=a[b];return h||(h=new g(b,d,f),a[b]=h,a.submodules[b]=h),h},getClass:function(a){var b=e.Module;return a?a.prototype instanceof b?a:a.moduleClass||b:b},_addModuleDefinition:function(a,b,d,e){var f,g;c.isFunction(d)?(f=d,g=!0):c.isObject(d)?(f=d.define,g=c.isUndefined(d.startWithParent)?!0: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)}))}}),e}(this,Backbone,_);
|
21
22
|
//# 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.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Godfrey Chan
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02
|
12
|
+
date: 2014-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: railties
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 3.1
|
20
|
+
version: '3.1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 3.1
|
27
|
+
version: '3.1'
|
28
28
|
description: Vendors Backbone.Marionette for use with the asset pipeline.
|
29
29
|
email:
|
30
30
|
- godfreykfc@gmail.com
|